VMware Cloud Community
espressobeanies
Contributor
Contributor

Is there a way to create new virtual machines via CLI other than Powershell?

Hi,

I'm trying to find out if there are other ways to create new virtual machines via CLI without using Powershell. I took a look at vCLI and ESXCLI from shell logins, but it seems Powershell is the only option for now.

Thanks,

Reply
0 Kudos
2 Replies
continuum
Immortal
Immortal

Sure
connect to an ESXi host via ssh,
login as root
create empty dir for your VM like
mkdir /vmfs/volumes/datastore/directory
go there
cd  /vmfs/volumes/datastore/directory/
create a vmx-file like
echo "parameter" >> vmxfile.vmx
and create associated vmdks with a vmkfstools command.
Once that is done you can register the vmx-file with your preferred method.

Or use WinSCP to create the directory.
Upload a vmx-file and a sh-script create-vmdks.sh.
Then switch to putty and run
chmod 755 create-vmdks.sh
./create-vmdks.sh


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
espressobeanies
Contributor
Contributor

Thanks continuum

Reply
0 Kudos