Export Instance
How to export a Instance from CubeOS
Connect to root shell with SSH
$ ssh root@IPADDRESS
Warning: Permanently added '192.168.X.X' (ECDSA) to the list of known hosts.
Password:
Welcome to the Cube Appliance
#
Change Dirctory to /var/support
# cd /var/support/
Load CubeOS Credentials
# source /etc/admin-openrc.sh
List Instances
CLI : nova list
# nova list
+--------------------------------------+--------+---------+------------+-------------+----------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+---------+------------+-------------+----------------------------+
| fda8ff28-e42e-4457-bbc8-d7b7d016d9a5 | cirros | ACTIVE | - | Running | pub_10_32_0_0=10.32.10.104 |
+--------------------------------------+--------+---------+------------+-------------+----------------------------+
Stop the Instance
CLI : nova stop <instance or UUID>
# nova stop fda8ff28-e42e-4457-bbc8-d7b7d016d9a5n
+--------------------------------------+--------+---------+------------+-------------+----------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------+---------+------------+-------------+----------------------------+
| fda8ff28-e42e-4457-bbc8-d7b7d016d9a5 | cirros | SHUTOFF | - | Shutdown | pub_10_32_0_0=10.32.10.104 |
+--------------------------------------+--------+---------+------------+-------------+----------------------------+
Create Snapshot
CLI : nova image-create --poll <instance or UUID> <snapshot-name>
# nova image-create --poll fda8ff28-e42e-4457-bbc8-d7b7d016d9a5 rh_cirros
Server snapshotting... 100% complete
Finished
List Snapshot
CLI: cinder snapshot-list
# cinder snapshot-list
+--------------------------------------+--------------------------------------+-----------+------------------------------+------+
| ID | Volume ID | Status | Name | Size |
+--------------------------------------+--------------------------------------+-----------+------------------------------+------+
| 4456e05a-f0d3-4726-bb15-878046384d7a | bb860f10-d6c4-444b-9a2b-c2fe9321fd2a | available | snapshot for rh_cirros | 2 |
+--------------------------------------+--------------------------------------+-----------+------------------------------+------+
Create a volume from snapshot
CLI: cinder create --snapshot-id <snapshot-uuid> <snapshot-size-in-gb>
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2020-07-17T06:43:51.000000 |
| description | None |
| encrypted | False |
| id | fd9920be-2d4c-491f-8b01-d0d36ea2024c |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | None |
| os-vol-host-attr:host | cube@ceph#ceph |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | faa0d0a46f404fc89933dd05802df8fb |
| replication_status | None |
| size | 2 |
| snapshot_id | 4456e05a-f0d3-4726-bb15-878046384d7a |
| source_volid | None |
| status | creating |
| updated_at | 2020-07-17T06:43:51.000000 |
| user_id | 065e58ff6e824316a2b42f3f8df3dea3 |
| volume_type | None |
+--------------------------------+--------------------------------------+
Convert Volume to image
CLI: cinder upload-to-image <volume id> <image name>
# cinder upload-to-image fd9920be-2d4c-491f-8b01-d0d36ea2024c rh_test
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| container_format | bare |
| disk_format | raw |
| display_description | None |
| id | fd9920be-2d4c-491f-8b01-d0d36ea2024c |
| image_id | 0db015e4-857d-45f7-8b16-6703162d292d |
| image_name | rh_test |
| protected | False |
| size | 2 |
| status | uploading |
| updated_at | 2020-07-17T06:43:51.000000 |
| visibility | shared |
| volume_type | None |
+---------------------+--------------------------------------+
List Images
CLI: glance image-list
# glance image-list
+--------------------------------------+-----------------------+
| ID | Name |
+--------------------------------------+-----------------------+
| 0db015e4-857d-45f7-8b16-6703162d292d | rh_test |
+--------------------------------------+-----------------------+
Export to file
CLI: glance image-download --file <filename>.raw <image id>
# glance image-download --file rh_test.raw 0db015e4-857d-45f7-8b16-6703162d292d
[optional] Convert to VHD
# qemu-img convert -f raw -o subformat=fixed,force_size -O vpc rh_test.raw rh_test.vhd