Is there a command to copy a virtual machine hard disk while connected to the vCenter server instead of being directly connected to each ESX server?
Thanks,
Kev
You can use the Copy-DatastoreItem cmdlet but there are some known issues with that cmdlet in the current build.
Or you can use the underlying CopyDatastoreFile_Task method.
Note that you will have to copy all the files (header & flat file) that comprise a vDisk yourself !
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You want copy a VM to hard disk of VC?
VCP210, VCP310, VCP410
Sorry, I should have been more specific. I've been using the below code to copy a VM hard disk from one datastore to another for backup.
CopyVirtualDisk_Task($sourceDisk, $sourceDC.MoRef, $destDisk, $destDC.MoRef, $destSpec, $force)
When I tried to run this against the vCenter server I got the error "The requested operation is not implemented by the server" and the Copy-HardDisk also states that you must be connected directly to the ESX server to run it.
Is there a command to clone a VM hard disk which can be ran from a connectino to the vCenter server?
Thanks again.
For the CopyVirtualDisk_Task method you have to be indeed conneced to the ESX(i) server.
Same goes for PowerCLI's Copy-HardDisk cmdlet.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is there a command that can copy the VM hard disk while connected to the vCenter server?
Mmmmm....The Vm must be OFF? Why not use "Clone" in VC? The ESX servers can access to the other datastore?
VCP210, VCP310, VCP410
Mmmmm....The Vm must be OFF? Why not use "Clone" in VC? The ESX servers can access to the other datastore?
VCP210, VCP310, VCP410
Mmmmm....The Vm must be OFF, Why not use "Clone" in VC? The ESX servers can access to the other datastore?
VCP210, VCP310, VCP410
You can use the Copy-DatastoreItem cmdlet but there are some known issues with that cmdlet in the current build.
Or you can use the underlying CopyDatastoreFile_Task method.
Note that you will have to copy all the files (header & flat file) that comprise a vDisk yourself !
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Summarizing the posts above:
vCenter server API does not support Virtual Disk Manager operations. This means that Copy-HardDisk cmdlet does not work against vCenter Server connection, only against direct ESX connection.
However PowerCLI supports file operations such as copy, remove, get (download), and put (upload) files similar to Datastore Browser in the vSphere Client.
You can use Copy-DatastoreItem cmdlet for copy, download and upload operations over vmdk and *-flat.vmdk files but you should aware that this is manual file operation and does not perform any pre and post-checks like if VM is running or there are snapshots and delta disks
Full Datastore Browser functionality (dir, mv, cp, del) is supported by PowerCLI Datastore provider functionality. All you need to do is to browse vmstore:\ default drive in PowerShell console.
Regards,
Yasen Kalchev
PowerCLI Team