how do I move a vm folder in a lun to another lun in a remote dc with powercli?
the vm is not registered in vc
Hello, tdubb123-
You could use the Copy-DatastoreItem cmdlet from PowerCLI, which has a "-Recurse" parameter for copying all the children items. For example:
Copy-DatastoreItem -Item "vmstore:\myDatacenter0\myDatastore0\someVMFolder0\" -Destination "vmstore:\myDatacenter3\myDatastore2\" -Recurse
This utilizes the PSDrive "vmstore:\", which provides access to the datacenters/datastores of the default VIServer connection. If you need to go between vCenters, you can use the "vmstores:\" PSDrive, which provides access to these items in all VIServers to which you are connected in that particular PowerCLI session.
Once you are satisfied with the integrity of the files after the copy, you can remove the folder of items from the original location using the standard Remove-Item cmdlet. Enjoy.
Hello, tdubb123-
You could use the Copy-DatastoreItem cmdlet from PowerCLI, which has a "-Recurse" parameter for copying all the children items. For example:
Copy-DatastoreItem -Item "vmstore:\myDatacenter0\myDatastore0\someVMFolder0\" -Destination "vmstore:\myDatacenter3\myDatastore2\" -Recurse
This utilizes the PSDrive "vmstore:\", which provides access to the datacenters/datastores of the default VIServer connection. If you need to go between vCenters, you can use the "vmstores:\" PSDrive, which provides access to these items in all VIServers to which you are connected in that particular PowerCLI session.
Once you are satisfied with the integrity of the files after the copy, you can remove the folder of items from the original location using the standard Remove-Item cmdlet. Enjoy.
thank you. this works great
You forgot your "How does that do for you ?" signature
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ha, yes indeed. After so many times of not getting an answer to that sign-off, I guess I need not append it. Or, maybe I'll put it in my actual signature so as to always have it... :smileygrin: