Launching instances¶
An instance is a virtual machine running in your project. To launch one
you pick an image (the operating system), a flavor (the size), an SSH key
pair, and a network to attach it to. You can do all of this from the
dashboard or with the openstack
command-line client.
This page uses the CLI. See CLI and automation for how to set up the client and your credentials first.
Pick an image and a flavor¶
Flavors come in two families:
b2.*instances have no local disk. Boot them from a volume so the root disk lives on block storage and survives the instance being deleted.l2.*instances include a local NVMe disk. The local disk is fast but its lifetime is tied to the instance.
See the flavor and quota reference for the full list and pricing.
Create an SSH key pair¶
Either upload your existing public key or have OpenStack generate one:
# Upload an existing public key
openstack keypair create --public-key ~/.ssh/id_ed25519.pub mykey
# Or generate a new key pair and save the private key locally
openstack keypair create mykey > mykey.pem
chmod 600 mykey.pem
Launch the instance¶
openstack server create \
--image "Debian 13" \
--flavor b2.c2r4 \
--key-name mykey \
--network my-project-net \
--security-group default \
my-instance
Watch it come up:
Once it is ACTIVE and has an address, connect over SSH. By default
only instances with a floating IP are reachable from
outside the project network.
Boot from a volume¶
For b2.* flavors, and any time you want the root disk to persist, boot
from a volume instead of an ephemeral disk:
openstack server create \
--flavor b2.c2r4 \
--boot-from-volume 50 \
--image "Debian 13" \
--key-name mykey \
--network my-project-net \
my-instance
This creates a 50 GB root volume from the image. Deleting the instance leaves the volume in place unless you ask for it to be removed.
Customise at first boot with cloud-init¶
Pass a cloud-init file to install packages, create users, or run scripts on first boot:
openstack server create \
--image "Debian 13" \
--flavor b2.c2r4 \
--key-name mykey \
--network my-project-net \
--user-data cloud-init.yaml \
my-instance
Resize¶
To move an instance to a larger or smaller flavor:
The instance reboots as part of a resize.