Full Virtual Machines in Openstack¶
We use a software package called Openstack to run virtual machines. As an ACM member, you have the right to an account on our Openstack install and a truly ludicrous ammount of virtual storage and computing power.
Setting Up an Openstack VM¶
This section will tell you how to go about creating a virtual machine in Openstack and introduce some of the bits and pieces.
Before You Start¶
At present, Openstack accounts are not created with the rest of your ACM account, though you do have a right to one as a member. Just poke an admin and they’ll make you an account. Note that you will need to do this in person.
If you are not an ACM member, you can email officers@acm.jhu.edu to request an Openstack account.
While you will probably find it convenient to use the same password for Openstack and the rest of the ACM, the accounts are not in any way connected, so changing one password will not change the other one.
Once you have an account, head over to the web interface at https://cloud.acm.jhu.edu to get started. Once you log in, you’ll see an overview of one of the tenants you manage. Unfortunately, as of October 2016, we don’t have a command line client in place for users.
An Overview of Openstack¶
On login, the Openstack web interface defaults to showing you the Overview panel in the Compute section of your currently selected project/tenant. There is a navigation sidebar on the left and another one at the top. As I go through the different parts of your account, I’ll reference where those things can be found.
Your Openstack account is a user. It has access to one or more tenants, (or projects) which represent groups of VMs and related things you have access to. When you log in, your current tenant is shown on the left side of the top bar, and your account name is shown on the right. The drop down menu off the tenant name allows you to switch between tenants you have access to; the one off your user name will take you to your account settings. You can also access your other tenants from the Projects page, available in the Identity section of the panel on the left.
An openstack virtual machine consists of an instance (the actual running VM), which is attached to one or more volumes (virtual hard disks). These volumes can be created empty or based on an image (pre-installed ISO).
Creating a VM¶
You shouldn’t need to leave the Compute subheading of the Project section in the left navbar at any point in this process. Any time I mention “tabs”, I’m referring to an item in that section. Anyway, here we go:
First, make sure you’re in the right tenant/project. Moving a VM between projects, while technically possible, is a huge pain in the ass that we would rather avoid. For a personal VM, you want the tenant with the same name as your user account; for a group VM (such as for a project or external club), you’ll want that associated tenant.
In any event, once you’re in the right tenant, you need to create a root volume and any other volumes that will be attached to your VM. Your root volume will be based on an image, which is just an ISO of some operating system. We offer several images of various linux distros; you can also create one from an ISO served from somewhere on the internet. If you’re uploading an image, you can do that from the image tab.
Once you know the image you want is in openstack, go to the Volumes tab and select Create Volume to set up the root disk of your new virtual machine. Give it whatever title you like, then set “Volume Source” to “Image”. Choose an image you like as the source, then set the size. You shouldn’t choose a size that exceeds the size of the instance flavor you’ll eventually be choosing. It’s doubtful you’ll need more than 20G. Once you have the size and image selected, hit “Create Volume”. Sit back and wait a minute while Openstack tosses a bunch of bits around to create the volume, then head over to the “Instances” tab.
The “Instances” tab shows you all the VMs you have running or (at least nominally) ready to run. To start a new one, click “Launch Instance”. Since you’ll be booting off the volume you just created, select “Boot from Volume”[1] for your boot source, then select the volume you created. Choose the flavor you like for your VM; remember that it needs a root disk at least as big as the volume you created.
[1] | You may notice “Boot from Image” as an available boot source. Don’t try to use this; there is a bug in Python/Ceph that causes it to fail. |
Under “Access & Security”, select the ssh key pair you want to use to access the VM. If you don’t have a keypair in Openstack yet, import one. You will need to be able to access this keypair from inside the ACM in order to get to your VM. Then, under Networking, choose “user-internal-net”. The other network, “user-vm-network”, is reserved for floating ips. If you try to create a VM on
that network it will fail with a confusing error.
You shouldn’t need to worry about the “Post-Creation” or “Advanced Options” section of the dialog, so hit “Launch” to start your VM!
To actually get into your VM, ssh to YOU@conch.acm.jhu.edu
, then from there
ssh to ACCOUNT@VMS.IPA.DDR.ESS
using the ssh key you put in Openstack. This
will get you into your VM. Note that if you are using one of our stock images,
you will be sshing to a default account with sudo and no password. We recommend
you create a real account ASAP.