Using Compute and Block Storage on OPCP
Find out how to create instances, volumes and private networks with the Compute and Block Storage service in the OPCP Cloud Console
Alpha version — This guide documents the alpha version of Cloud Store. Features, interfaces and procedures will change until general availability (GA), and this guide will be updated along with them.
Objective
This guide shows Organization users how to create instances (virtual machines), block storage volumes and private networks with the Compute and Block Storage service in the OPCP Cloud Console.
Requirements
- Access to the OPCP Cloud Console, as described in the guide OPCP Cloud Console.
- The Compute and Block Storage service enabled for your Organization by your IT Admin, as described in the guide Deploying and scaling Compute and Block Storage on OPCP.
- An SSH public key: the instance creation form requires one.
Instructions
What the service offers in the Alpha
You manage these resources in the service Console, in Horizon for the cases the Console does not cover yet, or with the OpenStack CLI.
Opening the service
In the sidebar of the OPCP Cloud Console, open the service. It appears under the name your IT Admin gave it when enabling it for your Organization.
The header of the service shows up to two links:
Consoleopens the web interface of Compute and Block Storage. This guide describes this interface.Horizonopens the OpenStack Horizon interface, for the cases the Console does not cover yet. It is shown only if your IT Admin deployed Horizon with the service.
In the Console, the menu gives access to your resources:
Your user settings are in the menu of the user icon at the top right, under User settings:
Using the OpenStack CLI
- In the Console, open the user icon >
User settings>API accessand create an application credential. Note its ID and secret: the secret is shown only once. - In the OPCP Cloud Console, open the
Overviewtab of the service and copy the OpenRC output into a file namedopenrc.sh. - In
openrc.sh, replace<application credential ID>with the ID of your application credential. - Load the file with
source openrc.shand enter the secret of the application credential when asked.
You can then use the openstack command, as described in the guide How to deploy an instance via the OpenStack CLI.
Flavors and images
A flavor sets the number of vCPUs and the amount of RAM of an instance. In the Alpha, use the opcp- flavors. They are general-purpose flavors (4 GB of RAM per vCPU), and the number in their name is the RAM in GB.
The flavors have no local disk: the system disk of an instance is a block storage volume, whose size you choose.
Only the opcp- flavors can run Compute and Block Storage instances. With the OpenStack CLI or Horizon, an instance created with another flavor stays in the scheduling state.
The Alpha offers the following images:
Adding an SSH key
- Click the user icon at the top right, then
User settings>SSH keys. - Add a new key, give it a name and paste your public key, for example the content of
~/.ssh/id_ed25519.pub.
You can also create the key directly in the instance creation form, with New SSH key.
Creating a private network
- Go to
Network>Private Networksand clickCreate network. - Enter a Name and the Network address, for example
192.168.1.0/24. - Keep DHCP on, so that instances get their IP address automatically.
- Optionally, open
Advanced settingsto set the IP allocation pools, the DNS name servers or host routes. - Click
Create.
In the Alpha, private networks cannot be connected to the Internet. Leave Connect to Public Internet off.
Creating an instance
- Go to
Compute>Instancesand clickCreate instance. - Enter a Name.
- Choose an
opcp-Flavor in the general-purpose tab. - Keep the Isolation on
Shared. Dedicated hypervisors are not available in the Alpha. - Under Storage, choose the image and the size of the system volume. The volume is created with the instance.
- Under Network, select your private network.
- Under Access & Security, select your SSH key. An SSH key is required.
- Optionally, under
Advanced settings, add user data in the Customization script field (a cloud-init script run at first boot, base64-encoded in the Alpha), for example to set a password for the VNC console (see the "Connecting to an instance" section). - Confirm the creation.
The instance is building, then active. The list of instances shows its status, flavor, IP addresses, volumes and networks.
Connecting to an instance
In the Alpha, instances cannot be reached from outside the platform: there is no public IP address and no floating IP, so you cannot connect to them over SSH from your workstation.
- In the browser: in the list of instances, click the console icon of the instance, or open the instance and click
VNC. The console of the instance opens in the browser. - Between instances: an instance can reach the other instances of the same private network over SSH, for example
ssh debian@192.168.1.10with the default user of the image. The source instance needs a private key whose public key is on the target instance. Your own private key stays on your workstation, so create a key pair for this:- In the VNC console of the source instance (logging in needs a password, see below), run
ssh-keygen -t ed25519and display the public key withcat ~/.ssh/id_ed25519.pub. - Add this public key in the Console (see the "Adding an SSH key" section) and select it when you create the target instances.
- For an instance that already exists, append the public key to the
~/.ssh/authorized_keysfile of its default user, through its VNC console.
- In the VNC console of the source instance (logging in needs a password, see below), run
The images allow login with an SSH key only. To log in through the VNC console, set a password for the default user when you create the instance, with user data such as:
In the Alpha, the Console passes the user data to the instance as it is, but OpenStack expects it base64-encoded. Encode the script before pasting it into the Customization script field:
Creating and attaching a volume
- Go to
Storage>Block Storageand clickCreate. - Enter a Name and a Size.
- Choose a Source:
No sourcefor an empty volume, otherwise an image or another volume to copy. - Optionally, turn on
Attach to instance after creationand select the instance. - Click
Create.
To attach an existing volume, open the instance and add the volume to it, or attach it from the volume page. The volume then appears in the instance as a new disk (for example /dev/vdb): format it if it is empty, then mount it from the operating system.
To detach a volume, open it and choose Detach volume. The system volume of an instance cannot be detached.
Connecting an instance to a network
To connect an existing instance to another private network:
- from the network: open it in
Private Networksand attach the instance; - or from the instance: open it and add the network.
The instance gets a new network interface with an address from that network. To disconnect the instance, choose Detach instance on the network.
Known limitations
The Alpha has the following known limitations:
The following features are not available in the Alpha:
- dedicated hypervisors for an Organization.
- bare-metal instances and GPU instances.
- backups to Object Storage.
- monitoring and alerts for instances.
Go further
How to deploy an instance via the OpenStack CLI
Deploying and scaling Compute and Block Storage on OPCP
For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.
Join our community of users.