VMware {code}

 View Only

 Powercli remove datastore without deleting content

Stavros Tseriotis's profile image
Stavros Tseriotis posted Sep 06, 2024 08:03 AM

Hello,

I created a powercli script activate some VM machines in remote site after performing a storage-level failover from primary site to remote site.

When the work on remote site is completed i will failover back to primary site and the access to storage will be removed on remote site (there would be synchronization on storage level but storage would not be accessible from ESXi hosts).

I am looking for a way to remove the datastores on remote site prior failing over to primary site but i do not want to delete the contents of the datastore.

I searched in powercli documentation and i found the following link:

https://developer.broadcom.com/powercli/latest/products/vmwarevsphereandvsan/categories/datastore

There is a cmdlet available to remove a datastore (Remove-Datastore) but this is stated in the description of this cmdlet:

This cmdlet removes the specified datastores from their locations. The cmdlet permanently deletes the content of the removed datastores, unless they are shared (NFS).

Is there a way to remove the datastore without deleting its contents?

Franky Barragan's profile image
Broadcom Employee Franky Barragan

This question would be better suited for the PowerCLI Community page ->  https://community.broadcom.com/vmware-cloud-foundation/communities/community-home/digestviewer?communitykey=0c93b92e-0998-44ec-8f69-521308f609ee&Page=&ContributionType=1&Nested=2&ResultsPerPage=100&SortBy=1 

You may be able to post it there as well, and I'm sure the community would be able to assist. In the meantime, I'll see if this can be migrated over to that page.