[libvirt-users] Regarding persistence of VM's after live migration (virDomainMigrateToURI() problem)

Hello I am working with 3 host machines each running xen with shared NFS storage. I am working on automatic load balancing if one host is over utilized and another is under utilized by measuring the utilization from xentop. I am facing a problem after migration of VM. I am setting the flags ( 1| 8| 16) in order to do live migration, persist VM on destination, undefine host from source. After migration if I shut off the migrated VM on destination host it does not persist. I am using the migrateToURI() API for migration. Please help how to make VM persist on destination. Thank you, Tasvinder Singh -- -- "To Iterate is Human, To Recurse is Divine"

On 04/25/2012 07:06 AM, Coding Geek wrote:
Hello I am working with 3 host machines each running xen with shared NFS storage. I am working on automatic load balancing if one host is over utilized and another is under utilized by measuring the utilization from xentop. I am facing a problem after migration of VM. I am setting the flags ( 1| 8| 16) in order to do live migration, persist VM on destination, undefine host from source. After migration if I shut off the migrated VM on destination host it does not persist. I am using the migrateToURI() API for migration.
Please help how to make VM persist on destination.
There's a flag you can pass to the migration API, VIR_MIGRATE_PERSIST_DEST. - Cole

On Mon, Apr 30, 2012 at 11:37:04AM -0400, Cole Robinson wrote:
On 04/25/2012 07:06 AM, Coding Geek wrote:
Hello I am working with 3 host machines each running xen with shared NFS storage. I am working on automatic load balancing if one host is over utilized and another is under utilized by measuring the utilization from xentop. I am facing a problem after migration of VM. I am setting the flags ( 1| 8| 16) in order to do live migration, persist VM on destination, undefine host from source. After migration if I shut off the migrated VM on destination host it does not persist. I am using the migrateToURI() API for migration.
Please help how to make VM persist on destination.
There's a flag you can pass to the migration API, VIR_MIGRATE_PERSIST_DEST.
For a longer description read this page which describes config file handling in some details http://libvirt.org/migration.html NB though not all hypervisors support all modes - libvirt will tell you if you try to use an unsupported flag though Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Mon, Apr 30, 2012 at 9:07 PM, Cole Robinson <crobinso@redhat.com> wrote:
On 04/25/2012 07:06 AM, Coding Geek wrote:
Hello I am working with 3 host machines each running xen with shared NFS
am working on automatic load balancing if one host is over utilized and another is under utilized by measuring the utilization from xentop. I am facing a problem after migration of VM. I am setting the flags ( 1| 8|
storage. I 16) in
order to do live migration, persist VM on destination, undefine host from source. After migration if I shut off the migrated VM on destination host it does not persist. I am using the migrateToURI() API for migration.
Please help how to make VM persist on destination.
There's a flag you can pass to the migration API, VIR_MIGRATE_PERSIST_DEST.
- Cole
Actually I am already using this flag VIR_MIGRATE_PERSIST_DEST but still VM is not persisting on Destination. Do I need to change something while creating the VM? -- Tasvinder Singh

On 05/02/2012 04:52 AM, Coding Geek wrote:
On Mon, Apr 30, 2012 at 9:07 PM, Cole Robinson <crobinso@redhat.com <mailto:crobinso@redhat.com>> wrote:
On 04/25/2012 07:06 AM, Coding Geek wrote: > > Hello > I am working with 3 host machines each running xen with shared NFS storage. I > am working on automatic load balancing if one host is over utilized and > another is under utilized by measuring the utilization from xentop. I am > facing a problem after migration of VM. I am setting the flags ( 1| 8| 16) in > order to do live migration, persist VM on destination, undefine host from > source. After migration if I shut off the migrated VM on destination host it > does not persist. I am using the migrateToURI() API for migration. > > Please help how to make VM persist on destination. >
There's a flag you can pass to the migration API, VIR_MIGRATE_PERSIST_DEST.
- Cole
Actually I am already using this flag VIR_MIGRATE_PERSIST_DEST but still VM is not persisting on Destination. Do I need to change something while creating the VM?
That flag might not be implemented to xen. But in that case it should explicitly reject the flag. Please file a bug. But if you need a working solution, you can just do a lookupByName on the remote host after migration, then define that guest to make it persistent. - Cole

On Wed, May 2, 2012 at 7:42 PM, Cole Robinson <crobinso@redhat.com> wrote:
On 05/02/2012 04:52 AM, Coding Geek wrote:
On Mon, Apr 30, 2012 at 9:07 PM, Cole Robinson <crobinso@redhat.com <mailto:crobinso@redhat.com>> wrote:
On 04/25/2012 07:06 AM, Coding Geek wrote: > > Hello > I am working with 3 host machines each running xen with shared NFS storage. I > am working on automatic load balancing if one host is over
utilized and
> another is under utilized by measuring the utilization from
xentop. I am
> facing a problem after migration of VM. I am setting the flags (
1| 8|
16) in > order to do live migration, persist VM on destination, undefine
host from
> source. After migration if I shut off the migrated VM on
destination host it
> does not persist. I am using the migrateToURI() API for migration. > > Please help how to make VM persist on destination. >
There's a flag you can pass to the migration API,
VIR_MIGRATE_PERSIST_DEST.
- Cole
Actually I am already using this flag VIR_MIGRATE_PERSIST_DEST but still
VM is
not persisting on Destination. Do I need to change something while creating the VM?
That flag might not be implemented to xen. But in that case it should explicitly reject the flag. Please file a bug.
But if you need a working solution, you can just do a lookupByName on the remote host after migration, then define that guest to make it persistent.
- Cole
Ok. Before trying your solution one thing i want to ask. After migration I can do lookupByName which returns a domain pointer and then I can get the XML description of domain using getXMLDesc and then "can I still define the domain using defineXML because it returns a newly created domain's pointer?" and domain is already running in transient mode. I do not want to shut off the domain after migration. -- Tasvinder

On 05/02/2012 04:11 PM, Coding Geek wrote:
On Wed, May 2, 2012 at 7:42 PM, Cole Robinson <crobinso@redhat.com <mailto:crobinso@redhat.com>> wrote:
On 05/02/2012 04:52 AM, Coding Geek wrote: > > > On Mon, Apr 30, 2012 at 9:07 PM, Cole Robinson <crobinso@redhat.com <mailto:crobinso@redhat.com> > <mailto:crobinso@redhat.com <mailto:crobinso@redhat.com>>> wrote: > > On 04/25/2012 07:06 AM, Coding Geek wrote: > > > > Hello > > I am working with 3 host machines each running xen with shared NFS > storage. I > > am working on automatic load balancing if one host is over utilized and > > another is under utilized by measuring the utilization from xentop. I am > > facing a problem after migration of VM. I am setting the flags ( 1| 8| > 16) in > > order to do live migration, persist VM on destination, undefine host from > > source. After migration if I shut off the migrated VM on destination host it > > does not persist. I am using the migrateToURI() API for migration. > > > > Please help how to make VM persist on destination. > > > > There's a flag you can pass to the migration API, VIR_MIGRATE_PERSIST_DEST. > > - Cole > > > Actually I am already using this flag VIR_MIGRATE_PERSIST_DEST but still VM is > not persisting on Destination. Do I need to change something while creating > the VM? >
That flag might not be implemented to xen. But in that case it should explicitly reject the flag. Please file a bug.
But if you need a working solution, you can just do a lookupByName on the remote host after migration, then define that guest to make it persistent.
- Cole
Ok. Before trying your solution one thing i want to ask. After migration I can do lookupByName which returns a domain pointer and then I can get the XML description of domain using getXMLDesc and then "can I still define the domain using defineXML because it returns a newly created domain's pointer?" and domain is already running in transient mode. I do not want to shut off the domain after migration.
Yes, you should be able to define on top of a running transient domain, and it will become persistent. - Cole
participants (3)
-
Coding Geek
-
Cole Robinson
-
Daniel P. Berrange