Virtual Machines and Aquilon

Scenario

This document describes how to create a virtual machine that will appear in Aquilon

Through horizon

Procedure

Follow the procedure here until the point of selecting a network: Create a Virtual Machine on Openstack using the Openstack Web interface

Networks menu

For Projects that just have one network type (Private or Internal) this is selected by default. A Hybrid project will have both a private network and an Internal Network, so one must be selected by clicking on an up arrow.

For Aquilon managed VMs you will most likely want to use the Internal network. Using a project private network is possible if the VM requires access from outside the STFC network however this requires the network to be added to Aquilon so contact us.

That completes all of the mandatory Fields that you need to complete in order to create one or more virtual machines. At this point, the “Launch Instance” button should go dark blue, indicating that you can now create the VM.

Clicking “Launch Instance” will create a VM that appears in Aquilon with the default personality (nubesvms), archetype (cloud) and domain (prod_cloud). You will be able to manage the VM into different domains and sandboxes and make it with different personalities in the usual way once the VM has booted.

If you want the VM to be created with a different configuration you can click on “Metadata” on the left hand side.

Metadata

In the metadata tab you will see something that looks like this:

 

image-20240412-082426.png

From here expand “Aquilon Image Properties” and you will see this:

 

Click on the “+” to add the metadata to the instance. The metadata is described in the “Aquilon Parameters” table below, any that are left blank will pull from the defaults on the image

Bare in mind that if your personality doesn't compile in Aquilon that your VM will be left in an inconsistent state. If this happens try creating a VM without setting the metadata and then manually making the VM in Aquilon.

Further options

You may wish to click on the ”Security Groups” menu, as different security groups are often needed depending on if the VM is on the Internal Network or a Private Network.

Key pair allows you to add an SSH key and have it automatically added into the Virtual machine when it starts.

The other options on the Left hand Side, you will probably not need for day to day use unless you have a specialist requirement.

Final stages

The system will then be seen in the instances screen at various stages of completeness:-

 

You may see “Scheduling” and “Building” in the Task column as well. Once it is ready to connect to, you should see something like:-

 

At this stage, you may not be able to SSH onto it quite yet, but you may be able to log into the console, or at least see how far it has got in the boot process.

On the command line

Follow the procedure here up until, the point of the point of “Create a new Instance”

Create a Virtual Machine from command line in STFC Openstack

Create a Virtual Machine

When creating your VM you can add properties which tell the Aquilon consumers what config the VM should have. The properties are described in the “Aquilon Parameters” table below.

You add them to the command by adding a --property <parameter>=<value> for each parameter you want to change.

Here is an example command, putting together information from the previous commands:-

openstack server create \ --flavor l3.nano \ --image rocky-9-aq \ --network Internal --security-group default --key-name key_name the_servers_name \ --property AQ_SANDBOX=foo/test-sandbox \ --property AQ_ARCHETYPE=cloud \ --property AQ_PERSONALITY=test-personality

Aquilon Parameters

Metadata Name

Description

Command line parameter

Metadata Name

Description

Command line parameter

Aquilon Archetype

The archetype the VM will be created with

AQ_ARCHETYPE

Aquilon Domain

The domain the VM will be created in. This shouldn't be set if Aquilon Sandbox is set

AQ_DOMAIN

Aquilon Personality

The personality the VM will have (this must be present in the archetype selected)

AQ_PERSONALITY

Aquilon Sandbox

The sandbox the VM will be created in. This must be in the format <username>/<sandbox> i.e. foo\test-sandbox This shouldn't be set if Aquilon Domain is set

AQ_SANDBOX

OS Distro

The aquilon OS Name to use. Do not set this

AQ_OSNAME

OS Version

The aquilon OS Version to use. Do not set this

AQ_OSVERSION

Common Things to do After Creating your VM

Situation

Guidance

Situation

Guidance

SSH into the machine

This you can only do if it was created on the “Internal” network, otherwise, you will gave to assign a floating IP address to the VM so that you can SSH into it.

Login using the web console

This will only work if you are using a STFC fedID as your Openstack user account. If not, then you need to SSH onto the VM first, create a user account, password, home directory, and entry in the /etc/sudoers.d/cloud file for the new user – this will then allow that user to login to the web console.

Update the host

Depending on the distribution of linux the command can vary (yum update, or apt-get update && apt-get upgrade). You may find that you cannot run “yum” the first time you login: This is because all Scientific Linux 7 Virtual machines are partially managed by the configuration management tool in order to keep them up to date and well prepared. It is suggested that after the first 10 minutes or so, you reboot the VM so that all the updates will take effect.

Using Aquilon images

A hybrid project will not see the “ScientificLinux7-AQ” images by default: These are the fully Aquilon managed VMs and are available only to STFC users who wish to use the Aquilon configuration management tool. Note that this can only be done on these image types, and if the hosts are on the “Internal” network.