OpenStack | Snapshots
command syntax: openstack server image <action/operation> <--flags values> <server-name>
we can create image snapshots from the existing servers(VM instances), this image could later be used for building a new server
cumulus@server01:~$ openstack server image create --name firstServerSnapshot firstServer
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value
|
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| checksum | None
|
| container_format | None
|
| created_at | 2018-07-09T17:05:41Z
|
| disk_format | None
|
| file | /v2/images/b44a67e6-c115-4705-a56d-
7914dbdd3114/file
|
| id | b44a67e6-c115-4705-a56d-7914dbdd311
4
|
| min_disk | 1
|
| min_ram | 0
|
| name | firstServerSnapshot
|
| owner | 6d9cb60806744bbc9618963e77bda3cd
|
| properties | base_image_ref='0b16d59f-71f4-48a6-
9aef-add8f535bc7d', boot_roles='admin', image_type='snap
shot', instance_uuid='51b75145-defd-45cd-9e05-97280d6e66
8c', owner_project_name='admin', owner_user_name='admin'
, user_id='d85316e4978a4454836d21cbde99322d' |
| protected | False
|
| schema | /v2/schemas/image
|
| size | None
|
| status | queued
|
| tags |
|
| updated_at | 2018-07-09T17:05:41Z
|
| virtual_size | None
|
| visibility | private
|
+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
cumulus@server01:~$
#the newly created snapshot should show up on the image list
cumulus@server01:~$ openstack image list
+--------------------------------------+---------------------+--------+
| ID | Name
| Status |
+--------------------------------------+---------------------+--------+
| 0b16d59f-71f4-48a6-9aef-add8f535bc7d | cirros
| active |
| b44a67e6-c115-4705-a56d-7914dbdd3114 | firstServerSnap
shot | active |
+--------------------------------------+---------------------+--------+
#we can use this snapshot as an image for creating new servers / VM instances
cumulus@server01:~$ openstack server create --image firstServerSnapshot --flavor m1.nano --key-name firstKeypair firstSnapshotServer
+-------------------------------------+-----------------
-------------------------------------------+
| Field | Value
|
+-------------------------------------+-----------------
-------------------------------------------+
| OS-DCF:diskConfig | MANUAL
|
| OS-EXT-AZ:availability_zone |
|
| OS-EXT-SRV-ATTR:host | None
|
| OS-EXT-SRV-ATTR:hypervisor_hostname | None
|
| OS-EXT-SRV-ATTR:instance_name |
|
| OS-EXT-STS:power_state | NOSTATE
|
| OS-EXT-STS:task_state | scheduling
|
| OS-EXT-STS:vm_state | building
|
| OS-SRV-USG:launched_at | None
|
| OS-SRV-USG:terminated_at | None
|
| accessIPv4 |
|
| accessIPv6 |
|
| addresses |
|
| adminPass | baimmBPT7RYj
|
| config_drive |
|
| created | 2018-07-09T17:12
:42Z |
| flavor | m1.nano (0)
|
| hostId |
|
| id | 3ddb72dd-2f30-42
b2-9683-b3d7d7ee41f3 |
| image | firstServerSnaps
hot (b44a67e6-c115-4705-a56d-7914dbdd3114) |
| key_name | firstKeypair
|
| name | firstSnapshotSer
ver |
| progress | 0
|
| project_id | 6d9cb60806744bbc
9618963e77bda3cd |
| properties |
|
| security_groups | name='default'
|
| status | BUILD
|
| updated | 2018-07-09T17:12
:42Z |
| user_id | d85316e4978a4454
836d21cbde99322d |
| volumes_attached |
|
+-------------------------------------+-----------------
-------------------------------------------+
cumulus@server01:~$
--end-of-post--