0

I'm trying to attach an existing VHD disk from a Storage Account to VM during Azure Resource manager provisioning with a template.

My dataDisk resource is:

  "dataDisks": [
    {
      "name": "jmdisk",
      "diskSizeGB": "100",
      "lun": 0,
      "vhd": {
        "uri": "https://jmje.blob.core.windows.net/vhds/jenkinshome.vhd"
      },
      "createOption": "attach"
    }
  ]

But during deploy - I have an error from Azure:

STATUSMESSAGE{
  "error": {
    "code": "OperationNotAllowed",
    "target": "dataDisk",
    "message": "Addition of a blob based disk to VM with managed disks is not supported."
  }
}

Unfortunately can't google anything related, i.e. - a correct way to attach an existing disk.

UPD Solved this by just creating new Managed disk and copy data there.

setevoy
  • 3,637
  • 7
  • 41
  • 76

2 Answers2

1

You can create a managed disk from an existing blob -- you can see a sample of that here: https://github.com/chagarw/MDPP/blob/master/101-create-image-availabilityset-2vm-from-blob/azuredeploy.json

It uses existing blobs for both OS and data, you don't have to do it that way... In your case it sounds like you want an implicit OS disk and then an explicit data disk? Which you could also do, just use different images for each.

bmoore-msft
  • 6,629
  • 16
  • 20
  • Yup, thanks, I already solved this by just creating new Managed disk and copy data there. Will update Q. – setevoy Feb 27 '17 at 20:50
0

Well, the error gives it up, you are probably not familiar with Managed Disks yet. So you are creating a VM with OS disk as managed, in that case you cannot use existing disks to attach to a VM, just create a VM with regular disk (just like you do with data disk).

4c74356b41
  • 59,484
  • 5
  • 63
  • 109
  • Thanks. Yes, I noticed managed vs nonmanaged disks now. But idea is - attach VHD from Storage, wich contains Jenkin's data. Trying to figure it out here: https://azure.microsoft.com/en-us/blog/azure-cli-managed-disks/ – setevoy Feb 24 '17 at 12:37
  • well, you have to specify an EXISTING managed disk in that case – 4c74356b41 Feb 24 '17 at 14:03