-2

I am starting to think that i'm really stupid. Trying since 2 hours to create a vm from the section my discs with powershell. Everywhere in the internet i find information about creating a vm from existing vm images, but not from the my disks section. I mean this one:

My Disks in Management Portal

How can i achieve this by the powershell? I tried the following script, however i keep getting this error message and google seems useless, since there are tons of links relating how to create a vm image or how to upload it but not how to create a vm from an existing uploaded disk, nothing else.

My script i tried:

New-AzureVMConfig -Name "kentico1" -InstanceSize Medium -VMImageName "kenticovm-kenticovm-0-201408210905260518" -MediaLocation "https://rivirtualmachines.blob.core.windows.net/vhds/kenticovm-kenticovm-2014-08-21.vhd" | Add-AzureProvisioningConfig -Windows -AdminUsername adminuser -Password "asldfj9283lj" | New-AzureVM -ServiceName "kentico" -ReservedIPName CMSIP -Location "West Europe"

And i keep getting this error

New-AzureVM : BadRequest: OSImage kenticovm-kenticovm-0-201408210905260518.vhd not found. If you are using a VM image, it must be specified as VMImageName for the role, not as SourceImageName for OSVirtualHardDisk.

Can anybody help me? Thank you in advance best laurin

LaurinSt
  • 952
  • 11
  • 25

1 Answers1

0

Okey i figured it out:

New-AzureVMConfig -Name "kentico1" -InstanceSize Medium -DiskName "kenticovm-kenticovm-0-201408210905260518" | Add-AzureEndpoint -Name "HTTP" -Protocol "tcp" -PublicPort 80 -LocalPort 80 | New-AzureVM -ServiceName "kentico" -ReservedIPName CMSIP -Location "West Europe"
LaurinSt
  • 952
  • 11
  • 25