Bug 507304 - Re-detection of transient VMs not working with migrated domains
Re-detection of transient VMs not working with migrated domains
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Veillard
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-22 05:18 EDT by Federico Simoncelli
Modified: 2010-03-16 13:21 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 507537 (view as bug list)
Environment:
Last Closed: 2009-06-27 09:49:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test1.xml (612 bytes, application/xml)
2009-06-22 09:19 EDT, Federico Simoncelli
no flags Details
test1-node1.xml (1005 bytes, application/xml)
2009-06-22 09:21 EDT, Federico Simoncelli
no flags Details
test1-node2.xml (1003 bytes, application/xml)
2009-06-22 09:22 EDT, Federico Simoncelli
no flags Details
libvirtd-debug.log (74.37 KB, text/plain)
2009-06-22 09:24 EDT, Federico Simoncelli
no flags Details
libvirt-0.6.5-save-status-on-migration.patch (653 bytes, patch)
2009-06-23 03:36 EDT, Federico Simoncelli
no flags Details | Diff

  None (edit)
Description Federico Simoncelli 2009-06-22 05:18:59 EDT
Description of problem:
The "re-detection of transient VMs after libvirtd restart" seems not to work if the transient domain was migrated.

Version-Release number of selected component (if applicable):
libvirt-0.6.4 + "Fix re-detection of transient VMs after libvirtd restart" patch.

Ref:
http://git.et.redhat.com/?p=libvirt.git;a=commit;h=524188b221f5e8dc66a7f203e1633dab3aa8dcf2

(I searched for other related fix which might affect my tests but I didn't find any).

Steps to Reproduce:
1. Start a transient vm on one node.
2. Migrate the vm to a second node.
3. Restart libvirtd daemon on the second node.
  
Actual results:
The vm now is in the "pause" status and on destroy it remains defined.

Expected results:
The vm should be in the "running" status and a destroy should completely remove the vm from the defined domains.

Additional info:

[root@node1 ~]# ls /var/run/libvirt/qemu/
[root@node1 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------

[root@node2 ~]# ls /var/run/libvirt/qemu/
[root@node2 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@node2 ~]# virsh list --all
 Id Name                 State
----------------------------------

[root@node1 ~]# virsh create test1.xml 
Domain test1 created from test1.xml

[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------
  1 test1                running

[root@node1 ~]# virsh migrate test1 qemu+ssh://node2/system

[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------

[root@node2 ~]# virsh list --all
 Id Name                 State
----------------------------------
  1 test1                running

[root@node2 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
# virsh list --all
 Id Name                 State
----------------------------------
  1 test1                paused

[root@node2 ~]# virsh destroy test1
Domain test1 destroyed

[root@node2 ~]# virsh list --all
 Id Name                 State
----------------------------------
  - test1                shut off
Comment 1 Federico Simoncelli 2009-06-22 09:19:43 EDT
Created attachment 348891 [details]
test1.xml

VM test1.xml creation file.
Comment 2 Federico Simoncelli 2009-06-22 09:21:23 EDT
Created attachment 348892 [details]
test1-node1.xml

VM test1 xml file before migration:
# cp /var/run/libvirt/qemu/test1.xml test1-node1.xml
Comment 3 Federico Simoncelli 2009-06-22 09:22:29 EDT
Created attachment 348893 [details]
test1-node2.xml

VM test1 xml file after migration:
# cp /var/run/libvirt/qemu/test1.xml test1-node1.xml
Comment 4 Federico Simoncelli 2009-06-22 09:24:14 EDT
Created attachment 348894 [details]
libvirtd-debug.log

libvirtd debug on restart.
Comment 5 Daniel Veillard 2009-06-22 09:32:33 EDT
Hum, 

paphio:~ -> diff test1-node1.xml test1-node2.xml 
1,3c1,3
< <domstatus state='running' pid='6969'>
<   <monitor path='/dev/pts/12'/>
< <domain type='kvm' id='9'>
---
> <domstatus state='paused' pid='7290'>
>   <monitor path='/dev/pts/7'/>
> <domain type='kvm' id='6'>

  So I would think it's that when the migration is started on node2 the
domain is defined as paused but we forget to mark it as running once the
migration completed and the guest is actually resumed.

Daniel
Comment 6 Federico Simoncelli 2009-06-23 03:36:30 EDT
Created attachment 349050 [details]
libvirt-0.6.5-save-status-on-migration.patch

Proposed patch.
Comment 7 Federico Simoncelli 2009-06-23 04:00:56 EDT
I should point out that the patch I posted resolves only the "paused" issue.
If you destroy a migrated transient domain it sill remain defined. (Expected result: the migrated transient domain should be completely removed).
Comment 8 Daniel Berrange 2009-06-23 05:13:56 EDT
This patch looks suitable for committing upstream to me
Comment 9 Daniel Veillard 2009-06-27 09:49:12 EDT
Yup applied upstream, so that will make 0.6.5,

  thanks !

Daniel

Note You need to log in before you can comment on or make changes to this bug.