Instance Setup and Tutorial¶
Instances are the basic unit of compute on cloud.rc. Requesting an instance involves a number of steps, and requires that a Network has already been setup, along with certain Security settings and features. It is also possible to attach persistent reusable Volumes to instances.
Important
If you are viewing this page as part of the cloud.rc tutorial, please follow the steps in order from top to bottom. Ignore any sections on deleting or releasing resources unless you need to correct a mistake.
Note
Virtual machines are disposable! If you get stuck at any point, or things don't seem like they're working as expected, etc., feel free to delete the instance and start over.
Creating an Instance¶
Creating an instance is possibly a step you'll perform often, depending on your workflow. There are many smaller steps to create an instance, so please take care to check all the fields when you create an instance.
These instructions require that you've set up a Network and followed all of the instructions on the linked page. You should have a Network, Subnet, Router and Floating IP. You will also need to setup a Key Pair and an SSH Security Group.
-
Click "Compute" in the left-hand navigation pane to open the fold-out menu.
-
Click "Instances".
-
Click "Launch Instance" to open a dialog box.
-
Fill out the dialog box completely. There are several tabs that will need to be completed.
Details Tab¶
- Enter an "Instance Name". See Naming Conventions.
- Enter a "Description".
- Select "nova" in the "Availability Zone" drop down box.
- Select "1" in the "Count" field.
- Click "Next >" to move to the "Source" tab.
Source Tab¶
Sources determine what operating system or pre-defined image will be used as the starting point for your operating system (OS).
- Select "Image" in the "Select Boot Source" drop down box.
- Select "Yes" under "Create New Volume".
- Choose an appropriate "Volume Size" in
GB
. Note that for many single-use instances,20 GB
is more than enough. If you need more because you have persistent data, please create apersistent volume<volume_setup_basic>
. -
Select "Yes" or "No" under "Delete Volume on Instance Delete"
- "Yes" is a good choice if you don't care about reusing the OS.
- "No" is a good choice if the OS volume will be reused.
-
Pick an image from the list under the "Available" section.
- Use the search box to help find the image that best suits your research needs.
- When you find the best image, click the button with an up arrow next to the image.
- The image will move to the "Allocated" section above the "Available" section.
-
Click "Next >" to move to the "Flavor" tab.
Flavor Tab¶
Flavors determine what hardware will be available to your instance, including cpus, memory and gpus.
-
Pick an instance flavor form the list under the "Available" section.
- Use the search box to help find the flavor that best suits your needs.
- When you find the best flavor, click the button with an up arrow next to the flavor.
- The flavor will move to the "Allocated" section above the "Available" section.
-
Click "Next >" to move to the "Networks" tab.
Networks Tab¶
Networks determine how your instance will talk to the internet and other instances. If you are following along with the tutorial, you should already have a Network set up. See Network for more information.
-
Pick a network from the list under the "Available' section.
- A Network may already be picked in the "Allocated" section. If this is not the correct Network, use the down arrow next to it to remove it from the "Allocated" section. If the Network is correct, skip (ii.) through (iv.).
- Use the search box to help find the Network that best suits your needs.
- When you find the best Network, click the button with an up arrow next to the Network.
- The Network will move to the "Allocated" section above the "available" section.
-
Click "Next >" to move to the "Network Ports" tab.
Network Ports Tab¶
Security Groups Tab¶
Security Groups allow for fine-grained control over external access to your instance. If you are following along with the tutorial, you should already have an "ssh" Security Group set up. For more information see Creating a Security Group for more information.
- Pick the "ssh" Security Group from the "Available" section by pressing the up arrow next to it.
-
The "default" Security Group should already be in the "Allocated" section.
-
Click "Next >" to move to the "Key Pair" tab.
Key Pair Tab¶
Key Pairs allow individual access rights to the instance via SSH. If you are following along with the tutorial, you should already have a key pair set up. For more information see Creating a Key Pair.
-
Pick one or more key pairs from the list under the "Available" section.
- A Key Pair may already be picked in the "Allocated" section. If this is not the correct "Key Pair", use the down arrow next to it to remove it form the "Allocated" section. If the Key Pair is correct, skip (ii.) through (iv.).
- Use the search box to help find the Key Pair that best suits your needs.
- When you find the best Key Pair(s), click the button with an up arrow next to the Key Pair(s).
- The Key Pair(s) will move to the "Allocated" section above the "Available" section.
-
Click "Next >" to move to the "Configuration" tab.
Configuration Tab¶
- Skip this tab.
- Click "Next >" to move to the "Server Groups" tab.
Server Groups Tab¶
- Skip this tab.
- Click "Next >" to move to the "Scheduler Hints" tab.
Scheduler Hints Tab¶
- Skip this tab.
- Click "Next >" to move to the "Metadata" tab.
Metadata Tab¶
- Skip this tab.
Launching the Instance¶
Click "Launch Instance" to launch the instance.
- Redirects to the "Instances" page.
- There should be a new entry in the table.
-
The instance will take some time to build and boot. When the Status column entry says "Active" please move to the next steps.
Associate a Floating IP¶
If you are following along with the tutorial, you should already have a floating IP set up.
- In the "Actions" column entry, click the drop down triangle and select "Associate Floating IP".
- A dialog box will open.
- Select an IP address in the "IP Address" drop down box.
- Select a port in the "Port to be associated" drop down box.
-
Click "Associate" to return to the "Instances" page and associate the selected IP.
Instances Failing to Start¶
There are a number of reasons an instance might fail. We are able to provide direct support for instances which fail to start for reasons outside the instance itself. To help us correct the error, you'll need to have information from the instance page. Below is an example of a failed instance in the "Instances" table, helpfully named failed_instance
. Note the "Error" label under the "Status" column.
In the "Instances" table, click the name of your failed instance. You should see a page like below, with some basic metadata about the instance as well as a "Fault" section.
We will need to "ID" and the reason for the fault. In this case, the instance failed because it could not allocate a GPU, as all GPUs were allocated at the time of its creation. It is not possible to diagnose the specifics without consulting us, so please feel free to contact Support.
Instances can fail for other reasons as well, please contact Support with the "ID" and "Fault" information.
For instances which fail due to internal reasons, i.e. while using SSH or an application, we are still able to provide support but it will have to be on a case-by-case basis. Be prepared to walk us through the steps you took to set up the instance and any software, as well as any data processing steps, leading up to the failure.
SSH Into the Instance¶
If you are following the tutorial, then at this stage you should be able to SSH into your instance from the UAB Campus Network or on the UAB Campus VPN. You will need to Install an SSH Client Once your machine has an ssh client, use the following command. If your image uses an operating system other than Ubuntu, such as CentOS, replace the user ubuntu
with centos
or whatever is appropriate. The value <floating ip>
should be whatever IP was assigned in Creating a Floating IP, and the value <private_key_file>
should be whatever your key pair file was named from Creating a Key Pair.
- Install an SSH Client to use SSH from your local machine to your cloud instance.
- Manage Your Private Key
- Start the SSH Agent to enable your system to remember your private key.
- Add a Private Key to the ssh agent to remember it for future use.
-
Verify the SSH Client Works. Use the following command to connect
- If your image uses an operating system other than Ubuntu, such as CentOS, replace the user
ubuntu
withcentos
, or whatever may be appropriate. - The value
<floating ip>
should be whatever IP was assigned in Creating a Floating IP. - The value
<private_key_file>
should be whatever your key pair file was named from Creating a Key Pair.
- If your image uses an operating system other than Ubuntu, such as CentOS, replace the user
-
(optional, but helpful) Set Up a Configuration File to simplify the command used to make a connection.
Note
Reusing a floating IP for a new instance can result in a "Remote Host Identification Has Changed" error, preventing connection. Please see Remove an Invalid Host Fingerprint.
Streamlining SSH¶
Refer to Setting up a Configuration File in Cloud Remote Access.
Next Steps¶
Now you are ready to Install Software, set up Security Groups for Servers, and optionally Create a Persistent Volume.
Deleting an Instance¶
Note
Deleting Instances is not part of the tutorial, and is here as a reference.
To delete an instance, return to the "Instances" page using the left-hand navigation pane. In the table, find the row with the instance you wish to delete, and click the drop-down arrow under "Actions" in that row. Then click "Delete Instance" to open a confirmation dialog.
Click "Delete Instance" again to delete the instance permanently.
Warning
It is highly recommended to shut off an instance before deleting it.
Help my Instance is Stuck or not Working¶
If your instance is stuck or otherwise not working as expected, first try deleting it and starting over. If you are unable to delete it or it gets stuck while deleting, please contact Support and copy the the instance ID as shown below.
Where is my Instance ID?¶
To find your instance ID, navigate to the "Instances" table. Click the "Instance Name" for the instance you are interested in to load an information page for that instance.
In the instance information page, navigate to the "Overview" tab. Near the top is a field labeled "ID". The value to the right of "ID" is a Universally Unique ID (UUID) which uniquely names your instance. We need that ID to delete a stuck instance, so please provide it when requesting cloud.rc instance support.
Continuing the Tutorial¶
Now that you have set up a Network, Security Policies and an Instance, you are done with the tutorial, congratulations! There is one remaining optional step. If you need a persistent data volume to move between instances, please check our Volumes page.