PowerCLI

 View Only

 Migrate PVC via code

Mark Morsing's profile image
Mark Morsing posted Jul 15, 2025 06:48 AM

Hey guys

Not sure i hit the correct forum, but heres goes.
I currently have 1000+ Kubernetes PVCs running - and i don't have Tanzu itself.
I need to migrate all of these PVCs from their current datastores to another datastore, i can do it manually via the UI, but i can't bulk select so i have to do it 1 by 1, and as you can image, it'll take me roughly a million years to do.

I initially wanted to do it via Powershell but i've been unable to locate a way to actually do it, without breaking the PVC / CNS link.

I stumpled upon the following API - which should do what i want.
Virtual Infrastructure JSON API

https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsRelocateVolume

But i can't figure out how to actually run it, i tried searching for it in the development center in the vCenter and i can't locate it there either.

So my question is.
Does anyone know how to actually run this command? And can they point me in the right direction?

My vCenter version is 8.0.3.00500

Thanks!