2016-02-19 2 views
0

Я развертываю образы Windows Azure VM в своей подписке, используя шаблон управления ресурсами, который они развертывают отлично, ожидая, что фоновый рисунок рабочего стола черный, и если я включу расширение BGInfo, это не сработает.Черный рабочий стол Azure VM

Если я разворачиваю один и тот же тип изображения через портал Azure, фон рабочего стола верен (Windows ServerBG) и BGInfo работает, как ожидалось.

Это шаблон я использую:

{ 
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 
    "contentVersion": "1.0.0.0", 
    "parameters": 
    { 
    "location": 
    { 
     "type": "string", 
     "defaultValue": "North Europe", 
     "allowedValues": 
     [ 
     "West US", 
     "East US", 
     "West Europe", 
     "East Asia", 
     "Southeast Asia", 
     "North Europe" 
     ], 
     "metadata": 
     { 
     "description": "Location of resources" 
     } 
    }, 
    "StorageAccount": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Storage Account Name" 
     } 
    }, 
    "storageAccountType": 
    { 
     "type": "string", 
     "defaultValue": "Standard_LRS", 
     "metadata": 
     { 
     "description": "Type of the Storage Account" 
     } 
    }, 
    "privateIPAddressType": 
    { 
     "type": "string", 
     "defaultValue": "Static", 
     "allowedValues": 
     [ 
     "Dynamic", 
     "Static" 
     ], 
     "metadata": 
     { 
     "description": "Private IP Address Type" 
     } 
    }, 
    "privateIPAddress": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Private IP Address" 
     } 
    }, 
    "vmName": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Name of the VM" 
     } 
    }, 
    "vmSize": 
    { 
     "type": "string", 
     "defaultValue": "Standard_D2", 
     "metadata": 
     { 
     "description": "Size of the VM" 
     } 
    }, 
    "imagePublisher": 
    { 
     "type": "string", 
     "defaultValue": "MicrosoftWindowsServer", 
     "metadata": 
     { 
     "description": "Image Publisher" 
     } 
    }, 
    "imageOffer": 
    { 
     "type": "string", 
     "defaultValue": "WindowsServer", 
     "metadata": 
     { 
     "description": "Image Offer" 
     } 
    }, 
    "imageSKU": 
    { 
     "type": "string", 
     "defaultValue": "2012-R2-Datacenter", 
     "metadata": 
     { 
     "description": "Image SKU" 
     } 
    }, 
    "adminUsername": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Admin username" 
     } 
    }, 
    "adminPassword": 
    { 
     "type": "securestring", 
     "metadata": 
     { 
     "description": "Admin password" 
     } 
    }, 
    "existingVNETName": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Existing VNET that contains the domain controller" 
     } 
    }, 
    "existingSubnetName": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Existing subnet that contains the domain controller" 
     } 
    }, 
    "existingVirtualNetworkResourceGroup": 
    { 
     "type": "string", 
     "metadata": 
     { 
     "description": "Name of the existing VNET resource group" 
     } 
    } 
    }, 
    "variables": 
    { 
    "api-version": "2015-05-01-preview", 
    "vnetID": "[resourceId(parameters('existingVirtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', parameters('existingVNETName'))]", 
    "subnet1Ref": "[concat(variables('vnetID'),'/subnets/',parameters('existingSubnetName'))]", 
    "privateNicName": "[concat(parameters('vmName'),'-Production')]", 
    "NewStorageAccount": "[concat(parameters('vmName'), parameters('StorageAccount'))]", 
    "OSDisk": "[concat(parameters('vmName'),'-OSDisk')]", 
    "DataDisk": "[concat(parameters('vmName'),'-DataDisk')]" 
    }, 
    "resources": 
    [ 

    { 
     "apiVersion": "[variables('api-version')]", 
     "type": "Microsoft.Storage/storageAccounts", 
     "name": "[variables('NewStorageAccount')]", 
     "location": "[parameters('location')]", 
     "properties": 
     { 
     "accountType": "[parameters('storageAccountType')]" 
     } 
    }, 
    { 
     "apiVersion": "[variables('api-version')]", 
     "type": "Microsoft.Network/networkInterfaces", 
     "name": "[variables('privateNicName')]", 
     "location": "[parameters('location')]", 
     "tags": 
     { 
     "displayName": "NetworkInterface"  
     }, 
     "properties": 
     { 
     "ipConfigurations": 
     [ 
      { 
      "name": "ipconfig", 
      "properties": 
      { 
       "privateIPAllocationMethod": "[parameters('privateIPAddressType')]", 
       "privateIPAddress": "[parameters('privateIPAddress')]", 
       "subnet": 
       { 
       "id": "[variables('subnet1Ref')]" 
       } 
      } 
      }  
     ] 
     } 
    }, 
    { 
     "apiVersion": "[variables('api-version')]", 
     "type": "Microsoft.Compute/virtualMachines", 
     "name": "[parameters('vmName')]", 
     "location": "[parameters('location')]", 
     "tags": 
     { 
     "displayName": "VirtualMachine" 
     }, 
     "dependsOn": 
     [ 
     "[concat('Microsoft.Storage/storageAccounts/', variables('newStorageAccount'))]", 
     "[concat('Microsoft.Network/networkInterfaces/', variables('privateNicName'))]" 
     ], 
     "properties": 
     { 
     "hardwareProfile": 
     { 
      "vmSize": "[parameters('vmSize')]" 
     }, 
     "osProfile": 
     { 
      "computerName": "[parameters('vmName')]", 
      "adminUsername": "[parameters('adminUsername')]", 
      "adminPassword": "[parameters('adminPassword')]" 
     }, 
     "storageProfile": 
     { 
      "imageReference": 
      { 
      "publisher": "[parameters('imagePublisher')]", 
      "offer": "[parameters('imageOffer')]", 
      "sku": "[parameters('imageSKU')]", 
      "version": "latest" 
      }, 
      "osDisk": 
      { 
      "name": "[concat(parameters('vmName'),'-os')]", 
      "vhd": 
      { 
       "uri": "[concat('http://',variables('newStorageAccount'),'.blob.core.windows.net/vhds/',variables('OSDisk'),'.vhd')]" 
      }, 
      "caching": "ReadWrite", 
      "createOption": "FromImage" 
      }, 
      "dataDisks": 
      [ 
      { 
       "name": "[concat(parameters('vmName'),'-data')]", 
       "vhd": 
       { 
       "Uri": "[concat('http://',parameters('vmName'), parameters('StorageAccount'),'.blob.core.windows.net/vhds/',variables('dataDisk'),'.vhd')]" 
       }, 
       "caching": "None", 
       "createOption": "Empty", 
       "diskSizeGB": "100", 
       "lun": 0 
      } 
      ] 
     }, 
     "networkProfile": 
     { 
      "networkInterfaces": 
      [ 
      { 
       "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('privateNicName'))]" 
      } 
      ] 
     } 
     } 
    } 
    ], 

} 

Я попытался с помощью свежего шаблона, с теми же результатами, какие-то идеи?

+0

смог прикрепить снимок экрана вашего черного фона рабочего стола Azure VM Вы? – juvchan

+0

http://imgur.com/gxPDGlf – user989384

+0

Какую виртуальную машину вы пытаетесь предоставить? Например, Windows Server 2012 R2 – juvchan

ответ

0

В шаблоне вы не определяете bgInfoExtension. Если вы укажете его в своем шаблоне в качестве ресурса в разделе «Microsoft.Compute/virtualMachines», он будет автоматически развертываться при развертывании вашего шаблона.

Пример BGInfo расширение шаблона ARM сниппет:

"resources": [{ 
    "name": "bgInfoExt", 
    "type": "extensions", 
    "apiVersion": "[variables('api-version')]", 
    "location": "[parameters('location')]", 
    "dependsOn": [ 
     "[concat('Microsoft.Compute/virtualMachines/', parameters('vmName'))]" 
    ], 
    "properties": { 
     "publisher": "Microsoft.Compute", 
     "type": "BGInfo", 
     "typeHandlerVersion": "2.1", 
     "settings": { }, 
     "protectedSettings": null, 
     "autoUpgradeMinorVersion": true 
    } 
}] 
+0

Спасибо за это. Я развертывал расширение через powershell: Set-AzureRmVMExtension -ExtensionName BGInfo -Publisher Microsoft.Compute -Version 2.1 -ExtensionType BGInfo -Location $ location -ResourceGroupName $ RG -VMName $ vmName -Verbose – user989384

Смежные вопросы