Skip to content
VirtualLP Virtual Learning Platform

Practical 7: FOSS-Cloud IaaS – Virtual Server and Storage Provisioning

14 min read Topic 31 of 34 1 hands-on lab

Aim

Use OpenStack to create a virtual server with the required CPU (Central Processing Unit), memory and disk. Create an extra storage volume, attach it and make it ready for use inside the server. Check how much storage is used.

Theory

Infrastructure as a Service (IaaS) gives you virtual servers, storage and networks when you request them. You choose the resources and manage the software that runs on them.

This practical uses OpenStack, an open-source cloud platform. Open source means its source code is available under a licence that allows people to use and change it.

renting a computer and a pen drive

Launching an instance is like renting a computer of the size you choose (the flavor). Creating a volume is like buying a pen drive. Attaching it is plugging it in. Formatting and mounting is what you do the first time you use a new pen drive. If you return the computer, your pen drive (and its data) stays with you.

flowchart LR
    U[User – Horizon / CLI] --> K[Keystone<br/>identity]
    U --> N[Nova<br/>compute]
    U --> C[Cinder<br/>block storage]
    N --> G[Glance<br/>images]
    N --> Q[Neutron<br/>networking]
    N -->|boots| VM[(Virtual server<br/>vsi-01)]
    C -->|iSCSI / LVM volume| VM
    Q -->|private IP + floating IP| VM
Concept Meaning in OpenStack
Flavor The hardware size: vCPUs, RAM (Random Access Memory), root disk (for example m1.small = 1 vCPU, 2 GB RAM, 20 GB disk)
Image A bootable OS (Operating System) template stored in Glance (for example CirrOS, Ubuntu)
Instance A running virtual server made from an image + a flavor
Ephemeral disk The root disk – deleted together with the instance
Volume (Cinder) A permanent disk; it survives when the instance is deleted, and can be attached/detached
Floating IP (Internet Protocol) A public address connected (by NAT (Network Address Translation)) to the instance's private IP
Quota / usage Limits per project – instances, cores, RAM, gigabytes

Storage types in IaaS

Type Example How you use it Good for
Block Cinder volume, AWS (Amazon Web Services) EBS (Elastic Block Store) A raw disk – you must put a file system on it Databases, application data
Object Swift, Amazon S3 (Simple Storage Service) Through an HTTP (Hypertext Transfer Protocol) API (Application Programming Interface) (PUT/GET files) Backups, photos/videos, static files
File Manila, NFS (Network File System) A shared folder Shared home folders
Key point

A new block volume is just empty raw space. Inside the server you must format it (mkfs.ext4) and mount it before you can store files – the cloud only plugs the device in.

Requirements

  • An OpenStack cloud (DevStack) with Horizon, Nova, Glance, Neutron and Cinder
  • A project user (demo) and the CirrOS image

Procedure

Step 1 – Prepare access

  • Create a key pair called vsi-key.
  • In the default security group, add rules for SSH (Secure Shell) (port 22) and ICMP (Internet Control Message Protocol) (ping).

Step 2 – Create the virtual server Go to Compute → Instances → Launch Instance and fill in:

  • Name: vsi-01
  • Image: CirrOS
  • Flavor: m1.small
  • Network: private
  • Key pair: vsi-key

Click Launch and wait until the status is Active.

Step 3 – Make it reachable From the instance's menu, choose Associate Floating IP and pick one from the public pool.

Step 4 – Create storage Go to Volumes → Create Volume: name vsi-data, size 2 GiB, source empty.

Step 5 – Attach the volume On the volume, choose Manage Attachments → attach it to vsi-01. It appears inside the server as /dev/vdb.

Step 6 – Format and mount it inside the server

ssh cirros@<floating-ip>          # password: gocubsgo
lsblk                             # vdb  2G disk
sudo mkfs.ext4 /dev/vdb
sudo mkdir -p /mnt/data
sudo mount /dev/vdb /mnt/data
df -h
exit
  • ssh – log in to the server.
  • lsblk – list the disks; you should see the new vdb (2 GB).
  • mkfs.ext4 – format it with the ext4 file system (only the first time!).
  • mkdir + mount – create a folder and mount the disk there.
  • df -h – confirm it is mounted with about 1.8 GB free.

Step 7 – Report the usage

source demo-openrc.sh
openstack server show vsi-01
openstack volume list
openstack limits show --absolute

Show the server's details, the list of volumes (vsi-data is in-use), and how much of the project's quota is used.

Virtual lab · OpenStack · 40 min

Practical 7: FOSS-cloud IaaS – provision a virtual server with block storage

Use OpenStack, the leading open-source IaaS cloud, to provision a virtual server instance with chosen CPU, RAM and disk, create a block-storage volume, attach it, then format and mount it inside the instance and report usage.

Open lab

Output / Observations

Example output for the settings in this lesson:

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    253:0    0    1G  0 disk
└─vda1 253:1    0 1015M  0 part /
vdb    253:16   0    2G  0 disk /mnt/data

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1      1014M   38M  926M   4% /
/dev/vdb         2.0G   24K  1.8G   1% /mnt/data
  • vda is the root (ephemeral) disk with the OS.
  • vdb is our new 2 GB volume, mounted at /mnt/data.
Resource Value
Instance vsi-01 – m1.small (1 vCPU, 2 GB RAM, 20 GB disk)
Volume vsi-data – 2 GiB, in-use, /dev/vdb mounted at /mnt/data
Usage instances 1, cores 1, RAM 2048 MB, volume gigabytes 2

Conclusion

Check that the server starts and the volume is attached. Inside the server, check that the formatted volume is mounted and can store a file. Record the project resource usage.

Viva questions

  1. What is the difference between ephemeral and volume storage? Ephemeral root disks are deleted with the instance; Cinder volumes stay and can be moved between instances.
  2. Which OpenStack service provides block storage? Cinder (object storage is Swift).
  3. Why must the volume be formatted inside the instance? The cloud attaches a raw block device; the guest OS creates the file system.
  4. What is a flavor? A template for vCPU, RAM and disk sizes.
  5. What is a floating IP? A public IP that the Neutron router maps (NAT) to the instance's private address.
  6. Name three FOSS (Free and Open-Source Software) IaaS platforms. OpenStack, Apache CloudStack, OpenNebula.

Practise this topic

Hands-on virtual lab

Apply what you just read in a realistic, guided simulation. Free with a verified account.

Create a free account to track your progress and unlock virtual labs.