VMware Cloud Community
DRCD
Contributor
Contributor

A specified parameter was not correct: spec.pool

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
Reply
0 Kudos
2 Replies
daphnissov
Immortal
Immortal

If you do not have vCenter Server you cannot vMotion a VM.

Reply
0 Kudos
DRCD
Contributor
Contributor

Hi

I am doing all operations from vcenter only. And performing this migration, using Relocate()

Reply
0 Kudos