azure - How can I create a new VM from captured image (snapshot)? -


i captured vm image , tried create new vm captured image. got error. (linux, using azure cli)

$ azure vm generalize [resource group] [vm name] $ azure vm capture [resource group] [vm name]  info:    vm capture command ok  $ azure vm create \       --image-urn [osdisk:image url] \       --resource-group [resource group] \       --name [new vm name] \       --storage-account-name xyz \       --location xxx \       --os-type linux \       --admin-username xxx \       --admin-password xxx \       --nic-names xxx \       --vm-size xxx  [storage account name] not valid storage account name. storage account name must between 3 , 24 characters in length , use numbers , lower-case letters only. 

i have 2 questions:

(1) how can avoid error. don't think set storage account name. set xyz error showed name.

(2) got 2 vm images link after vm capture: osdisk:image , osdisk:vhd. 1 should use when create new vm?

resources: [       {       apiversion: '2016-03-30',       properties: {       storageprofile: {       osdisk: {         image: { uri: 'https://xxx.vhd' },         vhd: { uri: 'https://xxx.vhd' },       caching: 'readwrite' 

ad1. storage name can consist of lower case letters, try xyz.

ad2. osdisk.image path image want deploy vm, while osdisk.vhd path newly created machine's disk.


Comments