Closed dnapoleon closed 1 year ago
@dnapoleon - Can you please confirm the version of PowerShell you are running this in by taking a look at the $PSVersionTable variable? If you are not using PowerShell Core, recommend giving that a try since we've had issue with the serialization portion running in PowerShell 5.1/Desktop.
PS C:\WINDOWS\system32> $PSVersionTable
Name Value
PSVersion 5.1.22621.963
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.963
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
I'll give PS Core a go.
Matthew, thank you for such a quick response. This has addressed the issue.
When attempting to migrate a VMSS with extensions present in the Extensions Profile of the VMSS (such as Service Fabric Node), the Json Serializer fails to serialize the extensions as they are a type of "system.object".
log : 2023-04-24T11:24:11-04 [Error]:[BackupVmss] An error occured while exporting the VMSS '' for backup purposes. Error: Exception calling "Serialize" with "3" argument(s): "The collection type 'System.Object' on 'Microsoft.Azure.Commands.Compute.Automation.Models.PSVirtualMachineScaleSetExtension.Settings' is not supported." At C:\Program Files\WindowsPowerShell\Modules\AzureBasicLoadBalancerUpgrade\2.0.4\modules\BackupBasicLoadBalancer\BackupBasicLoadBalancer.psm1:119 char:13
I manually copied the lines out of the BackupBasicLoadBalancer.psm1 file to test the serialization manually without the extensions and was able to serialize the rest of the VMSS.
The Service Fabric Node Extension snippet copied from Resource Explorer (resources.azure.com): { "name": "ServiceFabricNode", "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Azure.ServiceFabric", "type": "ServiceFabricNode", "typeHandlerVersion": "1.1", "settings": { "clusterEndpoint": "https://eastus.servicefabric.azure.com/runtime/clusters/my-guid", "nodeTypeRef": "primary", "dataPath": "D:\\SvcFab", "durabilityLevel": "Bronze", "enableParallelJobs": true, "nicPrefixOverride": "10.0.2.0/24", "certificate": { "thumbprint": "my cert thumbprint", "x509StoreName": "My" } } } }