Recommendation

It is strongly recommended that you visit the pages in Examples of Terraform for Jetstream2 in order

It is often desirable to create a separate storage volume in your Jetstream2 project and then attach it to one of the instances in your deployment. In this exercise, you will create a new Terraform (.tf) file in your configuration to do just that. The file must contain two simple Resource blocks, an openstack_blockstorage_volume_v2 block to specify a new 10 GB volume named "terratest" and an openstack_compute_volume_attach_v2 block to attach it to the "leader" instance (the second link contains a concise example of what is needed).

When your .tf file is ready, re-apply your Terraform configuration to create and attach the volume to the existing instance. Then use the Horizon web interface to confirm that the instance was created and to look at the volume's details. It should state that the volume is attached to the index with some device ID, such as /dev/sdb. Record this information. Now log in to your instance using SSH and issue the command ls /dev and look for the volume's device in the output. Seeing the device confirms that it has been attached to the instance.

A later exercise will ask you to initialize this volume using a Terraform provisioner.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement