Quick Start Guide on VM

Terminology

A virtual machine, or VM, is a software program that exhibits the behavior of a separate computer and is capable of running applications and programs within its own environment.

A running virtual machine in OpenStack terminology is called an instance, because it runs within another computing environment – usually known as the host. In an OpenStack project the host will typically be a Nova compute node.

Multiple virtual machines can exist within a single host at one time.

Start a Virtual Machine

  1. Login to the dashboard.

  2. Select the appropriate project from the drop down menu at the top left.

  3. On the Project tab, open the Compute tab and click the Instances category.

  4. Click Launch Instance. In the Launch Instance dialog box, specify the following values:

    • Details tab

      • Instance Name

        Assign a name to the virtual machine.

      • Availability Zone

        Select nova.

      • Count

        Set the number of instances: default is 1.

    • Source tab

      • Select Boot Source

        Choose image, and select an image from the Available list.

      • Create New Volume

        Select Yes

      • Delete Volume on Instance Delete

        Select Yes*

    • Flavor tab

      Specify the size of the instance to launch.

    • Networks tab

      • Selected Networks

        To add a network to the instance, click the + in the Available field. Select default, which is a network connected to a router on the external network and allows assinging floating IPs to the VM.

        Warning

        the network default is shared among all projects, hence all the VMs on this network will see each other and receive broadcast packets.

        Do NOT select the network called floating-ip as VMs on this network cannot be attached to external networks.

    • Network Ports tab

      You may skip this.

    • Security Groups tab

      Security groups are a kind of cloud firewall that define which incoming network traffic is forwarded to instances. You may just keep the default security group.

    • Key Pair tab

      Warning

      You will need a Key Pair to be able to access the instance.

      Do either Create Key Pair or ‘Import Key Pair` and then select it or an Available one from the list.

    • Configuration

      Add the following script:

      #!/bin/bash
      
      sudo apt update
      sudo apt install -y qemu-guest-agent
      

      This simple script installs qemu-gest-agent which is needed to perform snapshot while the instance is running.

  5. Click Launch Instance at the bottom right, to start the instance.

For more details see steps to create a Virtual Machine in your project.

Assign a public IP to the VM

To make an instance remotely accessible, you need to assign a public IP address to it by selecting Associate Floating IP from the Actions menu next to the instance in the Instances tab of the dashboard. Choose any one of the suggested addresses.

Access Linux Virtual Machines

First configure the security group so that port 22 is reachable from the external world:

  1. Login to the dashboard
  2. Click on Project -> Network -> Security Groups
  3. Edit the default security group by clicking on Manage Rules
  4. Click on Add Rule, select SSH from the drop down menu and click Add

Use the following steps to access a running Linux virtual machine.

To log on to a virtual machine, use the ssh command on your host machine, using the keypair you selected when creating the instance.

Warning

Ensure the keypair file has the proper access rights:

$ chmod 400 MyKey.pem

Invoke ssh specifying the keypair and the public IP address of the instance; for example:

$ ssh -i MyKey.pem ubuntu@90.147.188.236

Last login: Tue Jan 12 11:20:28 2016
$

Warning

the username (ubuntu in the example) will depend on the name of the image, so for the image named Centos 7 x86_64, the username would be centos, for the image Cirros x86_64 0.3.4, the username will be cirros.

From this point onward, this terminal window is connected to the virtual machine until you exit the virtual machine. All commands go to the VM, not to your computer.

When you first access the VM you will be logged in as user ubuntu. If you need to run commands as administrator, with root privileges, use sudo <command>.

Use the exit command to quit the ssh session.

The VM is still running in the background. You can re-issue the ssh command later, to reconnect.

Access Windows Virtual Machines

For accessing virtual machine running Microsoft Windows, you can log into the machine using a Remote Desktop client.

Windows and Mac Versions

The operation of Remote Desktop, as desribed below, is similar across all clients.

On a Mac, download and install the Remote Desktop Connection Client for Mac. The steps to connect to your server are very similar. You can download the software here.

Here you can find more information on configuring and running Remote Desktop Connection for MacOS.

Run the Remote Desktop Connection Client

  1. Open the Remote Desktop Connection Client

    a. on Windows by clicking **Start > All Programs > Accessories >
       Communications > Remote Desktop Connection**.
    b. on MacOS, ensure you have version 8 or later of the Microsoft Remote
       Desktop app, or `download it from here
       <https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417>`_. Start
       `Remote Desktop Connection`.
    
  2. Enter the IP address of the server in the Computer field and click Connect.

  3. (Optional) To set up file transfer or enable your clipboard for copy/paste, click Options. Click the Local Resources tab, select the Clipboard option, click More, and then click Drives.

  4. Save your session by clicking the General tab, then clicking Save As.

Log in to Your Server …………………https://git.garr.it/cloud/web/activity Once you have connected, you will see the Windows log in screen. To log in for the first time, enter as User name: Administrator and to retrive the Administrator’s password you can follow this guide (https://cloud.garr.it/support/kb/openstack/manageCustomImages/#spawn-the-image-and-change-administrator-password). You will be asked to supply a new password before being able to login.

Stop or Delete an Instance

You can temporarly pause or shut off an instance, in order to avoid consuming resources, using the commands from the Actions menu next to the instance on the Instances panel of the dashboard.

Track usage for instances

You can track usage for instances for each project. You can track costs per month by showing meters like number of vCPUs, disks, RAM, and uptime for all your instances.

  1. Log in to the dashboard.
  2. Select the appropriate project from the drop down menu at the top left.
  3. On the Project tab, open the Compute tab and click Overview category.
  4. To query the instance usage for a month, select a month and click Submit.
  5. To download a summary, click Download CSV Summary.

Create an instance snapshot

  1. Log in to the dashboard.
  2. Select the appropriate project from the drop down menu at the top left.
  3. On the Project tab, open the Compute tab and click the Instances category.
  4. Select the instance from which to create a snapshot.
  5. In the actions column, click Create Snapshot.
  6. In the Create Snapshot dialog box, enter a name for the snapshot, and click Create Snapshot.
  7. The Images category shows the instance snapshot.

To launch an instance from the snapshot, select the snapshot and click Launch. Proceed with launching an instance.

Manage an instance

  1. Log in to the dashboard.
  2. Select the appropriate project from the drop down menu at the top left.
  3. On the Project tab, open the Compute tab and click Instances category.
  4. Select an instance.
  5. In the menu list in the actions column, select the state.

You can rebuild an instance. You can also choose to view the instance console log, edit instance or the security groups. Depending on the current state of the instance, you can pause, resume, suspend, soft or hard reboot, or terminate it. Instance resizing is currently not possible.