vMotion gives error: "A specified parameter was not correct"

3,534 views
Skip to first unread message

Chris Dekter

unread,
Apr 24, 2012, 12:36:00 AM4/24/12
to pysp...@googlegroups.com
Hello,

I am trying to do the simplest case of vMotion-ing a powered on VM. The VM is on a shared datastore in a datacenter with only two hosts. There are no resource pools and the VM only has one disk. Here is a cut-down version of the code:

server = VIHost()
server.connect(hostname, username, password)
vm = server.get_vm_by_name(myVM)
host = "host-9" # have also tried using the MOR given by server.get_hosts(), this made no difference. have verified that host-9 is the correct MOR
vm.migrate(host=host)

This fails every single time with "A specified parameter was not correct". vpxd and hostd logs give no further information on what parameter was missing. I reviewed the documentation for the Perl version of the API (MigrateVM_Task) and everything looks OK to me. It should work with only the host parameter provided. I would be very grateful for any suggestions on how to resolve this.

-- Chris

Seba

unread,
Apr 26, 2012, 8:46:48 AM4/26/12
to pysp...@googlegroups.com, Chris Dekter
Hi Chris,

   I have not been able to reproduce the error you are getting. I've successfully moved a powered on VM by providing just the host parameter on a vCenter 4.1.0 with a vMotion license.
   Can you migrate the same VM being powered on using the VI Client (context menu->migrate)?

  If so, I would ask you then to send me some log files in order to help you:
   1) Pysphere log: you can get it this way:
        >>> server = VIServer()
        >>> server.connect("your.server.com", "user", "password", trace_file="wsdl_log.txt")
       >>> .... get the vm, and try to migrate it  ...
      Open wsdl_log.txt and remove any confidential information (as your login credentials will be there)

  2) The VI Client wsdl log (from which migration works ok):
       If you don't know how to get it, see my post here: http://groups.google.com/group/pysphere/browse_thread/thread/e802598a4fecec6b#

Cheers,

Sebastián.

2012/4/24 Chris Dekter

Chris Dekter

unread,
Apr 26, 2012, 9:14:08 PM4/26/12
to pysp...@googlegroups.com, Chris Dekter
Hi Seba,

Thanks for your reply - the information you gave below was enough for me to debug this problem. Here is what I found:

My hosts are set up as standalone hosts, and there is only the default (root) resource pool on each. If I call server.get_resource_pools(), I get two pools returned, one for each host. When I vMotion a VM using the vSphere client, I can see that it is passing the resource pool MOR as part of the MigrateVM_Task request. So it seems that even though VMware's own API documentation states that the resource pool may be left empty, this is not in fact always the case. If I call vm.migrate() with a valid resource pool for the target host, the operation is successful.

My remaining question is how best to get the root resource pool for a given host. It seems to be a property of the ComputeResource object, but I couldn't readily find a way to obtain the ComputeResource for a HostSystem. My current approach is to look at the value of pool.owner.name which gives the name of the host containing that resource pool.

Regards,
Chris
Reply all
Reply to author
Forward
0 new messages