VMware Cloud Community
Getbys
Contributor
Contributor
Jump to solution

New-VM copy existing vm

Hello guys I recently started to work with EXSI 6.7 free hypervisor. Am new to powershell and powercli so I started to learn the basic commands. I'am trying to create a machine by copying another. The command is simple: New-VM -Name vm1 -VM (existing powered off vm) but always throws same error: Exception has been thrown by the target of an invocation. I am running latest powercli version 6.5 I've put the command in ps file and ran i thru Powercli. Always the same error. I don't get in where I'am getting this wrong ? Thanks in advance!

0 Kudos
1 Solution

Accepted Solutions
Dave_the_Wave
Hot Shot
Hot Shot
Jump to solution

Without vCenter, you can export a (powered off) VM to a .ova on your desktop, then Deploy that .ova from your desktop back into the same host.

This thread is related:

best way to copy vmdk file between two esxi with no shared storage

View solution in original post

2 Replies
RickVerstegen
Expert
Expert
Jump to solution

You cannot clone if you are connected to an ESXi host. Connect to your vCenter server by using connect-viserver.

Then you should be able to use the command.

Example: New-VM -Name VM1 -VM VM2 -Datastore datastorename -vmhost hostname -DiskStorageFormat thin

Was I helpful? Give a kudo for appreciation!
Blog: https://rickverstegen84.wordpress.com/
Twitter: https://twitter.com/verstegenrick
Dave_the_Wave
Hot Shot
Hot Shot
Jump to solution

Without vCenter, you can export a (powered off) VM to a .ova on your desktop, then Deploy that .ova from your desktop back into the same host.

This thread is related:

best way to copy vmdk file between two esxi with no shared storage