-
Notifications
You must be signed in to change notification settings - Fork 34
how to connect a vdi to a vm? #34
Comments
To add the VDI to a VM you would do something like:
In the VM resource block where To mount it within the VM you would have to do some provisioning after Terraform, for example with Ansible. |
I added this, but the VDI is not attached to the VM, here is what my tf file looks like (note that the template has the OS hard drive attached to it):
|
Further investigation is indicating that no VBD is being created, hence the VDI is not attached to the VM. Any help would be appreciated |
Bug seems to be here: This condition is always passing for my VDI. I was able to workaround this by changing it to:
And not setting user_device. No idea if this is the right fix, but thought I would post it here |
Removing I actually already opened a pull request to fix it: #33. Forgot about it when replying previously though. |
Nice - hopefully we can that merged soon. Do you have any documentation about the purpose of user_device? I am new to xen/terraform so not sure what this is suppose to do. Thanks |
My understanding is that it's just a number (0 to 7) identifying the virtual device on a VM. In this Terraform provider it's only used to specify existing devices from a template. So when you have multiple devices in a template you can select them by the userdevice number. See also http://xapi-project.github.io/xen-api/classes/vbd.html. |
OK - I am not clear what it actually does though? Is the user_device a number I assign to items or does it need to match the way the VM is actually configured? Its purpose and use it still unclear to me - if there is no reason for it, perhaps we should get rid of it? |
I am new to terraform and xen server so forgive me if this is a noob question. I would like to use terraform and xen server to create a new VM with two separate disks - one for the OS/Application and one for the application data. My VM template already has the OS disk connected to it so I think I have that covered. I am also able to create a VDI using xenserver_vdi, but I don't know how to attach that VDI to the VM and mount it say /data. Any ideas how to do this?
The text was updated successfully, but these errors were encountered: