Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count on azure_data_disk #7321

Closed
i-am-logger opened this issue Jun 24, 2016 · 10 comments
Closed

count on azure_data_disk #7321

i-am-logger opened this issue Jun 24, 2016 · 10 comments

Comments

@i-am-logger
Copy link

Hi,

would appreciate adding support for creating an array of data disks on azure.

https://www.terraform.io/docs/providers/azure/r/data_disk.html

@stack72
Copy link
Contributor

stack72 commented Jun 27, 2016

Hi @isamuelson

I am looking into this now - give me a little bit of time to investigate

Thanks

Paul

@i-am-logger
Copy link
Author

@stack72 thanks!

stack72 added a commit that referenced this issue Jun 28, 2016
Fixes #7321

When testing to see how many data_disks could be added to a machine, I
got the following response from the Azure RM API

```
{
	"error": {
		"code": "OperationNotAllowed",
		"target": "dataDisks",
		"message": "The maximum number of data disks allowed to be attached to a VM is 1."
	}
}
```

We should ensure the schema copes with this so as to avoid waiting on the creation to throw the error
@stack72
Copy link
Contributor

stack72 commented Jun 28, 2016

Hi @isamuelson

So when looking at this, it isn't actually possible to specify more than 1 data_disk on a VM in Azure. The API returns this error:

{
    "error": {
        "code": "OperationNotAllowed",
        "target": "dataDisks",
        "message": "The maximum number of data disks allowed to be attached to a VM is 1."
    }
}

I have submitted a PR that will only allow 1 data_disk to be specified going forward to keep with the API restraints

Paul

@i-am-logger
Copy link
Author

His is bizarre....

According to docs DS2 can have 4 data disks...we actually have that
working...

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/

On Tuesday, June 28, 2016, Paul Stack notifications@github.com wrote:

Hi @isamuelson https://github.com/isamuelson

So when looking at this, it isn't actually possible to specify more than 1
data_disk on a VM in Azure. The API returns this error:

{
"error": {
"code": "OperationNotAllowed",
"target": "dataDisks",
"message": "The maximum number of data disks allowed to be attached to a VM is 1."
}
}

I have submitted a PR that will only allow 1 data_disk to be specified
going forward to keep with the API restraints

Paul


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7321 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABX8VP0kLvmsdZBp77gosuEwsuUsnEblks5qQROQgaJpZM4I-FYD
.

Ido Samuelson

Phone (US): +1-415-562-8582

Email: ido.samuelson@gmail.com
LinkedIn: http://www.linkedin.com/in/isamuelson

Skype: ido_samuelson

@stack72
Copy link
Contributor

stack72 commented Jun 28, 2016

Checking a DS2 machine now to see... 2 mins

@stack72
Copy link
Contributor

stack72 commented Jun 28, 2016

@isamuelson apologies for the false alarm here - this was because of the machine type I was using :)

@stack72
Copy link
Contributor

stack72 commented Jun 28, 2016

ok, so there are different things happening here:

  1. The link you gave in the original issue was a link to the Azure Service Manager Data_disk resource. Azure Resource Manager has no such idea.
  2. To use data disks in ARM, you need to specify something like this:
storage_data_disk {
        name                    = "mydatadisk1"
        vhd_uri       = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk1.vhd"
    disk_size_gb  = "1023"
    create_option = "Empty"
    lun                     = 0
  }
  1. You can specify multiple config blocks to add multiple data disks:
storage_data_disk {
        name                    = "mydatadisk2"
        vhd_uri       = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk2.vhd"
    disk_size_gb  = "1023"
    create_option = "empty"
    lun                     = 0
  }

  storage_data_disk {
        name                    = "mydatadisk3"
        vhd_uri       = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk3.vhd"
    disk_size_gb  = "1023"
    create_option = "empty"
    lun                     = 0
  }

  storage_data_disk {
        name                    = "mydatadisk4"
        vhd_uri       = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk4.vhd"
    disk_size_gb  = "1023"
    create_option = "empty"
    lun                     = 0
  }

All within the same VM

Hope this helps?

Paul

@i-am-logger
Copy link
Author

i-am-logger commented Jun 28, 2016

yes I know that....though this issue/request is to support count

storage_data_disk {
count = 4
name = "mydatadisk${count.index)"
vhd_uri = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/mydatadisk$(cound.index).vhd"
disk_size_gb = "1023"
create_option = "empty"
lun = 0
}

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2016

@isamuelson this has been requested as a general addition to the schema in #7034

I am going to close this request and then let the tracking for the schema change happen there

Paul

@stack72 stack72 closed this as completed Jun 29, 2016
@ghost
Copy link

ghost commented Apr 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants