I apologize for the very basic question.
Can anybody please provlde a working sample of a PowerCLI command line to move a given VM (le't's say, "MY VM Sample" with spaces in the name) from a given datastore (let's say, "Source_datastore", should I specify it?) to a given datastore (let's say, "Target_datastore") creating thin disks?
Regards
marius
Get-VM "VM Name" | Move-VM -Datastore ( Get-VMHost 'HostName' | Get-Datastore -Name "DatastoreName" ) -DiskStorageFormat Thin
You could just specify the datastore without having to get the VMhost first, but if you have multiple clusters with the same datastores names, it may not pull the correct one.
Get-VM "VM Name" | Move-VM -Datastore ( Get-VMHost 'HostName' | Get-Datastore -Name "DatastoreName" ) -DiskStorageFormat Thin
You could just specify the datastore without having to get the VMhost first, but if you have multiple clusters with the same datastores names, it may not pull the correct one.
# Define your variables $VMName + $destDatastore
Move-vm -vm $VMName -datastore $destDatastore -DiskStorageFormat Thin