【发布时间】:2016-09-20 16:41:02
【问题描述】:
我目前在从自定义 VM 映像创建 Azure VM 时遇到困难。我从这里跟随 Azure 的指南:https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-capture-image/
我已使用 Waagent 并按照指示取消配置机器,并取消分配、通用化和捕获我的机器映像(我对 Azure 软件提供的核心 Ubuntu 16.04LTS 映像进行了一些修改)。我已经成功创建了 template.json 文件(如果需要可以提供)。然后我完成了本文中概述的 powershell 脚本中的所有任务,只是将参数提取到变量中以使事情变得更容易一些。
## Global
$rgName = "testrg"
$location = "eastus"
## Storage
$storageName = "teststore"
$storageType = "Standard_GRS"
## Network
$nicname = "testnic"
$subnetName = "subnet1"
$vnetName = "testnet"
$vnetAddressPrefix = "10.0.0.0/16"
$vnetSubnetAddressPrefix = "10.0.0.0/24"
$ipName = "TestIP"
## Compute
$vmName = "testvm"
$computerName = "testcomputer"
$vmSize = "Standard_D1_v2"
$osDiskName = $vmName + "osDisk"
#template
$fileTemplate = "C:\AzureTemplate\template.json"
azure group create $rgName -l $location
azure network vnet create $rgName $vnetName -l $location
azure network vnet subnet create --resource-group $rgName --vnet-name $vnetName --name $subnetName --address-prefix $vnetSubnetAddressPrefix
azure network public-ip create $rgName $ipName -l $location
azure network nic create $rgName $nicName -k $subnetName -m $vnetName -p $ipName -l $location
azure network nic show $rgName $nicname
azure group deployment create $rgName $computerName -f $fileTemplate
我能够成功运行所有命令来创建资源组和网络组件,但是,当我尝试在 powershell 脚本底部运行部署命令时,我得到以下信息,它只是无限期地挂在这里.我是否使用正确的方法从自定义映像创建 VM?还是该 Azure 指南已过时?
azure group deployment create $rgName $computerName -f $fileTemplate
[32minfo[39m: Executing command [1mgroup deployment create[22m
[32minfo[39m: Supply values for the following parameters
编辑:显示问题的图片链接:http://imgur.com/a/Fgh8K
【问题讨论】:
标签: linux powershell azure virtual-machine vhd