Skip to content

Commit

Permalink
Merge pull request Azure#2931 from krkhan/disable_enc_fix
Browse files Browse the repository at this point in the history
UpdateVmEncryptionSettings() needs to be called for VolumeType=Data on Linux VMs
  • Loading branch information
cormacpayne authored Sep 19, 2016
2 parents 2eaf617 + d6762ea commit 163e96c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,27 @@ public override void ExecuteCmdlet()
this.Name,
parameters).GetAwaiter().GetResult();

if (string.IsNullOrWhiteSpace(VolumeType) ||
VolumeType.Equals(AzureDiskEncryptionExtensionContext.VolumeTypeAll, StringComparison.InvariantCultureIgnoreCase) ||
VolumeType.Equals(AzureDiskEncryptionExtensionContext.VolumeTypeOS, StringComparison.InvariantCultureIgnoreCase))
// +---------+---------------+----------------------------+
// | OSType | VolumeType | UpdateVmEncryptionSettings |
// +---------+---------------+----------------------------+
// | Windows | OS | Yes |
// | Windows | Data | No |
// | Windows | Not Specified | Yes |
// | Linux | OS | N/A |
// | Linux | Data | Yes |
// | Linux | Not Specified | N/A |
// +---------+---------------+----------------------------+

if (OperatingSystemTypes.Windows.Equals(currentOSType) &&
VolumeType.Equals(AzureDiskEncryptionExtensionContext.VolumeTypeData, StringComparison.InvariantCultureIgnoreCase))
{
var opVm = UpdateVmEncryptionSettings();
var result = Mapper.Map<PSAzureOperationResponse>(opVm);
var result = Mapper.Map<PSAzureOperationResponse>(opExt);
WriteObject(result);
}
else
{
var result = Mapper.Map<PSAzureOperationResponse>(opExt);
var opVm = UpdateVmEncryptionSettings();
var result = Mapper.Map<PSAzureOperationResponse>(opVm);
WriteObject(result);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum EncryptionStatus
Encrypted,
NotEncrypted,
NotMounted,
DecryptionInProgress,
EncryptionInProgress,
VMRestartPending,
Unknown
Expand Down

0 comments on commit 163e96c

Please sign in to comment.