VMware Cloud Community
Andre_Fellipe
Enthusiast
Enthusiast

Change datastore from Linked Clone Pool

Objective: Change every pool datastorePaths to 3 news datastores provisioned.

 

With the following command I can list the actual datastores.

((Get-HVPool) -PoolName POOL).automatedDesktopData.virtualCenterNamesData.datastorePaths)

 

To accomplish my objective I ran the following command.

Set-HVPool -PoolName POOL -Key 'automatedDesktopData.virtualCenterNamesData.datastorePath' -value DATASTORE01

But I'm getting the following error:

MethodInvocationException: Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument ErrorMessage : Cannot update read-only member. ParameterName : automatedDesktopData.virtualCenterNamesData.datastorePath

This Key is not read only, as stated in  https://developer.vmware.com/apis/1093/view

Andre_Fellipe_0-1673547210676.png

 

0 Kudos
4 Replies
LucD
Leadership
Leadership

Shouldn't the key be automatedDesktopData.virtualCenterNamesData.datastorePaths

See also Mass-change Horizon Linked-Clone datastores (VMwar... - VMware Technology Network VMTN

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Andre_Fellipe
Enthusiast
Enthusiast

Yes the key is `datastorepaths` I mistyped here (I'm using remmina with WSL, to access the remote server, so no Copy / Past).

And I already checked the post you mentioned above and they are exactly as the VMware API explorer says.

Andre_Fellipe_0-1673549384665.png

 

0 Kudos
LucD
Leadership
Leadership

Looking again at the API, the parent property virtualCenterNamesData seems to be read-only.

LucD_0-1673550954322.png
Which would explain the error.

But I currently have no clue which properties to use to change the datastores.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Andre_Fellipe
Enthusiast
Enthusiast

Hey Lucd, I found the following: https://developer.vmware.com/apis/1093/view

automatedDesktopData.virtualCenterProvisioningSettings.virtualCenterStorageSettings.datastores

Andre_Fellipe_0-1673554289024.png

There are 3 properties inside this key (Datastore, SdrsCluster and StorageOvercommit).

Using the Datastore property, I can see a ID for 3 datastores.

Andre_Fellipe_1-1673554440508.png

Well, now came the road block, how can I change (Remove, Add, Substitute)  theses values?

 

0 Kudos