<HTML>
<HEAD>
<TITLE>Re: [Openstack] libvirt issues</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I’ve also had to run the following before.<BR>
Might be useful for others. Might be a bug somewhere that causes them to be leftover...<BR>
<BR>
$ more clear-domains.py <BR>
import libvirt<BR>
import sys<BR>
<BR>
connUri = "qemu:///system"<BR>
conn = libvirt.open(connUri)<BR>
<BR>
if(conn == None):<BR>
    print("Could not open connection to " + connUri)<BR>
    sys.exit(1)<BR>
    <BR>
<BR>
definedDomains = conn.listDefinedDomains()<BR>
am = len(definedDomains)<BR>
print("Found %s leftover domains" %(am))<BR>
print(definedDomains)<BR>
<BR>
if(am):<BR>
    print("Clearing %s domains" %(am))<BR>
    for domain in  definedDomains:<BR>
        print("Found domain " +domain)<BR>
        dom = conn.lookupByName(domain)<BR>
        print "Clearing domain id %d running %s" % (dom.ID(), dom.OSType())<BR>
        print(dom.info())<BR>
        dom.undefine()<BR>
<BR>
<BR>
<BR>
On 1/18/12 11:37 AM, "Anthony Young" <<a href="sleepsonthefloor@gmail.com">sleepsonthefloor@gmail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>It is likely that one of devstack, nova, openstackx, or dashboard are out-of-date.  You should update those directories, and then re-run stack.sh<BR>
<BR>
A<BR>
<BR>
On Wed, Jan 18, 2012 at 8:42 AM, Mohammad Banikazemi <<a href="mb@us.ibm.com">mb@us.ibm.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I resolved the 2nd problem by using "virsh undefine instance-00000002". Still have the 1st problem.<BR>
<BR>
<FONT COLOR="#424282">Mohammad Banikazemi---01/18/2012 11:36:03 AM---After the dashboard issues were resolved yesterday I run into the following problems:<BR>
</FONT><BR>
</SPAN><FONT COLOR="#5F5F5F"><FONT SIZE="2"><SPAN STYLE='font-size:10pt'>From: </SPAN></FONT></FONT><FONT SIZE="2"><SPAN STYLE='font-size:10pt'>Mohammad Banikazemi/Watson/IBM@IBMUS<BR>
<FONT COLOR="#5F5F5F">To: </FONT>openstack <<a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a></SPAN></FONT><SPAN STYLE='font-size:11pt'>>, <BR>
</SPAN><FONT COLOR="#5F5F5F"><FONT SIZE="2"><SPAN STYLE='font-size:10pt'>Date: </SPAN></FONT></FONT><FONT SIZE="2"><SPAN STYLE='font-size:10pt'>01/18/2012 11:36 AM<BR>
<FONT COLOR="#5F5F5F">Subject: </FONT>[Openstack] libvirt issues<BR>
<FONT COLOR="#5F5F5F">Sent by: </FONT><a href="openstack-bounces+mb=us.ibm.com@lists.launchpad.net">openstack-bounces+mb=us.ibm.com@lists.launchpad.net</a><BR>
</SPAN></FONT><SPAN STYLE='font-size:11pt'><HR ALIGN=LEFT SIZE="2" WIDTH="100%"NOSHADE><BR>
<BR>
<BR>
After the dashboard issues were resolved yesterday I run into the following problems:<BR>
<BR>
1- Now eventhough my dashboard interface looks ok I still keep getting the red box errors on top of my main page:<BR>
</SPAN><FONT COLOR="#FF0000"><FONT SIZE="4"><SPAN STYLE='font-size:14pt'><B>Error: </B>Unable to get service info: This error may be caused by a misconfigured Nova url in keystone's service catalog, or by missing openstackx extensions in Nova. See the Horizon README.<BR>
</SPAN></FONT></FONT><SPAN STYLE='font-size:11pt'>What am i missing here?<BR>
</SPAN><FONT SIZE="4"><SPAN STYLE='font-size:14pt'><BR>
</SPAN></FONT><SPAN STYLE='font-size:11pt'><BR>
2- I am not sure if this is related to the changes or something on my part has been modified incorrectly but trying to create a vm everything seems to be going fine until I see the following errors essentially saying there is a instance with the same name already and the vm does not get created. What am I doing wrong? The nova/instance directory is empty and since I start with devstack, the nova tables are all empty in the database.<BR>
</SPAN><FONT SIZE="4"><SPAN STYLE='font-size:14pt'><BR>
<B><BR>
libvir: Domain Config error : operation failed: domain 'instance-00000003' already exists with uuid 500d2d3e-df6c-8e6a-5775-c39b60c18997<BR>
</B></SPAN></FONT><SPAN STYLE='font-size:11pt'><BR>
2012-01-18 11 <tel:2012-01-18%2011> :14:28,641 ERROR nova.compute.manager [-] Instance 3e9ac9b4-c018-490d-a546-1b3a7d3ee5f4 failed to spawn<BR>
(nova.compute.manager): TRACE: Traceback (most recent call last):<BR>
(nova.compute.manager): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 507, in _spawn<BR>
(nova.compute.manager): TRACE:     network_info, block_device_info)<BR>
(nova.compute.manager): TRACE:   File "/opt/stack/nova/nova/exception.py", line 126, in wrapped<BR>
(nova.compute.manager): TRACE:     return f(*args, **kw)<BR>
(nova.compute.manager): TRACE:   File "/opt/stack/nova/nova/virt/libvirt/connection.py", line 679, in spawn<BR>
(nova.compute.manager): TRACE:     domain = self._create_new_domain(xml)<BR>
(nova.compute.manager): TRACE:   File "/opt/stack/nova/nova/virt/libvirt/connection.py", line 1261, in _create_new_domain<BR>
(nova.compute.manager): TRACE:     domain = self._conn.defineXML(xml)<BR>
(nova.compute.manager): TRACE:   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1708, in defineXML<BR>
(nova.compute.manager): TRACE:     if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)<BR>
(nova.compute.manager): TRACE: libvirtError: operation failed: domain 'instance-00000003' already exists with uuid 500d2d3e-df6c-8e6a-5775-c39b60c18997<BR>
(nova.compute.manager): TRACE: <BR>
2012-01-18 11 <tel:2012-01-18%2011> :14:28,644 DEBUG nova.compute.manager [-] deallocating network for instance: 3e9ac9b4-c018-490d-a546-1b3a7d3ee5f4 from (pid=3170) _deallocate_network /opt/stack/nova/nova/compute/manager.py:529<BR>
2012-01-18 11 <tel:2012-01-18%2011> :14:28,644 DEBUG nova.rpc [-] Making asynchronous cast on network... from (pid=3170) cast /opt/stack/nova/nova/rpc/impl_kombu.py:859<BR>
2012-01-18 11 <tel:2012-01-18%2011> :14:28,799 ERROR nova.rpc [-] Exception during message handling<BR>
(nova.rpc): TRACE: Traceback (most recent call last):<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/rpc/impl_kombu.py", line 723, in _process_data<BR>
(nova.rpc): TRACE:     rval = node_func(context=ctxt, **node_args)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/exception.py", line 126, in wrapped<BR>
(nova.rpc): TRACE:     return f(*args, **kw)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 149, in decorated_function<BR>
(nova.rpc): TRACE:     self.add_instance_fault_from_exc(context, instance_uuid, e)<BR>
(nova.rpc): TRACE:   File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__<BR>
(nova.rpc): TRACE:     self.gen.next()<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 144, in decorated_function<BR>
(nova.rpc): TRACE:     return function(self, context, instance_uuid, *args, **kwargs)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 561, in run_instance<BR>
(nova.rpc): TRACE:     self._run_instance(context, instance_uuid, **kwargs)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 390, in _run_instance<BR>
(nova.rpc): TRACE:     vm_state=vm_states.ERROR)<BR>
(nova.rpc): TRACE:   File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__<BR>
(nova.rpc): TRACE:     self.gen.next()<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 377, in _run_instance<BR>
(nova.rpc): TRACE:     self._deallocate_network(context, instance)<BR>
(nova.rpc): TRACE:   File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__<BR>
(nova.rpc): TRACE:     self.gen.next()<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 374, in _run_instance<BR>
(nova.rpc): TRACE:     injected_files, admin_password)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/compute/manager.py", line 507, in _spawn<BR>
(nova.rpc): TRACE:     network_info, block_device_info)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/exception.py", line 126, in wrapped<BR>
(nova.rpc): TRACE:     return f(*args, **kw)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/virt/libvirt/connection.py", line 679, in spawn<BR>
(nova.rpc): TRACE:     domain = self._create_new_domain(xml)<BR>
(nova.rpc): TRACE:   File "/opt/stack/nova/nova/virt/libvirt/connection.py", line 1261, in _create_new_domain<BR>
(nova.rpc): TRACE:     domain = self._conn.defineXML(xml)<BR>
(nova.rpc): TRACE:   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1708, in defineXML<BR>
(nova.rpc): TRACE:     if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)<BR>
(nova.rpc): TRACE: libvirtError: operation failed: domain 'instance-00000003' already exists with uuid 500d2d3e-df6c-8e6a-5775-c39b60c18997<BR>
(nova.rpc): TRACE: </SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
Post to     : <a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><BR>
</SPAN></FONT></FONT><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:11pt'>Unsubscribe : </SPAN><FONT SIZE="2"><SPAN STYLE='font-size:10pt'><a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
More help   : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
<BR>
_______________________________________________<BR>
Mailing list: <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
Post to     : <a href="openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><BR>
Unsubscribe : <a href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a><BR>
More help   : <a href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>