Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

export a vm, remove it and then importing it again fails with the azure cli (azure vm create-from) #254

Closed
woloski opened this issue Jun 29, 2012 · 2 comments
Milestone

Comments

@woloski
Copy link

woloski commented Jun 29, 2012

These are the commands I am running to export the definition of the VM, then deleting the VM and after that creating it again from the definition. I want to do this because otherwise I get charged for a VM even if it's shutdown, so I want an automated way to bring it back fast with the original VHD.

$ azure vm show --json myvm > myvm.json
...
$ azure vm delete sp-auth10
...
$ azure vm create-from myvm myvm.json
info:   Executing command vm create-from
+ Looking up cloud service                                                     
+ Getting cloud service properties                                             
+ Looking up deployment                                                        
+ Creating VM                                                                  
error:  Required argument VMRole.RoleName for function createDeployment is not defined

This is the content of the json file generated by azure vm show

{
  "DNSName": "myvm.cloudapp.net",
  "VMName": "myvm",
  "IPAddress": "10.74.76.4",
  "InstanceStatus": "ReadyRole",
  "InstanceSize": "Small",
  "InstanceStateDetails": {},
  "OSVersion": {},
  "Image": "MSFT__Win2K8R2SP1-120514-1520-141205-01-en-us-30GB.vhd",
  "DataDisks": [""],
  "Network": {
    "Endpoints": [
      {
        "LocalPort": "3389",
        "Name": "RemoteDesktop",
        "Port": "50977",
        "Protocol": "tcp",
        "Vip": "168.62.162.73"
      }
    ]
  }
}

Any workaround appreciated

Thanks
Matias

@markcowl
Copy link
Member

markcowl commented Oct 4, 2012

@glennblock: figure out triage for these issues

@ghost ghost assigned glennblock Oct 4, 2012
@glennblock
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants