Back up and restore OpenStack instances
Agentless backup of instances and their volumes through the OpenStack API, with the rights of an ordinary project member.
Beyond Cloud backs up OpenStack instances agentless: nothing is installed inside them. The Beyond Cloud agent runs on any Windows or Linux server that can reach your cloud's API, and works through the OpenStack services every cloud has: Keystone, Nova, Cinder, Glance and Neutron.
It needs only the rights of an ordinary member of the project, not an administrator. So it works on your own private cloud and on a public OpenStack cloud where you only have a project.
Supported: OpenStack clouds with Keystone v3, Nova (compute API 2.47 or later: OpenStack Pike, 2017, and newer), Cinder v3 and Glance v2.
How it works
- Freeze. First every disk of the instance is frozen at the same moment: the root disk with an image of the instance (Create snapshot), each Cinder volume with a volume snapshot. The instance keeps running.
- Read. Then, disk by disk, a temporary volume is made from the frozen copy and uploaded to an image, and the image is read through the Image API and streamed, encrypted, to Beyond Cloud Vault. Nothing is written to the agent's disk. Only the blocks that changed since the last backup are uploaded.
- Clean up. Everything the backup made in the project is deleted again, also what an interrupted backup may have left behind. These temporary objects are named
bc-backup …, so you can recognize them.
The backup is crash-consistent: the same as if the power had been cut at that moment. Most systems recover from that, but databases may need a repair when restored. For those, back up the database itself as well, with the database backup of Beyond Cloud.
Each backup is a Full: it reads every disk whole, and Beyond Cloud stores only what changed since the last one. Plan the schedule with the size of the disks in mind.
1. Before you start
- Install the agent as a server on a machine that can reach the cloud's API: Keystone (usually port 5000, or
/identityon port 80/443) and the endpoints of the services in the catalog. An instance in the same cloud is fine. - Use a user that is a member of the project, for example a dedicated
backupuser. Keep enough quota in the project for one extra image, one snapshot and one volume the size of the largest disk while a backup runs. - The values you need (the Identity API address, the project, the user's domain) are on the cloud's API Access page (Horizon: Project → API Access), or in its
openrcorclouds.yamlfile.
2. Connect the agent to the project
- Open Beyond Cloud Backup → Hypervisors.
- In the OpenStack card, click Add an OpenStack project.
- Enter the Keystone address (for example
https://cloud.example.com:5000), the project, the user and the password. Fill in the user and project domain only if they are notDefault, and the region only if the cloud has more than one. - For a private cloud with a self-signed certificate, tick Accept a self-signed certificate.
- Click Connect. The instances of the project appear, with their flavor, disks and networks.
The password is stored encrypted on this computer. Add as many projects as you need; each is backed up on its own.
3. Create the backup
- Go to Backup → OpenStack · your project.
- Keep All virtual machines checked (instances created later are included automatically), or choose the ones you want.
- A good schedule to start with: Full every day at 22:00.
- Choose retention and click Create backup.
Note: Instances whose root disk is ephemeral on local storage are backed up through their image like any other. Extra ephemeral and swap disks of a flavor are not saved: they hold nothing that is meant to last. Shared file systems (Manila) are not part of an instance backup.
4. Restore
Go to Restore → OpenStack instances, choose the instance and the restore point, then pick one of two options:
- As a new instance, in the same project: the disks are uploaded to the project, volumes are made from them and a new instance starts with the same flavor, networks, security groups, key pair and availability zone, under a new name. It gets new IP addresses, so it can run next to the original. An instance that started from an image starts from an image again; one that started from a volume starts from a volume. The data volumes are attached in the same order. Images and volumes count against the project's quota.
- Only the virtual disk files, to a folder: each disk comes back as a file in a folder on the agent's computer, in its own format (for example
web-01-disk1.qcow2for a root disk made from a qcow2 image andweb-01-disk2.rawfor a volume), withinstance.json, the description of the instance (flavor, networks, volumes). Upload a disk to any cloud as an image (openstack image create --disk-format qcow2 --file web-01-disk1.qcow2 …) or open it with your usual tools (qemu-img,guestmount) to copy files from it.
There is no in-place restore for OpenStack: the restored instance is always a new one, and the original is never touched. When you are happy with the copy, delete the old one.
Tip: Names with parentheses, like
web-01 (restored), are read as patterns by theopenstackcommand line. Use the instance ID there (openstack server show <ID>), or rename the copy.