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

VPC Feature Request: Implement creation of dataVolumes in the instance create routine #881

Closed
dprosper opened this issue Nov 14, 2019 · 5 comments
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure

Comments

@dprosper
Copy link
Contributor

The ibmcloud CLI to create a virtual server instance in VPC allows you to create the data volume during the create instance.

$ ibmcloud is instance-create --help
NAME:
    instance-create, inc - Create a server instance

USAGE:
    C:\Program Files\IBM\Cloud\bin\ibmcloud.exe is instance-create INSTANCE_NAME VPC ZONE_NAME PROFILE_NAME SUBNET --image-id IMAGE_ID [--boot-volume BOOT_VOLUME_JSON | @BOOT_VOLUME_JSON_FILE] [--volume-attach VOLUME_ATTACH_JSON | @VOLUME_ATTACH_JSON_FILE] [--key-ids IDS] [--user-data DATA] [--network-interface NETWORK_INTERFACE_JSON | @NETWORK_INTERFACE_JSON_FILE] [--security-group-ids SECURITY_GROUP_IDS] [--resource-group-id RESOURCE_GROUP_ID | --resource-group-name RESOURCE_GROUP_NAME] [--json]
    INSTANCE_NAME: Name of the instance.
    VPC:           ID of the vpc.
    ZONE_NAME:     Name of the zone.
    PROFILE_NAME:  Name of the profile.
    SUBNET:        ID of the subnet.

OPTIONS:
   --boot-volume value          BOOT_VOLUME_JSON|@BOOT_VOLUME_JSON_FILE, boot volume attachment in json or json file
   --volume-attach value        VOLUME_ATTACH_JSON|@VOLUME_ATTACH_JSON_FILE, volume attachment in json or json file
   --image-id value             ID of the image.
   --security-group-ids value   Comma separated security group IDs for primary network interface.
   --key-ids value              Comma separated IDs of SSH keys.
   --user-data value            data|@data-file. User data to transfer to the server instance
   --network-interface value    NETWORK_INTERFACE_JSON|@NETWORK_INTERFACE_JSON_FILE, network interface attachment in json or json file
   --resource-group-id value    ID of the resource group. This option is mutually exclusive with --resource-group-name
   --resource-group-name value  Name of the resource group. This option is mutually exclusive with --resource-group-id
   --json                       Format output in JSON

The IBM Terraform provider does it in three (3) steps:

  1. Create the volume
  2. Create the instance
  3. Attach the volume to the instance.

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

@kavya498 kavya498 added the service/VPC Infrastructure Issues related to the VPC Infrastructure label Mar 31, 2021
@uibm
Copy link
Collaborator

uibm commented Aug 18, 2021

As per #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
 }

@dprosper
Copy link
Contributor Author

@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?

@uibm
Copy link
Collaborator

uibm commented Aug 18, 2021

@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:

  1. Create an instance (with/without existing volumes)
  2. Create a volume attachment on that resource (new/existing volumes)

@dprosper
Copy link
Contributor Author

ok so I guess this can be close as can-t-fix. thx

@kavya498
Copy link
Collaborator

Closing this issue..
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants