System Center Logo

SCVMM 2012 R2 Error 23317 When You Try to Apply Changes on VM That is Using Shared VHDX Disk

A customer of mine had a issue when he tried to change properties of Virtual Machines in System Center Virtual Machine Manager 2012 R2 which use shared VHDX, which were not created with VMM. The properties do he wanted to change had nothing to do with the Shared VHDX it self. He tried to set the availability set for these Virtual Machines.

The Error in SCVMM is the following:

Error (23317)
The operation Change properties of virtual machine is not permitted on a virtual machine that has shared virtual hard disks.

Recommended Action
The operation Change properties of virtual machine is not permitted on a virtual machine that has shared virtual hard disks.

Stanislav Zhelyazkov (Microsoft MVP) blogged about this in October 2013. The solution is pretty easy and is called PowerShell. Just do the modification but do not apply it. Use the script view in Virtual Machine Manager to get the code which would run behind the scene.

For example:

 
$VM = Get-SCVirtualMachine -VMMServer VMM01.contoso.local -Name "SQL001" | where {$_.VMHost.Name -eq "HV02.contoso.local"}
$OperatingSystem = Get-SCOperatingSystem -VMMServer VMM01.contoso.local | where {$_.Name -eq "Windows Server 2012 R2 Datacenter"}
$UserRole = Get-SCUserRole -VMMServer VMM01.contoso.local -Name "Administrator"
$CPUType = Get-SCCPUType -VMMServer VMM01.contoso.local | where {$_.Name -eq "3.60 GHz Xeon (2 MB L2 cache)"}
$AvailabilitySetNames = "SQL"
 
Set-SCVirtualMachine -VM $VM -Name "SQL001" -Description "" -OperatingSystem $OperatingSystem -Owner "contoso\admin" -UserRole $UserRole -CPUCount 4 -MemoryMB 16384 -DynamicMemoryEnabled $false -MemoryWeight 5000 -CPUExpectedUtilizationPercent 20 -DiskIops 0 -CPUMaximumPercent 100 -CPUReserve 0 -NumaIsolationRequired $false -NetworkUtilizationMbps 0 -CPURelativeWeight 100 -HighlyAvailable $true -HAVMPriority 2000 -DRProtectionRequired $false -SecureBootEnabled $true -CPULimitFunctionality $false -CPULimitForMigration $false -CPUType $CPUType -Tag "(none)" -QuotaPoint 1 -RunAsynchronously -DelayStartSeconds 0 -BlockDynamicOptimization $false -EnableOperatingSystemShutdown $true -EnableTimeSynchronization $true -EnableDataExchange $true -EnableHeartbeat $true -EnableBackup $true -AvailabilitySetNames $AvailabilitySetNames

Remove all the things you don’t need and run the script:

$VM = Get-SCVirtualMachine -Name "SQL001"
$AvailabilitySetNames = "SQL"
 
Set-SCVirtualMachine -VM $VM -AvailabilitySetNames $AvailabilitySetNames