Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop.Desktop_Update can't update Datastore settings #596

Open
Po-temkin opened this issue Oct 28, 2022 · 0 comments
Open

Desktop.Desktop_Update can't update Datastore settings #596

Po-temkin opened this issue Oct 28, 2022 · 0 comments
Labels

Comments

@Po-temkin
Copy link

Po-temkin commented Oct 28, 2022

Describe the bug

I tried to update Datastore setting using Desktop_Update.
What's wrong with my version?

Exception on call "Desktop_Update" with "2" arguments: "Failed to load type "VMware.Hv.String" from assembly "VMware.Hvi, Version=8.4.0.709, Culture=neutral, PublicKeyToken=null"."
string:1 symbol:2
+  $ViewAPI.Desktop.Desktop_Update($DesktopId,$MapEntryDesktopVirtualCenterStorageSettings)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TypeLoadException

Reproduction steps

PS C:\Windows\system32> $DesktopVirtualCenterDatastoreSettings = @()
>> ForEach ($DatastoreName in $DatastoreNames)
>> {
>>     $DatastoreId1 = ($ViewAPI.Datastore.Datastore_ListDatastoresByHostOrCluster($HostOrClusterId) | Where-Object {$_.DatastoreData.Name -eq $DatastoreName}).Id
>>     $DesktopVirtualCenterDatastoreSettingsTemp = New-Object VMware.Hv.DesktopVirtualCenterDatastoreSettings -Property @{datastore=$DatastoreId1;sdrsCluster=$SdrsCluster;storageOvercommit=$StorageOvercommit}
>>     $DesktopVirtualCenterDatastoreSettings += $DesktopVirtualCenterDatastoreSettingsTemp
>> }
>>
>> $MapEntryDesktopVirtualCenterStorageSettings1 = New-Object VMware.Hv.MapEntry -Property @{
>>     Key='automatedDesktopData.virtualCenterProvisioningSettings.virtualCenterStorageSettings.datastores';Value=$DesktopVirtualCenterDatastoreSettings
>> }
>> $MapEntryDesktopVirtualCenterStorageSettings = @($MapEntryDesktopVirtualCenterStorageSettings1)
PS C:\Windows\system32> $MapEntryDesktopVirtualCenterStorageSettings

Key                                                                                            Value
---                                                                                            -----
automatedDesktopData.virtualCenterProvisioningSettings.virtualCenterStorageSettings.datastores {VMware.Hv.DesktopVirtualCenterDatastoreSettings}


PS C:\Windows\system32> $MapEntryDesktopVirtualCenterStorageSettings.Value

Datastore             SdrsCluster StorageOvercommit
---------             ----------- -----------------
VMware.Hv.DatastoreId       False UNBOUNDED


PS C:\Windows\system32> $MapEntryDesktopVirtualCenterStorageSettings | gm


   TypeName: VMware.Hv.MapEntry

Name        MemberType Definition
----        ---------- ----------
Equals      Method     bool Equals(System.Object obj)
GetHashCode Method     int GetHashCode()
GetType     Method     type GetType()
ToString    Method     string ToString()
Key         Property   string Key {get;set;}
Value       Property   System.Object Value {get;set;}


PS C:\Windows\system32> $DesktopId

Id
--
Desktop/ZTE3ZTVjMjctZDg4Yy00NmNiLWIyN2UtNWRhYjFlYTI5NGE0/aDgyLXRzdA


PS C:\Windows\system32> $ViewAPI.Desktop.Desktop_Update($DesktopId,$MapEntryDesktopVirtualCenterStorageSettings)
Exception on call "Desktop_Update" with "2" arguments: "Failed to load type "VMware.Hv.String" from assembly "VMware.Hvi, Version=8.4.0.709, Culture=neutral, PublicKeyToken=null"."
string:1 symbol:2
+  $ViewAPI.Desktop.Desktop_Update($DesktopId,$MapEntryDesktopVirtualCenterStorageSettings)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TypeLoadException

Expected behavior

Metod succesfully update Datastore settings

Additional context

Horizon Connection Server 8.6.0 build - 20099816
PowerCLI 12.7

@Po-temkin Po-temkin added the bug label Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant