Skip to content

Commit bcef6aa

Browse files
Kamran Khanshahabhijeet
authored andcommitted
Skip backup for Linux VMs when SkipVmBackup switch is specified (Azure#3510)
* Use test extension for ADE on Linux * Skip backup creation for Linux VMs based on switch * Revert "Use test extension for ADE on Linux" This reverts commit 2535c73. * Convert to bool instead of using IsPresent * Update help file for SkipVmBackup parameter
1 parent bf9b61a commit bcef6aa

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/ResourceManager/Compute/Commands.Compute/Extension/AzureDiskEncryption/SetAzureDiskEncryptionExtension.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ public class SetAzureDiskEncryptionExtensionCommand : VirtualMachineExtensionBas
167167
HelpMessage = "Disable auto-upgrade of minor version")]
168168
public SwitchParameter DisableAutoUpgradeMinorVersion { get; set; }
169169

170+
[Parameter(
171+
Mandatory = false,
172+
Position = 15,
173+
ValueFromPipelineByPropertyName = true,
174+
HelpMessage = "Skip backup creation for Linux VMs")]
175+
public SwitchParameter SkipVmBackup { get; set; }
176+
170177
private OperatingSystemTypes? currentOSType = null;
171178

172179
private void ValidateInputParameters()
@@ -430,7 +437,7 @@ public override void ExecuteCmdlet()
430437

431438
currentOSType = virtualMachineResponse.StorageProfile.OsDisk.OsType;
432439

433-
if (OperatingSystemTypes.Linux.Equals(currentOSType))
440+
if (OperatingSystemTypes.Linux.Equals(currentOSType) && !SkipVmBackup)
434441
{
435442
CreateVMBackupForLinx();
436443
}

src/ResourceManager/Compute/Commands.Compute/Microsoft.Azure.Commands.Compute.dll-Help.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21262,6 +21262,14 @@ PS C:\> Set-AzureRmVMDataDisk -VM $VM -Name "DataDisk01" -Caching ReadWrite |
2126221262
<maml:uri /></dev:type>
2126321263
<dev:defaultValue>False</dev:defaultValue>
2126421264
</command:parameter>
21265+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="16" aliases="none"><maml:name>SkipVmBackup</maml:name>
21266+
<maml:Description><maml:para>Skip backup creation for Linux VMs
21267+
</maml:para>
21268+
</maml:Description>
21269+
<dev:type><maml:name>SwitchParameter</maml:name>
21270+
<maml:uri /></dev:type>
21271+
<dev:defaultValue>False</dev:defaultValue>
21272+
</command:parameter>
2126521273
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="2" aliases="ResourceName"><maml:name>VMName</maml:name>
2126621274
<maml:Description><maml:para>Specifies the name of the virtual machine.
2126721275
</maml:para>

0 commit comments

Comments
 (0)