Hi Rawat,
The API call you are using is still supported, but it only lets you do migration within a pool, with no storage migration.
If you want to migrate a VM and its storage (maybe even between pools), you first need to call Host.migrate_receive (see http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=host) with the reference of the host you wish to migrate the VM to. This API call needs to be made to the master of the pool you want to migrate to (obviously the host reference needs to be one of the hosts in this pool).
This will return a value of type (string -> string) map. You then need to call VM.migrate_send on the master of the pool you wish to migrate from (see http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=VM). This could be called to the same master as above, if you only want to do a storage migration within a pool.
The arguments to this function are, in order:
VM ref: This is the VM you want to migrate
(string -> string) map: This is the return value you received from Host.migrate_receive above.
bool: The is the âliveâ flag. This must be âtrueâ at the moment.
(VDI ref -> SR ref) map: This indicates which SR (attached to the destination host) each of the VMâs VDIs will be moved to.
(VIF ref -> network ref) map: This indicates which network (present on the destination host) each of the VMâs VIFs will be moved to.
(string -> string) map: Extra options field for future improvements â not used at the moment (just pass an empty dictionary).
Also, if you want to migrate a VDI between SRs without migrating the VM which owns the VDI, you can just use VDI.pool_migrate (see http://docs.vmd.citrix.com/XenServer/6.1.0/1.0/en_gb/api/?c=VDI). The arguments are:
VDI ref: The VDI you want to move.
SR ref: The SR you want to move the VDi to.
(string -> string) map: another unused âoptionsâ field.
Hope this helps!
John
From: xen-api-bounces@xxxxxxxxxxxxx [mailto:xen-api-bounces@xxxxxxxxxxxxx] On Behalf Of Rawat, Vishwanath
Sent: 22 January 2013 08:26
To: George Shuklin; xen-api@xxxxxxxxxxxxx
Subject: Re: [Xen-API] VM Migration
I have downloaded the latest API guide(XenServer 6.1.0 Management API Guide). Prototype of pool_migrate is still same in new management API guide.
pool_migrate (session_id s, VM ref vm, host ref host, (string -> string) Map options).
I think there should be some param that I can pass as part of âMap optionsâ mentioned in above prototype. I just donât know option name and its value.
Regards,
Rawat
I think you using outdated API documentation. Not sure about API call, but corresponding xe call can contains remote-host, remote-username, remote-password and so on.
On 21.01.2013 22:18, Rawat, Vishwanath wrote:
Hi All,
I am writing some perl scripts to do VM Migration using Xen APIs.
This is the API call I am using to do VM Migration
pool_migrate (session_id s, VM ref vm, host ref host, (string -> string) Map options).
Now it is also possible to migrate datastore along with VM. I would like to know what is the option that I can pass to above function so that it will also migrate datastore.
Regards,
Rawat
_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api