【问题标题】:Getting error while creating VM in Azure using powershell command使用 powershell 命令在 Azure 中创建 VM 时出错
【发布时间】:2014-11-13 08:35:54
【问题描述】:

我正在尝试使用 powershell 命令在 Azure 上创建 Windows 7 VM

$dclocation = 'East Asia'
$cloudSvcName = 'MyNewCloudServiceName' 
$image = '03f55de797f546a1b29d1b8d66be687a__Windows-7-Enterprise-x64-en.us-201407.01'
$adminPassword = 'Admin@123' 
$vmname = 'MyVMName' 
New-AzureQuickVM -Windows -ServiceName $cloudSvcName -Name $vmname -ImageName $image -Location $dclocation -InstanceSize 'Basic_A0' 

在运行上述代码时出现错误:

New-AzureQuickVM : BadRequest: A ProvisioningConfigurationSet was not found in the ConfigurationSet collection of the virtual machine with name MyVMName. When creating a virtual machine from an image, ProvisioningConfigurationSet must be specified.
At line:4 char:1
+ New-AzureQuickVM -Windows -ServiceName $cloudSvcName -Name $vmname -ImageName $i ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureQuickVM], CloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.NewQuickVM

在此先感谢..

【问题讨论】:

    标签: powershell azure virtual-machine


    【解决方案1】:

    您还需要传入-AdminUsername-Password 的值,例如

    New-AzureQuickVM -Windows `
        -ServiceName $cloudSvcName `
        -Name $vmname `
        -ImageName $image `
        -Location $dclocation `
        -InstanceSize 'Basic_A0' `
        -AdminUsername $adminUsername `
        -Password $adminPassword
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-12
      • 2012-08-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多