How to create VMs in OpenStack


This is a basic guide on creating VMs in OpenStack. For more details, see: https://docs.openstack.org/horizon/latest/user/launch-instances.html


  1. Go to the OpenStack log in site (if you don't know your URL, contact help-hpc@hpc.uky.edu). Log in using your linkblue credentials; for your username, enter your linkblue ID without the domain string, such as "user225" and not "AD\user225"; enter your linkblue password.

  2. A successful login takes you to your account's Overview page:


  3. On the left side of the page, you will see a list of expandable items under headings like "Project" and "Identity". If you click on "Project" on the left tab, you will see it expanded to show items such as "Compute". Some important pages:
    1. Project > Compute > Overview:  Overview of your project quota/limits
    2. Project > Compute > Instances:  A list of your created VMs.
    3. Project > Compute > Volumes:  A list of your created volumes (extra virtual storage devices).

  4. Click on Compute > Instances on the left panel. Then click on "Launch Instance".


  5. A pop up appears to let you configure the VM. There are  links on the left panel labeled "Details", "Source", "Flavor", etc.  Ones marked with asterisks are those that are absolutely required to be set for launching a new VM. The ones without asterisks are optional. Name your VM instance under "Instance Name" text box. Leave the other fields blank.


  6. Click on "Source" on the left pane. This is where you select the Operating System you want for your VM. For a basic setup (a VM with no extra volumes attached), choose "Image" for Boot Source. You also have the option of creating Volumes or not. An OpenStack Volume is virtual storage space that can be attached to a VM.
    Creating new volumes will allow you to have extra disk space.
    1. The simplest method is to create a VM without any volumes. The VM comes with a virtual disk with the size specified by the Flavor (a Flavor is a specification of how much disk space, RAM, and how many vCPUs the VM will have. The Flavor will be chosen after this step). You can create a new volume in the future after you launch your VM, so the volume creation is not necessary.
    2. Using the combination of options below is not advisable as it is an unstable/unreliable operation.




  7. The list of OS images to choose from are under the "Available" section. To choose the image you want, find the row containing the image and click on the up arrow.



  8. Ensure that the Operating System image you chose on the previous step is now under the "Allocated" section. If you change your mind and want to change to a different OS, you can press the down arrow and repeat the image selection step.


  9. Click on "Flavor" on the left pane. A flavor will have a set of configuration (CPU #, total RAM, Disk size, etc.). You should see a few flavors available to select from. Choose the flavor that is appropriate for the VM you want to make. Note that whichever flavor you choose will decrease your project quota, so choose a flavor that's as large as you might need, but not more so that you won't run out space too fast. If you had done step 6b (Creating a Volume at the same time you're creating a VM), the size of that Volume will override the Root Disk value here.



  10. Click on "Network" and select a provider network. There may be multiple provider networks such as provider, provider1, provider2, etc. This will let your VM connect to the internet. Choose one of the provider networks.

  11. To allow you to log in to the VM, you have 3 options. See the 3 options below and pick one. Options 1 and 2 use SSH keys. Option 3 does not use SSH keys and has you customize username/password.  Use Option 1 if you don't have SSH public/private keys and you need to have OpenStack help create them for you. Use Option 2 if you already have existing SSH keys that you want OpenStack to use for your VM. Use Option 3 if you don't want to use SSH keys.

  12. Option 1: Use SSH keys by first having OpenStack create public/private SSH keys for you
    1. If you choose Create Key Pair, OpenStack can create an SSH keypair on the spot. You'll be able to "Copy Private Key to Clipboard"; If you run Linux or Mac OS, you can create an empty private key file in your local computer (e.g. in ~/.ssh/ with file permission 600). Then, you can log in from your local machine by passing the private key. With the Ubuntu image, ssh as user "ubuntu". With the CentOS image, ssh as user "centos".
  13. Option 2: Use SSH keys by using a pre-existing SSH keys that you have created outside of OpenStack


    1. With this option, you are assumed to have an existing public/private key you wish to use. You can copy/paste the public key into the VM using the above window.
  14. Option 3: Not use SSH keypair and instead use a Configuration option where you set the Username and Password through OpenStack.

    1. A different way is to create your own user accounts right up front during VM creation–that is, you will provide the username and password for one or more multiple accounts for the VM. In this method, once the VM is created, the Linux Operating System will have the user(s) that you have specified. To do this option, you have to edit the "Configuration" option. You can copy/paste the following text into the Customization Script box (after you click on Configuration tab on the left).

      The script below is sensitive to spacing and tabs, so I suggest to copy and paste the below text. However, you have to edit the items like username and password. If you want to add other users, ensure the spacing is similar to the one already shown below.

      Substitute new_username with a suitable name and 'new_password' with a custom password (IMPORTANT: Your password goes inside the single quotation marks. If you don't have the single quotation marks, it won't work). Note that the below example will create a user with administrative privileges (full sudo capability). If you're sharing the VM with multiple users, you can create just one user below, and create additional users with less privileges once you are able to log in as the administrator. Note: Copy and paste below script straight into the OpenStack Configuration "Customization Script" box in the browser. If you're using Windows or Mac, copying the script to a text editor may insert invisible characters that render the script not readable by OpenStack when you copy it to the "Customization Script" box! :

      #cloud-config
      ssh_pwauth: True
      users:
        - name: new_username
          lock-passwd: false
          shell: /bin/bash
          plain_text_passwd: 'new_password'
          sudo: ALL=(ALL) NOPASSWD:ALL



  15. You can go back and review any/all of the configurations you have done. If everything is to your satisfaction, click on Launch Instance on the bottom right corner of the window. The other options on the left tab are optional (the necessary tabs to complete are Details, Source, Flavor, Networks. OpenStack will not let you launch if these tabs are not completed correctly).

  16. The VM instance should be visible on the Instances page with Status = Active. If Status = Error, the VM was unable to be created.


  17. To access the VM, click on Instance name and Console tab (see Accessing OpenStack VM Console Online). This web console method is limited (e.g.  you can't copy/paste). It's much more useful to use your own terminal (e.g. MacOS Terminal or Windows PuTTY) and use SSH. The address to SSH is displayed in the Instances page (under column IP Address). The user name can be one that you have customarily set (if you did step 14). Or, if you did step 12 or step 13, the user name is "ubuntu" for Ubuntu image or "centos" for CentOS image.


Center for Computational Sciences