使用现有 VHD 在 Azure 上创建 VM

使用现有 VHD 在 Azure 上创建 VM

我正在尝试从现有的 VHD 文件在 MS Azure 平台上创建虚拟机。当我尝试时,我收到以下错误。是否有任何参数可以指定 NIC?在网上进行了一些研究,但没有合适的结果。

PS C:\Users\Rav> azure vm create --os-disk-vhd https://group11492.blob.core.windows.net/vhds/Integration201641775831.vhd

info:    Executing command vm create
    Resource group name: Default-Storage-WestUS
    Virtual machine name: integration201641775831v
    Location name: West US
    Operating system Type: Linux
    + Looking up the VM "integration201641775831v"
    info:    Using the VM Size "Standard_DS1"
    error:   Either NIC Id or NIC name is required
    info:    Error information has been recorded to C:\Users\Rav\.azure\azure.err
    error:   vm create command failed

答案1

是的,

...

-I, --nic-ids <nic-ids>             the list of NIC identifiers separated by comma. 
                                    In case of specifying multiple nics first one
                                    will be set as primary.
-N, --nic-names <nic-names>         the list of NIC names separated by comma. 
                                    In case of specifying multiple nics first 
                                    one will be set as primary.These NICs must 
                                    exists in the same resource group as the VM. 
                                    Please use nic-ids if that not the case. 
                                    This parameter will be ignored if --nic-ids 
                                    is specified

...

如果您没有看到这些参数,您可能需要更新您的 azure cli。

相关内容