Hi
I am trying to migrate a vm from one host and it datastore to another host. There is no cluster vcenter server. Both hosts have individual datastore. I am automating migration and using Relocate or Migrate methods. but i am getting error when the request for migrating vm is submitted.
A specified parameter was not correct: spec.pool
Please suggest me what wrong i am doing here ?
resource_pool = vm.resourcePool | |
print destination_host | |
print vm | |
print resource_pool | |
migrate_priority = vim.VirtualMachine.MovePriority.defaultPriority |
msg = "Migrating %s to destination host %s" % (inputs['vm_name'], inputs['destination_host']) | |
print msg | |
print destination_host | |
print migrate_priority | |
print vm |
#Live Migration :: Change host only | |
#import pdb;pdb.set_trace(); | |
#print help(vm.Migrate) | |
print dir(vm.Migrate) | |
task = vm.Migrate(host=destination_host, priority=migrate_priority) | |
print task | |
# Wait for Migrate to complete | |
wait_for_task(task, si) |
except vmodl.MethodFault, e: | |
print "Caught vmodl fault: %s" % e.msg | |
return 1 | |
except Exception, e: | |
print "Caught exception: %s" % str(e) | |
return 1 |
If you do not have vCenter Server you cannot vMotion a VM.
Hi daphnissov
I am doing all operations from vcenter only. And performing this migration, using Relocate()