Skip to content

Commit 176f2ee

Browse files
committed
Merge pull request #41 from AzCiS/parvezah
Adding the PersistAzureVMOnFailrue hook for the cmdlet
2 parents e3a122f + 65f0610 commit 176f2ee

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.Management.Automation;
1717
using Microsoft.WindowsAzure.Management.StorSimple.Models;
1818

19-
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets.VirtualDevice
19+
namespace Microsoft.WindowsAzure.Commands.StorSimple.Cmdlets
2020
{
2121
[Cmdlet(VerbsCommon.New, "AzureStorSimpleVirtualDevice"), OutputType(typeof(string))]
2222
public class NewAzureStorSimpleVirtualDeviceCommand : StorSimpleCmdletBase
@@ -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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,7 @@ internal static class StorSimpleCmdletHelpMessage
121121
public const string DeviceJobType = "Type of job.";
122122
public const string AdministratorPasswd = "Administrator password for the device.";
123123
public const string SnapshotManagerPasswd = "Password for snapshot manager";
124+
public const string PersistAzureVMOnFailrue =
125+
"The switch parameter to debug any Provisioning Failrues by skipping deletion of the VM on failrue";
124126
}
125127
}

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)