Skip to content

HPF PR: vmss <- huangpf:dev #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,21 @@ function Test-GetAzureRmVMDscExtension
$p = Add-AzureRmVMDataDisk -VM $p -Name 'testDataDisk1' -Caching 'ReadOnly' -DiskSizeInGB 10 -Lun 1 -VhdUri $dataDiskVhdUri1 -CreateOption Empty;

# OS & Image
$user = "Foo12";
$password = 'BaR@123' + $rgname;
$user = "localadmin";
$password = 'Bull_dog1';
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword);
$computerName = 'test';
$vhdContainer = "https://$stoname.blob.core.windows.net/test";

$p = Set-AzureRmVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred -ProvisionVMAgent;

$imgRef = Get-DefaultCRPWindowsImageOffline;
$p = ($imgRef | Set-AzureRmVMSourceImage -VM $p);

$p = Set-AzureRmVMSourceImage -VM $p -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2012-R2-Datacenter -Version "latest"

# Virtual Machine
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $p;

# Test DSC Extension
$version = '2.8';
$version = '2.13';

# Publish DSC Configuration
#TODO: Find a way to mock calls with storage
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public override void ExecuteCmdlet()
//Add retry logic due to CRP service restart known issue CRP bug: 3564713
var count = 1;
Rest.Azure.AzureOperationResponse op = null;
while (count <= 2)

while (true)
{
op = VirtualMachineExtensionClient.DeleteWithHttpMessagesAsync(
ResourceGroupName,
Expand All @@ -70,12 +71,15 @@ public override void ExecuteCmdlet()
//&& op.Error != null && "InternalExecutionError".Equals(op.Error.Code))
{
count++;
if (count <= 2)
{
continue;
}
}
else
{
break;
}

break;
}

var result = Mapper.Map<PSAzureOperationResponse>(op);
WriteObject(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ private void CreateConfiguration()
//Add retry logic due to CRP service restart known issue CRP bug: 3564713
var count = 1;
Rest.Azure.AzureOperationResponse<VirtualMachineExtension> op = null;
while (count <= 2)

while (true)
{
try
{
Expand All @@ -375,6 +376,8 @@ private void CreateConfiguration()
VMName,
Name ?? DscExtensionCmdletConstants.ExtensionPublishedNamespace + "." + DscExtensionCmdletConstants.ExtensionPublishedName,
parameters).GetAwaiter().GetResult();

break;
}
catch (Rest.Azure.CloudException ex)
{
Expand All @@ -385,13 +388,16 @@ private void CreateConfiguration()
&& errorReturned.Error != null && "InternalExecutionError".Equals(errorReturned.Error.Code))
{
count++;
if (count <= 2)
{
continue;
}
}
else
{
break;
}

ThrowTerminatingError(new ErrorRecord(ex, "InvalidResult", ErrorCategory.InvalidResult, null));
}
}

var result = Mapper.Map<PSAzureOperationResponse>(op);
WriteObject(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<Compile Include="JobCommands\StopAzureHDInsightJobCommand.cs" />
<Compile Include="JobCommands\StartAzureHDInsightJobCommand.cs" />
<Compile Include="ManagementCommands\SetAzureHDInsightDefaultStorageCommand.cs" />
<Compile Include="ManagementCommands\NewAzureHDInsightClusterIdentity.cs" />
<Compile Include="ManagementCommands\AddAzureHDInsightClusterIdentity.cs" />
<Compile Include="ManagementCommands\AddAzureHDInsightStorageCommand.cs" />
<Compile Include="ManagementCommands\AddAzureHDInsightScriptActionCommand.cs" />
<Compile Include="ManagementCommands\AddAzureHDInsightMetastoreCommand.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static class CommandNames
public const string AzureHDInsightJobOutput = "AzureRmHDInsightJobOutput";
public const string AzureHDInsightDefaultStorage = "AzureRmHDInsightDefaultStorage";
public const string AzureHDInsightHiveJob = "AzureRmHDInsightHiveJob";
public const string AzureHDInsightClusterIdentity = "AzureHDInsightClusterIdentity";
public const string AzureHDInsightClusterIdentity = "AzureRmHDInsightClusterIdentity";
public const string Hive = "Hive";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
namespace Microsoft.Azure.Commands.HDInsight.ManagementCommands
{
[Cmdlet(
VerbsCommon.New,
VerbsCommon.Add,
Constants.CommandNames.AzureHDInsightClusterIdentity),
OutputType(typeof(AzureHDInsightConfig))]
public class NewAzureHDInsightClusterIdentity : HDInsightCmdletBase
public class AddAzureHDInsightClusterIdentity : HDInsightCmdletBase
{
#region Input Parameter Definitions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,193 @@
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Add-AzureRmHDInsightClusterIdentity</command:name>
<maml:description>
<maml:para>Adds a cluster identity to the Microsoft Azure HDInsight cluster configuration.</maml:para>
</maml:description>
<maml:copyright>
<maml:para />
</maml:copyright>
<command:verb>Add</command:verb>
<command:noun>AzureHDInsightClusterIdentity</command:noun>
<dev:version />
</command:details>
<maml:description>
<maml:para>Adds a cluster identity to the Microsoft Azure HDInsight cluster configuration.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Add-AzureRmHDInsightClusterIdentity</maml:name>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="0">
<maml:name>Config</maml:name>
<maml:description>
<maml:para>The HDInsight cluster configuration to use when creating the new cluster.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">AzureHDInsightConfig</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
<maml:name>ObjectId</maml:name>
<maml:description>
<maml:para>The Service Principal Object Id for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Guid</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2">
<maml:name>CertificateFilePath</maml:name>
<maml:description>
<maml:para>The Service Principal certificate for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="3">
<maml:name>CertificatePassword</maml:name>
<maml:description>
<maml:para>The Service Principal certificate password for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>AadTenantId</maml:name>
<maml:description>
<maml:para>The Service Principal AAD Tenant Id for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">Guid</command:parameterValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>Profile</maml:name>
<maml:description>
<maml:para />
</maml:description>
<command:parameterValue required="true" variableLength="false">AzureProfile</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="0">
<maml:name>Config</maml:name>
<maml:description>
<maml:para>The HDInsight cluster configuration to use when creating the new cluster.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">AzureHDInsightConfig</command:parameterValue>
<dev:type>
<maml:name>AzureHDInsightConfig</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>
</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
<maml:name>ObjectId</maml:name>
<maml:description>
<maml:para>The Service Principal Object Id for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">Guid</command:parameterValue>
<dev:type>
<maml:name>Guid</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>
</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2">
<maml:name>CertificateFilePath</maml:name>
<maml:description>
<maml:para>The Service Principal certificate for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>
</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="3">
<maml:name>CertificatePassword</maml:name>
<maml:description>
<maml:para>The Service Principal certificate password for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>
</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>AadTenantId</maml:name>
<maml:description>
<maml:para>The Service Principal AAD Tenant Id for accessing Azure Data Lake.</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">Guid</command:parameterValue>
<dev:type>
<maml:name>Guid</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>
</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
<maml:name>Profile</maml:name>
<maml:description>
<maml:para />
</maml:description>
<command:parameterValue required="true" variableLength="false">AzureProfile</command:parameterValue>
<dev:type>
<maml:name>AzureProfile</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>
</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>
</maml:name>
<maml:uri>
</maml:uri>
<maml:description />
</dev:type>
<maml:description>
<maml:para />
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>
</maml:name>
<maml:uri>
</maml:uri>
<maml:description />
</dev:type>
<maml:description>
<maml:para />
</maml:description>
</command:returnValue>
</command:returnValues>
<command:terminatingErrors>
</command:terminatingErrors>
<command:nonTerminatingErrors>
</command:nonTerminatingErrors>
<maml:alertSet>
<maml:title>
</maml:title>
<maml:alert>
<maml:para />
<maml:para>Keywords: azure, azurerm, arm, resource, management, manager, hadoop, hdinsight, hd, insight</maml:para>
</maml:alert>
</maml:alertSet>
<command:examples>
</command:examples>
<maml:relatedLinks>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!--Generated by PS Cmdlet Help Editor-->
<command:details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ public class SetAzureVMChefExtensionCommand : VirtualMachineChefExtensionCmdletB
[ValidateNotNullOrEmpty]
public string BootstrapVersion { get; set; }

[Parameter(
ValueFromPipelineByPropertyName = true,
HelpMessage = "Uninstall Chef client during update/uninstall extension. Default is false.")]
[ValidateNotNullOrEmpty]
public SwitchParameter UninstallChefClient { get; set; }

[Parameter(
Mandatory = true,
ParameterSetName = LinuxParameterSetName,
Expand Down Expand Up @@ -174,6 +180,7 @@ private void SetPublicConfig()
string AutoUpdateChefClient = this.AutoUpdateChefClient.IsPresent ? "true" : "false";
string DeleteChefConfig = this.DeleteChefConfig.IsPresent ? "true" : "false";
string BootstrapVersion = this.BootstrapVersion;
string UninstallChefClient = this.UninstallChefClient.IsPresent ? "true" : "false";

//Cases handled:
// 1. When clientRb given by user and:
Expand Down Expand Up @@ -227,42 +234,46 @@ private void SetPublicConfig()
{
if (IsBootstrapOptionsEmpty)
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
else
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
}
else
{
if (IsBootstrapOptionsEmpty)
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(RunListTemplate, this.RunList),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
else
{
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5}}}",
this.PublicConfiguration = string.Format("{{{0},{1},{2},{3},{4},{5},{6}}}",
string.Format(AutoUpdateTemplate, AutoUpdateChefClient),
string.Format(DeleteChefConfigTemplate, DeleteChefConfig),
string.Format(ClientRbTemplate, ClientConfig),
string.Format(RunListTemplate, this.RunList),
string.Format(BootStrapOptionsTemplate, this.BootstrapOptions),
string.Format(BootstrapVersionTemplate, BootstrapVersion));
string.Format(BootstrapVersionTemplate, BootstrapVersion),
string.Format(UninstallChefClientTemplate, UninstallChefClient));
}
}
}
Expand Down
Loading