azure-xplat-cli icon indicating copy to clipboard operation
azure-xplat-cli copied to clipboard

ARM: 'azure vm create' promps only for some required arguments

Open ahmetb opened this issue 9 years ago • 11 comments

If I just run azure vm create it only prompts for certain required fields, not all...

This makes all the prompt strings I typed earlier useless...

➜  ~  azure vm create
info:    Executing command vm create
Resource group name: ahmetb-docker1.9
Virtual machine name: vm
Location name: westus
Operating system Type: linux

+ Looking up the VM "vm"
error:   image-urn or os-disk-vhd parameter is required to create a VM
info:    Error information has been recorded to /Users/alp/.azure/azure.err
error:   vm create command failed

Need consistency here.

ahmetb avatar Nov 03 '15 22:11 ahmetb

So if I specify --image-urn, then it keeps prompting me for:

Enter username: azureuser
Enter password for azureuser: **********
Confirm password: **********

but shortly after I get:

info:    Using the VM Size "Standard_A1"
info:    The [OS, Data] Disk or image configuration requires storage account
+ Retrieving storage accounts
info:    Could not find any storage accounts in the region "westus", trying to create new one
+ Creating storage account "clieb3c2f4ea488ddb614465" in "westus"
+ Looking up the storage account clieb3c2f4ea488ddb614465
error:   Either NIC Id or NIC name is required
info:    Error information has been recorded to /Users/alp/.azure/azure.err
error:   vm docker create command failed

whoops. All gone again.

ahmetb avatar Nov 03 '15 22:11 ahmetb

@amarzavery - we'll need to prompt for all the mandatory parameters from the very beginning. Can you please take a look?

eduardkoller avatar Apr 02 '16 00:04 eduardkoller

@huangpf - Can you take a look at the command definition and find out the root cause for this issue?

amarzavery avatar Apr 02 '16 00:04 amarzavery

Add @sauryadas to triage.

huangpf avatar Apr 02 '16 00:04 huangpf

Still a valid issue. Also, nice to have...

ahmetb avatar Jun 29 '16 06:06 ahmetb

👍 - seems that the storage account is created auto now, but NIC still is issue:

2016-12-07_144458

jochenvw avatar Dec 07 '16 13:12 jochenvw

@jochenvw - Did you solve your NIC issue ? I'm facing the same issue. How did you pass NIC info to azure vm create command ? Thanks in advance.

pdhandap avatar Dec 19 '16 21:12 pdhandap

@pdhandap Yup - that's what I did indeed. You can work around this issue - it's just not that convenient.

jochenvw avatar Dec 20 '16 07:12 jochenvw

@jochenvw Would you be able to tell us how you did it exactly? I'm having the same issue as you did and @pdhandap, and would appreciate the help. What way do you pass the NIC info to the command?

mckconor avatar Feb 16 '17 16:02 mckconor

+1 "What way do you pass the NIC info to the command?"

ict4ngo avatar Feb 26 '17 12:02 ict4ngo

Long story short, documentation is not up to date and commands have different parameters across PowerShell/CLI/CLI in azure portal. To fix that NIC problem, you need to create a virtual network and network interface in the same resource group. Then you can pass the NIC name as an extra paramater to CLI command for example as below

azure vm create --name vmName --resource-group resourceGroupName --os-disk-vhd https://storage.blob.core.windows.net/vhds/some-disk.vhd --location "Australia East" --os-type Windows --nic-name someExistingNicName

You can use azure help vm create for latest documentation of the command needed.

ylashin avatar Jun 04 '17 05:06 ylashin