Closed dprosper closed 3 years ago
As per https://github.com/IBM-Cloud/terraform-provider-ibm/pull/2672
We are supporting volume attachments as a separate resource(which supports both creation of a new volume, attaching existing volumes), keeping the existing feature which supports attaching an existing volume.
resource "ibm_is_instance_volume_attachment" "att1" {
instance = ibm_is_instance.instance5.id
volume = ibm_is_volume.vol5.id
name = "vol-att-1"
delete_volume_on_attachment_delete = false
delete_volume_on_instance_delete = false
}
@ujjwal-ibm This is not clear to me, does this mean now I can do what I requested, i.e. create an instance AND a volume just like the CLI?
@dprosper no. We had some limitation wrt terraform and the backend sdk, so we couldn't support it the way cli does.
As per the new support:
ok so I guess this can be close as can-t-fix. thx
Closing this issue.. Thanks
The ibmcloud CLI to create a virtual server instance in VPC allows you to create the data volume during the create instance.
The IBM Terraform provider does it in three (3) steps:
Issue #871 uncovered a problem that happens when multiple VSIs are getting created at the same time and the attach volume is happening when the VSI is not in a running state.
Although this can be fixed by confirming the VSI is running, this is not an ideal situation as this might still cause problems when cloud-init is added to the picture.
Ideally, the Terraform process should match the ibmcloud CLI process and allow the creation of the dataVolumes to occur during the VSI creation process (i.e. a single step as opposed to the 3 step process above). The RIAS API support this:
https://cloud.ibm.com/apidocs/vpc-on-classic#create-an-instance