VMware {code} Community

vmmigrate.pl - Can't seem to define targetdatastore properly

Hi --

I have a vMotion setup where I can successfully live migrate between two ESX hosts via the VI Client GUI. I can't seem to perform the same operation using the vmmigrate.pl script. I am able to define all arguments to the script, except that it rejects my --targetdatastore name for some reason even though I believe I'm giving it the correct name (as seen in my VI Client).

Here's how I'm running the script:

perl vmmigrate.pl --server --username Administrator --password Password-1 --sourcehost --targethost --vmname fedora7 --targetpool Pool-3 --targetdatastore vmotion-vmfs

Output is:

Datastore not found on target

I've used the VI Perl Tookit to browse the datastores on both ESX servers and the datastore 'vmotion-vmfs' is listed.

Any ideas? Thanks.

Mike Sun

0 Kudos
2 Replies

The work-flow of vmmigrate.pl is as follows:

If target host and source host both contains the datastore, virtual machine needs to be migrated.

If only target host contains the datastore, machine needs to be relocated

else the message that

'Datastore not found on target'

so the targetdatastore must be part of targethost.

Please check that targetdatastore 'vmotion-vmfs' is available in your targethost i.e ''

0 Kudos

With the modifications above the script vmmigrate.pl works with the registrated name of the target and source hosts at the Virtual Center.

If no resource pools are defined so you have to indicate the default resource pool "Resources". The migration process also depends on the running state

of the VM.

example: ESX-cluster w/ nodes, registrated at the VC as esx1.local.domain.com and esx2.local.domain.com

SAN storage: VMstore

virtual center server: vcsrv

VM to migrate: vm1

perl vmmigrate.pl --url https://vcsrv:8443/sdk/vimService --vmname vm1 --sourcehost esx2.local.domain.de --targethost esx1.local.domain.de --targetdatastore VMstore

--priority highPriority --username admin --password xxxxxx --targetpool "Resources" --state poweredOn

0 Kudos