Hi,
I have checked few posts on this forum on how to create the virtual machine via vmcreate.pl, but the responses was not so clear to me...
These are the topics I have read:
How to set up the HostSystem Managed object
So, I would like to create a virtual machine on a Cluster, not on a specified host. Does the script vmcreate.pl would do the job ? Or I should modify it ?
From the topic => Create VM instance on Cluster I didn't quite get, what should I modify ...
This is what I do:
vmcreate.pl --server "ESX NAME" --username "LOGIN" --password "PASS" --filename vmcreate.xml --schema vmcreate.xsd
Result:
Error creating VM 'myTestMachine':
SOAP Fault:
-----------
Fault string: InvalidArgument
Fault detail: InvalidArgument
Here are the XML file values:
<Name>myTestMachine</Name>
<Host>blabla</Host>
<Datacenter>blabla</Datacenter>
<Guest-Id>Linioch</Guest-Id>
<Datastore>blabla</Datastore>
<Disksize>2048</Disksize>
<Memory>256</Memory>
<Number-of-Processor>1</Number-of-Processor>
<Nic-Network></Nic-Network>
<Nic-Poweron>1</Nic-Poweron>
The values are correct cause I have checked them via other perl scripts.
Thank You in advance for Your help
Michal
Thank to user xyz222 and the post Re: Create VM instance on Cluster
I was able to fin the problem. So simple... The value of the <Guest-Id> in the xml file, has to be for example "rhel6_64Guest" and not a random word... that is it!
sudo ./vmcreate.pl --server SERVER --username LOGIN --password PASS --filename ../sampledata/vmcreate.xml --schema ../schema/vmcreate.xsd
Successfully created virtual machine: 'teeest2' under host HOST_NAME
Thank to user xyz222 and the post Re: Create VM instance on Cluster
I was able to fin the problem. So simple... The value of the <Guest-Id> in the xml file, has to be for example "rhel6_64Guest" and not a random word... that is it!
sudo ./vmcreate.pl --server SERVER --username LOGIN --password PASS --filename ../sampledata/vmcreate.xml --schema ../schema/vmcreate.xsd
Successfully created virtual machine: 'teeest2' under host HOST_NAME
Oh yeah, there is a list of valid GuestID types somewhere and the value of GuestID in the vmcreate .xml must be set to one of them. I cant recall where I got the list from, either by querying my vcenter server directly, or looking in the docs.
btw, you can find the list of valid GuestIDs here
