vagrant-azure
vagrant-azure copied to clipboard
Problems with datadisk from image
Hi,
When I try to specify a source blob for a dataDisk I get the following error response body from the vm deploy.
"body": "{\"status\":\"Failed\",\"error\":{\"code\":\"DeploymentFailed\",\"m
essage\":\"At least one resource deployment operation failed. Please list deploy
ment operations for details. Please see https://aka.ms/arm-debug for usage detai
ls.\",\"details\":[{\"code\":\"BadRequest\",\"message\":\"{\\r\\n \\\"error\\\"
: {\\r\\n \\\"code\\\": \\\"InvalidParameter\\\",\\r\\n \\\"target\\\": \\
\"dataDisk.image\\\",\\r\\n \\\"message\\\": \\\"Parameter 'dataDisk.image' i
s not allowed.\\\"\\r\\n }\\r\\n}\"}]}}",
So it appears the API is not liking the dataDisk.image parameter.
Vagrantfile Used:
Vagrant.configure('2') do |config|
config.vm.box = 'azure'
# use local ssh key to connect to remote vagrant box
config.vm.provider :azure do |azure, override|
# each of the below values will default to use the env vars named as below if not specified explicitly
override.ssh.private_key_path = ENV['HOME'] + "/id_azure"
azure.tenant_id = ENV['AZURE_TENANT_ID']
azure.client_id = ENV['AZURE_CLIENT_ID']
azure.client_secret = ENV['AZURE_CLIENT_SECRET']
azure.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
azure.vm_image_urn = 'OpenLogic:CentOS:7.3:latest'
azure.data_disks = [
{ name: "adisk", image_uri: 'https://blah.blob.core.windows.net/blobcontainer1/adisk.vhd'}
]
end
end
If I just specify a size_gb: and no image I get an empty data disk as expected.
Ideally I would like to specify a size_gb and also an image in a page blob (or from a snapshot). The desired behavior would be to build the datadisk from the blob with the data at the front of the disk, and then extend the disk before attaching if required. The above desired steps work if I complete them manually in the portal, or with the az cli 2.0
Do you accept pull requests? I don't mind taking a fork trying to sort this myself