There appears to be a race condition when creating a server and then quickly deleting a server in using Xen.
The trace is an example of a result of this race condition, but the general problem of what to do when an instance has not finished booting initially but we receive a delete should be addressed.
2011-11-29 18:12:26,422 WARNING nova.virt.xenapi [d999221b-b265-44f3-aba5-2de28a346564 None None] Task [Async.host.call_plugin] OpaqueRef:ddf715fd-05fe-082c-1481-4193f9cee736 status: failure ['XENAPI_PLUGIN_EXCEPTION', 'version', 'XenstoreError', "cmd: ['xenstore-rm', '/local/domain/270/data/host/5a7cafc3-8ce0-4b19-baac-7248e859b02e']; returncode: 1; stderr: xenstore-rm: could not remove path /local/domain/270/data/host/5a7cafc3-8ce0-4b19-baac-7248e859b02e\n; stdout: "]
2011-11-29 18:12:26,422 ERROR nova.virt.xenapi.vmops [-] The call to version returned an error: ['XENAPI_PLUGIN_EXCEPTION', 'version', 'XenstoreError', "cmd: ['xenstore-rm', '/local/domain/270/data/host/5a7cafc3-8ce0-4b19-baac-7248e859b02e']; returncode: 1; stderr: xenstore-rm: could not remove path /local/domain/270/data/host/5a7cafc3-8ce0-4b19-baac-7248e859b02e\n; stdout: "]. VM id=2232; args={'path': '', 'dom_id': '270', 'id': '5a7cafc3-8ce0-4b19-baac-7248e859b02e'}
2011-11-29 18:12:26,423 ERROR nova.virt.xenapi.vmops [-] Failed to query agent version: {'message': '; stdout: ', 'returncode': 'error'}
2011-11-29 18:12:26,472 WARNING nova.virt.xenapi.vmops [-] ['HANDLE_INVALID', 'VM', 'OpaqueRef:18a07139-2918-7551-ea50-508585bde4bc']
2011-11-29 18:12:26,472 ERROR nova.virt.xenapi.vmops [-] Instance instance-b79dce45-4ab0-4722-8eff-d97d4d69ee75: failed to boot
(nova.virt.xenapi.vmops): TRACE: Traceback (most recent call last):
(nova.virt.xenapi.vmops): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/xenapi/vmops.py", line 499, in _wait_for_boot
(nova.virt.xenapi.vmops): TRACE: _check_agent_version()
(nova.virt.xenapi.vmops): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/xenapi/vmops.py", line 440, in _check_agent_version
(nova.virt.xenapi.vmops): TRACE: version = self.get_agent_version(instance)
(nova.virt.xenapi.vmops): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/xenapi/vmops.py", line 852, in get_agent_version
(nova.virt.xenapi.vmops): TRACE: vm_rec = self._session.call_xenapi("VM.get_record", vm_ref)
(nova.virt.xenapi.vmops): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/xenapi_conn.py", line 491, in call_xenapi
(nova.virt.xenapi.vmops): TRACE: return tpool.execute(f, *args)
(nova.virt.xenapi.vmops): TRACE: File "/usr/lib/pymodules/python2.6/eventlet/tpool.py", line 76, in tworker
(nova.virt.xenapi.vmops): TRACE: rv = meth(*args,**kwargs)
(nova.virt.xenapi.vmops): TRACE: File "/usr/local/lib/python2.6/dist-packages/XenAPI.py", line 229, in __call__
(nova.virt.xenapi.vmops): TRACE: return self.__send(self.__name, args)
(nova.virt.xenapi.vmops): TRACE: File "/usr/local/lib/python2.6/dist-packages/XenAPI.py", line 133, in xenapi_request
(nova.virt.xenapi.vmops): TRACE: result = _parse_result(getattr(self, methodname)(*full_params))
(nova.virt.xenapi.vmops): TRACE: File "/usr/local/lib/python2.6/dist-packages/XenAPI.py", line 203, in _parse_result
(nova.virt.xenapi.vmops): TRACE: raise Failure(result['ErrorDescription'])
(nova.virt.xenapi.vmops): TRACE: Failure: ['HANDLE_INVALID', 'VM', 'OpaqueRef:18a07139-2918-7551-ea50-508585bde4bc']
(nova.virt.xenapi.vmops): TRACE:
Note further that create/delete isn't the only race condition, anything that interacts with Xen directly may have this same issue: pause/unpause, etc.