Update VMware.VMEncryption.psm1

This commit is contained in:
simonfangyingzhang
2018-04-27 04:42:18 +01:00
committed by GitHub
parent 13649b8e35
commit 29719d6ca7

View File

@@ -81,6 +81,13 @@ New-VIProperty -Name Encrypted -ObjectType HardDisk -Value {
$hardDisk.ExtensionData.Backing.KeyId -ne $null
} -BasedOnExtensionProperty 'Backing.KeyId' -Force | Out-Null
New-VIProperty -Name KMSserver -ObjectType VMHost -Value {
Param ($VMHost)
if ($VMHost.CryptoSafe) {
$VMHost.ExtensionData.Runtime.CryptoKeyId.ProviderId.Id
}
} -BasedOnExtensionProperty 'Runtime.CryptoKeyId.ProviderId.Id' -Force | Out-Null
New-VIProperty -Name EncryptionKeyId -ObjectType HardDisk -Value {
Param ($Disk)
if ($Disk.Encrypted) {
@@ -976,7 +983,7 @@ Function Set-VMDiskEncryptionKey {
C:\PS>$KMSCluster = Get-KMSCluster | select -last 1
C:\PS>$VM = Get-VM -Name win2012
C:\PS>$HardDisk = get-vm $vm|Get-HardDisk
C:\PS>$HardDisk|$Set-VMEncryptionKey -VM $VM -KMSClusterId $KMSCluster.Id -Deep
C:\PS>$HardDisk|Set-VMDiskEncryptionKey -VM $VM -KMSClusterId $KMSCluster.Id -Deep
Deep rekeys all the disks of the $VM using a new key.
The key is generated from the KMS whose clusterId is $KMSCluster.Id.
@@ -1681,7 +1688,7 @@ Function Get-KMServerStatus {
[String] $KMSClusterId
)
Begin {
Begin {
# Confirm the connected VIServer is vCenter Server
ConfirmIsVCenter