Storage
VM main disk
The main disk always has a size that corresponds to the flavors “Disk” parameters (example: 10GB for flavor m1.small
). This size is used to generate the block device in which the image is copied. The image, however, is partitioned from generation and the partitions created do not correspond to the size actually available in the instance. To gain access to the entire instantiated disk, it is necessary to assign the available space to a disk partition.
Note
These manipulations are not necessary if the image contains only one partition and the cloud-init
is configured to repartition the VM disk on the fly (action resizefs
).
Example with an image whose last partition (2
) is used via LVM:
# repartitioning
% fdisk /dev/vda <<EOF
d
2
n
p
2
w
EOF
% shutdown -r now
% pvresize /dev/vda2
The disk space is now available in the volume group provided by vda2
.
Backup management
CC-IN2P3 official backup service
On the cloud instances as well as on all the CC-IN2P3 machines, you may configure your files backup with the backup service (TSM).
Through the cloud
You may use the openstack functionality to perform snapshots of your servers disk image (see image-create
API command).
You can make a consistent snapshot of your VMs with the command:
% openstack server image create --name SNAPSHOT_NAME SERVER_NAME
You will then find the snapshot in the list of images in the catalog:
% openstack image-show SNAPSHOT_NAME
+---------------------------+--------------------------------------+
| Property | Value |
+---------------------------+--------------------------------------+
| Property 'base_image_ref' | cedd3e88-4845-4c0c-bd16-743d3830a08f |
| Property 'image_location' | snapshot |
| Property 'image_state' | available |
| Property 'image_type' | snapshot |
| Property 'instance_uuid' | 83886683-5a73-4777-887d-1537561647a2 |
| Property 'owner_id' | 9d0fa8a82fe8449cad50729381a29a7a |
| Property 'user_id' | d0bc48fb8d8c414a9da8983c85c754f5 |
| checksum | c18d4e707c8db0bc1c11a55ef820ffa1 |
| container_format | bare |
| created_at | 2016-04-01T13:13:18.000000 |
| deleted | False |
| disk_format | qcow2 |
| id | 42e33dbb-39f2-4acd-8bdd-34eecd873bde |
| is_public | False |
| min_disk | 20 |
| min_ram | 0 |
| name | NOM_DU_SNAPSHOT |
| owner | 9d0fa8a82fe8449cad50729381a29a7a |
| protected | False |
| size | 4239917056 |
| status | active |
| updated_at | 2016-04-01T13:17:36.000000 |
+---------------------------+--------------------------------------+
You may program a recurring snapshot with the command:
% openstack server set --property autobackup=true SERVER_NAME
A weekly backup is performed automatically. The backup may be found in the image catalogue glance and is called autobackup-$UUID
. To restore this backup (careful, the operation is destructive for your current instance):
% openstack server rebuild --image autobackup-$UUID SERVER_NAME