VMware Cloud Community
sant0sk1
Contributor
Contributor

Register a VM from remote-cli

I can't seem to get this to work. I've tried using 'vmware-cmd -s register' and 'vmregister.pl' and ran into troubles with each.

The problem seems to be that the commands require a 'resource pool' parameter but I do not know the default name of an ESXi resource pool if I haven't created any on the host. I've tried using the host's FQDN and the datastore name for this parameter, both unsuccessfully.

Can somebody provide an example command that would accomplish this task? Thanks.

Reply
0 Kudos
6 Replies
SelvaMK
Enthusiast
Enthusiast

Hi,

Just clearing out a few doubt. have you tried giving the path of the vmx file correctly. For example, if my VM winxp's vmx file is in /vmfs/volumes/storage1, then i would give the command,

vmware-cmd -s register --server <serverip> --username <root> /vmfs/volumes/storage1/winxp.vmx and ENTER

the output is likely to be VM register =1

Selva

sant0sk1
Contributor
Contributor

Hi Selva,

When I execute that exact command (using my own vmx of course) I get the following message:

Must specify resource pool

I haven't created any specific resource pools on the ESXi host, and I don't know what the default resource pool is called.

Reply
0 Kudos
sant0sk1
Contributor
Contributor

Dave,

I had read that thread previously. Please explain why it would be useful to me as I do not see a solution to my problem there. Thanks.

Reply
0 Kudos
SelvaMK
Enthusiast
Enthusiast

Hi,

sorry to hear that the command did not work out. Could you paste here the exact command that you have typed , because, i feel that this could be a syntax mismatch

Selva

Reply
0 Kudos
sant0sk1
Contributor
Contributor

The exact command which gives the above error is:

vmware-cmd --server [my server ip] --username [my user name] -s register [main]/Igor/Igor.vmx

I found out what the default resource pool is called: Resources. So now if I execute:

vmware-cmd --server [my server ip] --username [my user name] -s register [main]/Igor/Igor.vmx ha-datacenter Resources

It registers! However, I cannot unregister it like so:

vmware-cmd --server [my server ip] --username [my user name] -s unregister [main]/Igor/Igor.vmx

I get the following output:

No virtual machine found

How can it not be found? I just registered it!!

Reply
0 Kudos