2017-06-09 13 views
0

テンプレートでpowershellを使用してazureにデプロイしようとすると、「Aligned」から「Classic」への可用性セットSKUの変更は許可されません。azure展開エラー "可用性セットのSKUを 'Aligned'から 'Classic'に変更することはできません。

これは私のテンプレートファイルです:これは私がマシンを試してみて、起動するために使用していPowerShellのある

{ 
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 
    "contentVersion": "1.0.0.2", 
    "parameters": { 
    "tagvalues": { 
     "value": { 
     "Owner": "That Guy", 
     "environment": "Production", 
     "Engagement": "xxxxxxxxxx", 
     "Role": "Proxy", 
     "LOB": "Advisory", 
     "Application": "company Leasing Tool" 
     } 
    }, 
     "vmName": { 
     "value": "machine_name" 
    }, 
    "osStorageAccountName": { 
     "value": "vm_storage2" 
    }, 
    "virtualNetworkName": { 
     "value": "vnet-prod-core1" 
    }, 
    "subnetName": { 
     "value": "vnet-prod-core1-subnet-perimeter" 
    }, 
    "existingVnetResourceGroupName": { 
     "value": "rg-core1", 
     "metadata": { 
     "description": "The resource group where the VNET is located." 
     } 
    }, 
    "imageName": { 
     "value": "image-rhel-72-20170418.vhd", 
     "metadata": { 
     "description": "Enter the name of the image." 
     } 
    }, 
    "vmSize": { 
     "value": "Standard_D1" 
    }, 
    "avSetName": { 
     "value": "avset-proxy2", 
     "metadata": { 
     "description": "Name of availability set to add this VM. If it doesn't exist, it will be created." 
     } 
    }, 
    "adminUsername": { 
     "value": "mysadmin" 
    }, 
    "adminPassword": { 
     "value": "secret" 
    } 
    } 
} 

Login-AzureRmAccount 

select-AzureRmSubscription -SubscriptionName "Asset.Prod" 

$folder = "C:\Users\mysuer\Desktop\important_folders\Projects\repo\MS-Azure-Cloud\Templates\VirtualMachines\LinuxImageAvSet\" #Must end in trailing slash. 
$rg = "rg-shared" 
$template = "azuredeploy_unmanaged.json" 
$param = "LinuxDeploymentsParameters/machine_name.params.json" 
Test-AzureRmResourceGroupDeployment -ResourceGroupName $rg -TemplateFile ($folder + $template) -TemplateParameterFile ($folder + $param) -Verbose 
これは私のパラメータファイルです

{ 
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 
    "contentVersion": "1.0.0.2", 
    "parameters": { 
    "tagvalues": { 
     "type": "object", 
     "defaultValue": { 
     "Owner": "Fill in", 
     "environment": "Fill in", 
     "Engagement": "Fill in", 
     "Role": "Fill in", 
     "LOB": "Fill in", 
     "Application": "Fill in" 
     } 
    }, 
    "vmName": { 
     "type": "string", 
     "metadata": { 
     "description": "This is the name of the your VM" 
     } 
    }, 
    "imageName": { 
     "type": "string", 
     "metadata": { 
     "description": "This is the name of the image file. Must end in .vhd" 
     } 
    }, 
    "virtualNetworkName": { 
     "type": "string", 
     "metadata": { 
     "description": "Virtual Network Name" 
     } 
    }, 
    "subnetName": { 
     "type": "string", 
     "metadata": { 
     "description": "Subnet Name" 
     } 
    }, 
    "existingVnetResourceGroupName": { 
     "type": "string", 
     "metadata": { 
     "description": "Resource Group Name for Vnet" 
     } 
    }, 
    "osStorageAccountName": { 
     "type": "string" 
    }, 
    "vmSize": { 
     "type": "string", 
     "defaultValue": "Standard_A2", 
     "metadata": { 
     "description": "This is the size of your VM" 
     } 
    }, 
    "avSetName": { 
     "type":"string", 
     "metadata":{ 
     "description": "Availability Set Name" 
     } 
    }, 
    "adminUserName": { 
     "type": "string", 
     "defaultValue": "smadmin" 
    }, 
    "adminPassword": { 
     "type": "securestring" 
    } 
    }, 
    "variables": { 
    "vmName": "[parameters('vmName')]", 
    "nicName": "[concat(parameters('vmName'),'-Nic')]", 
    "osDiskVhdUri": "[concat('https://', parameters('osStorageAccountName'), '.blob.core.windows.net/vhds/', parameters('vmName'),'-osDisk.vhd')]", 
    "hostName": "[toLower(concat(parameters('vmName'), '.nix.us.company_world.company.com'))]", 
    "osType": "Linux", 
    "imageUri": "[concat('https://', parameters('osStorageAccountName'), '.blob.core.windows.net/images/',parameters('imageName'))]" 
    }, 
    "resources": [ 
    { 
     "apiVersion": "2016-03-30", 
     "type": "Microsoft.Network/networkInterfaces", 
     "name": "[variables('nicName')]", 
     "tags": { 
     "Owner": "[parameters('tagvalues').Owner]", 
     "environment": "[parameters('tagvalues').environment]", 
     "Engagement": "[parameters('tagvalues').Engagement]", 
     "Name": "[parameters('vmName')]", 
     "Role": "[parameters('tagvalues').Role]", 
     "LOB": "[parameters('tagvalues').LOB]", 
     "Application": "[parameters('tagvalues').Application]" 
     }, 
     "location": "[resourceGroup().location]", 
     "properties": { 
     "ipConfigurations": [ 
      { 
      "name": "ipconfig1", 
      "properties": { 
       "privateIPAllocationMethod": "Dynamic", 
       "subnet": { 
       "id": "[concat(resourceId(parameters('existingVnetResourceGroupName'), 'Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName')), '/subnets/',parameters('subnetName'))]" 
       } 
      } 
      } 
     ] 
     } 
    }, 
    { 
     "name": "[parameters('avSetName')]", 
     "type": "Microsoft.Compute/availabilitySets", 
     "location": "[resourceGroup().location]", 
     "apiVersion": "2016-04-30-preview", 
     "properties": { 
     "managed": "false", 
     "platformFaultDomainCount":3, 
     "platformUpdateDomainCount":3 
     }, 
     "dependsOn": [ ], 
     "tags": { 
     "Owner": "[parameters('tagvalues').Owner]", 
     "environment": "[parameters('tagvalues').environment]", 
     "Engagement": "[parameters('tagvalues').Engagement]", 
     "Role": "[parameters('tagvalues').Role]", 
     "LOB": "[parameters('tagvalues').LOB]", 
     "Application": "[parameters('tagvalues').Application]" 
      } 
     }, 
    { 
     "apiVersion": "2016-04-30-preview", 
     "type": "Microsoft.Compute/virtualMachines", 
     "name": "[variables('vmName')]", 
     "tags": { 
     "Owner": "[parameters('tagvalues').Owner]", 
     "environment": "[parameters('tagvalues').environment]", 
     "Engagement": "[parameters('tagvalues').Engagement]", 
     "Role": "[parameters('tagvalues').Role]", 
     "LOB": "[parameters('tagvalues').LOB]", 
     "Application": "[parameters('tagvalues').Application]" 
    }, 
     "location": "[resourceGroup().location]", 
     "dependsOn": [ 
     "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]", 
     "[concat('Microsoft.Compute/availabilitySets/', parameters('avsetName'))]" 
     ], 
     "properties": { 
     "hardwareProfile": { 
      "vmSize": "[parameters('vmSize')]" 
     }, 
     "osProfile": { 
      "computerName": "[variables('hostName')]", 
      "adminUsername": "[parameters('adminUsername')]", 
      "adminPassword": "[parameters('adminPassword')]" 
     }, 
     "storageProfile": { 
      "osDisk": { 
      "name": "[concat(variables('vmName'),'-osDisk')]", 
      "osType": "[variables('osType')]", 
      "createOption": "FromImage", 
      "caching": "ReadWrite", 
      "image": { 
       "uri": "[variables('imageUri')]" 
      }, 
      "vhd": { 
       "uri": "[variables('osDiskVhdUri')]" 
      } 
      } 
     }, 
     "networkProfile": { 
      "networkInterfaces": [ 
      { 
       "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]" 
      } 
      ] 
     }, 
     "diagnosticsProfile": { 
      "bootDiagnostics": { 
      "enabled": false 
      } 
     }, 
     "availabilitySet": { 
      "id": "[resourceId('Microsoft.Compute/availabilitySets',parameters('avSetName'))]" 
     } 
     } 
    } 
    ], 
    "outputs": { 
    "ipAddress": { 
     "value": "[reference(variables('nicName')).ipConfigurations[0].properties.privateIPAddress]", 
     "type": "string" 
    } 
    } 
} 

これは私が得ているエラーの完全な出力です:

New-AzureRmResourceGroupDeployment : 1:02:41 PM - Resource Microsoft.Compute/availabilitySets 'avset--proxy2' failed with message '{ 
    "error": { 
    "code": "OperationNotAllowed", 
    "message": "Changing Availability Set SKU from 'Aligned' to 'Classic' is not allowed." 
    } 
}' 
At line:1 char:1 
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $rg -TemplateFi ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception 
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet 

VERBOSE: 1:02:41 PM - Resource Microsoft.Network/networkInterfaces 'machine_name-Nic' provisioning status is succeeded 
VERBOSE: 1:02:41 PM - Checking deployment status in 5 seconds 
New-AzureRmResourceGroupDeployment : 1:02:46 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for 
usage details. 
At line:1 char:1 
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $rg -TemplateFi ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception 
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet 

New-AzureRmResourceGroupDeployment : 1:02:46 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for 
usage details. 
At line:1 char:1 
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $rg -TemplateFi ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception 
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet 

私のファイルは、右側のパス上にある:

ls -lh C:\Users\myser\Desktop\important_folders\Projects\repo\MS-Azure-Cloud\Templates\VirtualMachines\KTECHLinuxImageAvSet\azuredeploy_unmanaged.json 
-rw-r--r-- 1 myser 1049089 6.0K Jun 9 13:02 'C:\Users\myser\Desktop\important_folders\Projects\repo\MS-Azure-Cloud\Templates\VirtualMachines\KTECHLinuxImageAvSet\azuredeploy_unmanaged.json' 

ls C:\Users\myser\Desktop\important_folders\Projects\repo\MS-Azure-Cloud\Templates\VirtualMachines\company_tech_avset\LinuxDeploymentsParameters\machine_name.params.json 
'C:\Users\myser\Desktop\important_folders\Projects\repo\MS-Azure-Cloud\Templates\VirtualMachines\company_tech_avset\LinuxDeploymentsParameters\machine_name.params.json' 

は、どのように私はこれを修正して、このエラーを乗り越えることができますか?

答えて

0

説明によると、可用性セットはVirtual Machine Managed DisksおよびUnmanaged Diskで有効です。以下
は、新しいスクリプトであり、我々は、コード「SKU」と「名前」の唯一の追加の行を見つけることができます:「同盟」または「名前」:「古典」:

{ 
"name": "[Parameters('availabilitySetName')]", 
"type": "Microsoft.Compute/availabilitySets", 
"location": "[resourceGroup().location]", 
"apiVersion": "2016-04-30-preview", 
"sku": { 
"name": "Classic" 
}, 
"tags": { 
}, 
"properties": { 
"platformUpdateDomainCount": 1, 
"platformFaultDomainCount": 1 
} 
}, 

管理対象ディスクVMの使用整合性のないアンマネージディスクの使用は古典的です。詳細はofficial articleを参照してください。

+0

今すぐ使用できますか?さらなる支援をご希望の場合はお知らせください。 –

関連する問題