Live-migration nova fails with qemu and libvirt

Asked by Lucio Agostinho

Hi,
I posted two messages to ask.ubuntu about my problem without solution:
https://ask.openstack.org/en/question/12033/live-migration-with-qemu-is-possible/
https://ask.openstack.org/en/question/12134/live-migration-with-qemu-is-really-possible/
and I reported the problem in #openstack. Until now, I can't find a solution.

I'm using Openstack Havana in CentOS. I've installed 1 controller and 2 compute nodes, with NFS. Controller folder is shared by the compute nodes (folder /var/lib/nova/instances). All nodes are accessible among them without password. I can perform a migration in the dashboard. In the shell, I exaustivelly tried live migration without sucess. I'm setting /etc/nova/nova.conf and uncomment all live-migration options. I'm trying the following in the shell:

# nova live-migration MY_UUID_VM_INSTANCE my_host_destine

But silenty this command not works.

Finally, my log of /var/log/nova-all.log:

---
<0>Feb 17 20:19:43 node-4 ¿<179>nova-nova.openstack.common.rpc.amqp ERROR: Exception during message handling
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nova/openstack/common/rpc/amqp.py", line 461, in _process_data
    **args)
  File "/usr/lib/python2.6/site-packages/nova/openstack/common/rpc/dispatcher.py", line 172, in dispatch
    result = getattr(proxyobj, method)(ctxt, **kwargs)
  File "/usr/lib/python2.6/site-packages/nova/exception.py", line 90, in wrapped
    payload)
  File "/usr/lib/python2.6/site-packages/nova/exception.py", line 73, in wrapped
    return f(self, context, *args, **kw)
  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4016, in pre_live_migration
    migrate_data)
  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 4162, in pre_live_migration
    self._create_images_and_backing(context, instance, instance_dir,
UnboundLocalError: local variable 'instance_dir' referenced before assignment
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Auditing locally available compute resources
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free ram (MB): 1494
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free disk (GB): 14
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free VCPUS: 2
<0>Feb 17 20:20:16 node-4 ¿<182>nova-nova.compute.resource_tracker INFO: Compute_service record updated for node-4.domain.tld:node-4.domain.tld
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Auditing locally available compute resources
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free ram (MB): 1494
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free disk (GB): 14
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free VCPUS: 2
<0>Feb 17 20:21:15 node-4 ¿<182>nova-nova.compute.resource_tracker INFO: Compute_service record updated for node-4.domain.tld:node-4.domain.tld

---

This is a bug? Someone could help me? I should use KVM instead qemu? Any help is usefull. Thanks in advance.

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Lucio Agostinho (outrosdiasvirao-n) said :
#1

Hi,
I post two messages to ask.ubuntu about my problem without solution:
https://ask.openstack.org/en/question/12033/live-migration-with-qemu-is-possible/
https://ask.openstack.org/en/question/12134/live-migration-with-qemu-is-really-possible/
and I reported the problem in #openstack. Until now, I can't find a solution.

I'm using Openstack Havana in CentOS. I've installed 1 controller and 2 compute nodes, with NFS. Controller folder is shared by the compute nodes (folder /var/lib/nova/instances). All nodes are accessible among them without password. I can perform a migration in the dashboard. In the shell, I exaustivelly tried live migration without sucess. I'm setting /etc/nova/nova.conf and uncomment all live-migration options. I'm trying the following in the shell:

# nova live-migration MY_UUID_VM_INSTANCE my_host_destine

But silenty this command not works.

Finally, my log of /var/log/nova-all.log:

---
<0>Feb 17 20:19:43 node-4 ¿<179>nova-nova.openstack.common.rpc.amqp ERROR: Exception during message handling
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nova/openstack/common/rpc/amqp.py", line 461, in _process_data
    **args)
  File "/usr/lib/python2.6/site-packages/nova/openstack/common/rpc/dispatcher.py", line 172, in dispatch
    result = getattr(proxyobj, method)(ctxt, **kwargs)
  File "/usr/lib/python2.6/site-packages/nova/exception.py", line 90, in wrapped
    payload)
  File "/usr/lib/python2.6/site-packages/nova/exception.py", line 73, in wrapped
    return f(self, context, *args, **kw)
  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 4016, in pre_live_migration
    migrate_data)
  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 4162, in pre_live_migration
    self._create_images_and_backing(context, instance, instance_dir,
UnboundLocalError: local variable 'instance_dir' referenced before assignment
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Auditing locally available compute resources
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free ram (MB): 1494
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free disk (GB): 14
<0>Feb 17 20:20:16 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free VCPUS: 2
<0>Feb 17 20:20:16 node-4 ¿<182>nova-nova.compute.resource_tracker INFO: Compute_service record updated for node-4.domain.tld:node-4.domain.tld
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Auditing locally available compute resources
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free ram (MB): 1494
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free disk (GB): 14
<0>Feb 17 20:21:15 node-4 ¿<180>nova-nova.compute.resource_tracker AUDIT: Free VCPUS: 2
<0>Feb 17 20:21:15 node-4 ¿<182>nova-nova.compute.resource_tracker INFO: Compute_service record updated for node-4.domain.tld:node-4.domain.tld

---

This is a bug? Someone could help me? I should use KVM instead qemu? Any help is usefull. Thanks in advance.

Revision history for this message
徐志权 (308819843-8) said :
#2

Maybe you can try to add 'instances_path' parameters in the configuration file 'nova.conf', and point to your nfs mount directory

Revision history for this message
Qichen Hao (adsl123gg2008) said :
#3

the error is 'local variable "instance_dir" referenced before assignment',so can you try to assign the 'instance_dir' before reference?

Can you help with this problem?

Provide an answer of your own, or ask Lucio Agostinho for more information if necessary.

To post a message you must log in.