Skip to content

Commit ea5229f

Browse files
committed
Adding the PersistAzureVMOnFailrue hook for persisting failed provisioning vms.
1 parent 37a7787 commit ea5229f

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/VirtualDevice/NewAzureStorSimpleVirtualDeviceCommand.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public class NewAzureStorSimpleVirtualDeviceCommand : StorSimpleCmdletBase
4141

4242
[Parameter(Position = 3, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.CreateNewStorageAccount, ParameterSetName = StorSimpleCmdletParameterSet.CreateNewStorageAccount)]
4343
public SwitchParameter CreateNewStorageAccount { get; set; }
44+
45+
[Parameter(DontShow = true, Mandatory = false, HelpMessage = StorSimpleCmdletHelpMessage.PersistAzureVMOnFailrue)]
46+
public SwitchParameter PersistAzureVMOnFailrue { get; set; }
4447

4548
public override void ExecuteCmdlet()
4649
{
@@ -57,6 +60,11 @@ public override void ExecuteCmdlet()
5760
StorageAccountName = StorageAccountName
5861
};
5962

63+
if (PersistAzureVMOnFailrue.IsPresent)
64+
{
65+
applianceProvisiongInfo.DeleteAzureCisVMOnFailure = false;
66+
}
67+
6068
var deviceJobResponse = StorSimpleClient.CreateVirtualDevice(applianceProvisiongInfo);
6169

6270
HandleDeviceJobResponse(deviceJobResponse, "create");

src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@
8282
<Reference Include="Microsoft.WindowsAzure.Management.Scheduler">
8383
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Scheduler.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Scheduler.dll</HintPath>
8484
</Reference>
85-
<Reference Include="Microsoft.WindowsAzure.Management.StorSimple">
86-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.1.0.0-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll</HintPath>
85+
<Reference Include="Microsoft.WindowsAzure.Management.StorSimple, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
86+
<SpecificVersion>False</SpecificVersion>
87+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.StorSimple.1.0.1-preview\lib\net40\Microsoft.WindowsAzure.Management.StorSimple.dll</HintPath>
8788
</Reference>
8889
<Reference Include="Newtonsoft.Json">
8990
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>

src/ServiceManagement/StorSimple/Commands.StorSimple/StorSimpleCmdletHelpMessage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ internal static class StorSimpleCmdletHelpMessage
119119
public const string ToTime = "End of time interval for which to filter results.";
120120
public const string DeviceJobStatus = "Status of job.";
121121
public const string DeviceJobType = "Type of job.";
122-
122+
public const string PersistAzureVMOnFailrue =
123+
"The switch parameter to debug any Provisioning Failrues by skipping deletion of the VM on failrue";
123124
}
124125
}

src/ServiceManagement/StorSimple/Commands.StorSimple/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1313
<package id="Microsoft.WindowsAzure.Management" version="4.0.1" targetFramework="net45" />
1414
<package id="Microsoft.WindowsAzure.Management.Scheduler" version="6.0.0" targetFramework="net45" />
15-
<package id="Microsoft.WindowsAzure.Management.StorSimple" version="1.0.0-preview" targetFramework="net45" />
15+
<package id="Microsoft.WindowsAzure.Management.StorSimple" version="1.0.1-preview" targetFramework="net45" />
1616
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
1717
</packages>

0 commit comments

Comments
 (0)