简体   繁体   中英

deploy a new VM using an existing vmdk file via vmware perl sdk

I want to deploy a new VM with my vmdk file in vcenter environment from CLI. So ssh to esx server is not an option. Is there any way I can do this .I know there is some vmware perl sdk but I could not find exactly what I need to get this working. I know The same operation is possible from GUI, but I need to make it automated and also scale up so gui is not an option for me.

Can you please be more specific? This for a Linux or Windows CLI?

The simplest way to do this is via PowerCLI: https://my.vmware.com/web/vmware/details?downloadGroup=PCLI550&productId=352

To clone from an existing VM, the command would be:

$vm2 = New-VM -Name VM2 -VM VM1 -Datastore $datastore -VMHost $host

Also, when you say you want to create from VMDK, is the VMDK already on the target datastore? Do you need to import the VMDK first?

Normally, when you create a VM, you can either create a new "blank" VM or you can clone from an existing VM. If you have a VMDK you want to use, you would create an empty VM and then attach the VMDK. This assumes that you already have the VMDK in question loaded into a datastore that the host can access.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM