Add a new VIProperty: KMSserver for VM

As Mike suggested, add a new VI Property to retrieve the KMSserver
ClusterId for encrypted VMs.
This commit is contained in:
baoyinqiao
2016-12-14 08:57:43 +08:00
parent 1977251e8f
commit 7a5ae91379

View File

@@ -59,6 +59,13 @@ New-VIProperty -Name Locked -ObjectType VirtualMachine -Value {
($vm.extensiondata.Runtime.ConnectionState -eq "invalid") -and ($vm.extensiondata.Config.KeyId)
} -BasedOnExtensionProperty 'Runtime.ConnectionState','Config.KeyId' -Force | Out-Null
New-VIProperty -Name KMSserver -ObjectType VirtualMachine -Value {
Param ($VM)
if ($VM.Encrypted) {
$VM.EncryptionKeyId.ProviderId.Id
}
} -BasedOnExtensionProperty 'Config.KeyId' -Force | Out-Null
New-VIProperty -Name Encrypted -ObjectType HardDisk -Value {
Param ($hardDisk)
$hardDisk.ExtensionData.Backing.KeyId -ne $null