azure-xplat-cli
azure-xplat-cli copied to clipboard
How to create classic vm from existing OS image using cli
I've got blob from linux vm. I've uploaded it in my subscription and created OS disk. Now I'd like to create vm using this disk as OS disk.
azure vm disk create --os linux --blob-url http://xxxx.blob.core.windows.net/vhds/xxxx-os-4334.vhd xxxx-os-4334
How can I do it?
In new azure portal it's quite easy:
- Go to "OS disks (classic)"
- Select my disk, xxxx-os-4334
- Select "+ Create VM"
- Just enter new host name and select tier. No useres and passwords (they are already existing in this disk)
How can I repeat this steps using CLI?
The best thing I've found is to create image from my blob and then create new VM from this image. But in that case I've to enter username/password and VM is not starting.
Regards, Andrey
the CLI is in two modes ARM (new) and ASM (classic). azure config mode asm. azure vm create -h should do the job for you. If not then azure vm -h can show you other available options in ASM.
/cc @huangpf
I'm using ASM mode.
azure vm create always wants image (not os disk) and asks for user and password.
So if I executed azure vm disk create
, then command azure vm create
can't find my image.
error: Image "xxxx-os-4334" not found
If I execute azure vm image create --blob-url http://xxxx.blob.core.windows.net/vhds/xxxx-os-4334.vhd --os linux xxxx
and then do azure vm create
it's asking for userName and Password.
Even if I use --blob-url azure vm create
is asking for:
error: --userName is required when
So I'm a bit confused, how it's being done on portal?
Regards, Andrey
@huangpf - Can you take a look into this?
Any news on this thread? There is no way to create a VM from a specialized disk via CLI