Reputation: 3171
I did not find any documentation for how to copy vhd on azure using python api, can anyone help me... also i have tried to create instance from image on the vmdepot community but when i run the following command i got this error:
$ azure vm create instanceahmed -o vmdepot-14776-1-1 -l "West US" ahmed P@ssw0rd --ssh 22 --verbose
......
verbose: Creating VM
verbose: Deleting image
info: VM image deleted: vmdepot-14776-1-1-c5febcb3
verbose: Uri : http://portalvhdsf4048vkh9c007.blob.core.windows.net/vm-images/community- 23970-525c8c75-8901-4870-a937-7277414a6eaa-1.vhd
info: Blob deleted: http://portalvhdsf4048vkh9c007.blob.core.windows.net/vm- images/community-23970-525c8c75-8901-4870-a937-7277414a6eaa-1.vhd
info: vm create command OK
Upvotes: 0
Views: 852
Reputation: 3171
I tried to do what "-o" do with Azure with these steps:
Get the URL of your image on the community:
http://vmdepoteastus.blob.core.windows.net/linux-community-store/community-23970-525c8c75-8901-4870-a937-7277414a6eaa-1.vhd
Create a new affinity group if you have one skip this point:
$ azure account affinity-group create mystoragegroup --location "West US"
Create a new storage account if you have an account skip this point:
$ azure storage account create mystorageazure --affinity-group mystoragegroup
Get the Primary secret key of new storage account using this command:
$ azure account storage keys list mystorageazure
output:
data: Primary: Your SECRET STORAGE KEY
Create new account storage inside this storage account:
$ azure storage container create --permission Blob -a mystorageazure -k Your SECRET STORAGE KEY mycontainerazure
Upload your image to the your account storage container:
$ azure vm disk upload --verbose http://vmdepoteastus.blob.core.windows.net/linux-community-store/community-23970-525c8c75-8901-4870-a937-7277414a6eaa-1.vhd http://mystorageazure.blob.core.windows.net/mycontainerazure/elastichpcvm.vhd Your SECRET STORAGE KEY
Create your local image:
$ azure vm image create mystorageimage --location "West US" --blob-url http://mystorageazure.blob.core.windows.net/mycontainerazure/elastichpcvm.vhd --os linux
Create your virtual machine using your local image:
$ azure vm create mystoragemachine mystorageimage ahmed P@ssw0rd --location "West US" --ssh 22
Upvotes: 2
Reputation: 411
This seems to me like the cli issue. Can you please tell us
Upvotes: -1