openstack

openstack - swift 사용

sysman 2021. 2. 18. 15:53

 

 

############### controller 설정 ##################

#openstack image list

 

아래 내용 추가

# vi /etc/glance/glance-api.conf

[glance_store]
stores = file,http,rbd,swift
default_store = swift
swift_store_auth_version = 3
swift_store_auth_address = http://192.168.100.110:5000/v3/
swift_store_user = service:swift
swift_store_key = swift
swift_store_create_container_on_put = True
swift_store_container = glance
os_region_name = RegionOne

#systemctl restart openstack-glance-api openstack-glance-registry

#lsof -i tcp:9292

 

##### controller 에서 테스트 확인 ####################

#openstack image create "cirros2" --file cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public

 

#openstack image list

#cp keystonerc glancerc

# vi glancerc

export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=service
export OS_USERNAME=glance
export OS_PASSWORD=glance
export OS_AUTH_URL=http://192.168.100.110:5000/v3

 

#source ~/glancerc

#swift stat

#swift list

#swift list glance[root@controller ~]# source ~/glancerc
[root@controller ~]# swift list
glance
[root@controller ~]# swift list glance
0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f
0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f-00001
6432a3f4-6628-4f68-956f-8e3ef541e4df
6432a3f4-6628-4f68-956f-8e3ef541e4df-00001

 

삭제시

#swift delet glance 0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f

 

 

cinder 서비스 백업을 위한 swift 스토리지 사용

########## network 에서 구성 #################

 

데몬 동작확인

#systemctl status openstack-cinder-back 

 

#vi /etc/cinder/cinder.conf

[DEFAULT]

my_ip = 192.168.100.112

enable_v1_api = True

enable_v2_api = True

enable_v3_api = True

auth_strategy = keystone

transport_url = rabbit://openstack:password@192.168.100.110

glance_api_servers = http://192.168.100.110:9292

enabled_backends = ceph,nfs

glance_api_version = 2

backup_driver = cinder.backup.drivers.swift

state_path = /var/lib/cinder

log_dir = /var/log/cinder

 

#systemctl restart openstack-cinder-volume openstack-cinder-backup

 

########## controller 에서 구성 #################

#vi /etc/cinder/cinder.conf

[DEFAULT]

my_ip = 192.168.100.110

enable_v1_api = True

enable_v2_api = True

enable_v3_api = True

auth_strategy = keystone

transport_url = rabbit://openstack:password@192.168.100.110

backup_driver = cinder.backup.drivers.swift

 

#systemctl restart openstack-cinder-api openstack-cinder-scheduler

 

아래 down 은 lvm 설치를 안해서 그렇다.

[root@controller ~]# openstack volume service list

+------------------+-----------------------+------+---------+-------+----------------------------+

| Binary           | Host                  | Zone | Status  | State | Updated At                 |

+------------------+-----------------------+------+---------+-------+----------------------------+

| cinder-scheduler | controller.park.com   | nova | enabled | up    | 2021-02-18T06:32:58.000000 |

| cinder-volume    | network.park.com@lvm  | nova | enabled | down  | 2021-02-18T03:11:59.000000 |

| cinder-volume    | network.park.com@ceph | nova | enabled | up    | 2021-02-18T06:32:59.000000 |

| cinder-backup    | network.park.com      | nova | enabled | up    | 2021-02-18T06:33:02.000000 |

| cinder-volume    | network.park.com@nfs  | nova | enabled | up    | 2021-02-18T06:33:04.000000 |

+------------------+-----------------------+------+---------+-------+----------------------------+

[root@controller ~]# cinder get-pools

+----------+----------------------------------+

| Property | Value                            |

+----------+----------------------------------+

| name     | network.park.com@nfs#Generic_NFS |

+----------+----------------------------------+

+----------+---------------------------+

| Property | Value                     |

+----------+---------------------------+

| name     | network.park.com@ceph#RBD |

+----------+---------------------------+

 

 

 

 

볼륨 생성

[root@controller /]# openstack volume create --type nfs --size 1 nfs2

+---------------------+--------------------------------------+

| Field               | Value                                |

+---------------------+--------------------------------------+

| attachments         | []                                   |

| availability_zone   | nova                                 |

| bootable            | false                                |

| consistencygroup_id | None                                 |

| created_at          | 2021-02-18T03:47:32.000000           |

| description         | None                                 |

| encrypted           | False                                |

| id                  | 76e0ac86-411f-4db8-bf21-5785ab8ec47b |

| migration_status    | None                                 |

| multiattach         | False                                |

| name                | nfs2                                 |

| properties          |                                      |

| replication_status  | None                                 |

| size                | 1                                    |

| snapshot_id         | None                                 |

| source_volid        | None                                 |

| status              | creating                             |

| type                | nfs                                  |

| updated_at          | None                                 |

| user_id             | a883b52024484c30bf09d560aca028d2     |

+---------------------+--------------------------------------+

 

위 명령어에서 type이 없어서 error 난다면 확인 필요

# openstack volume type list

type이 아무것도 없으면 생성해줌
#openstack volume type create nfs

 

[root@controller /]# openstack volume service list

+------------------+-----------------------+------+---------+-------+----------------------------+

| Binary           | Host                  | Zone | Status  | State | Updated At                 |

+------------------+-----------------------+------+---------+-------+----------------------------+

| cinder-scheduler | controller.park.com   | nova | enabled | up    | 2021-02-18T03:47:48.000000 |

| cinder-volume    | network.park.com@lvm  | nova | enabled | down  | 2021-02-18T03:11:59.000000 |

| cinder-volume    | network.park.com@ceph | nova | enabled | up    | 2021-02-18T03:47:49.000000 |

| cinder-backup    | network.park.com      | nova | enabled | up    | 2021-02-18T03:47:50.000000 |

| cinder-volume    | network.park.com@nfs  | nova | enabled | up    | 2021-02-18T03:47:53.000000 |

+------------------+-----------------------+------+---------+-------+----------------------------+

[root@controller /]# openstack volume list

+--------------------------------------+-----------+-----------+------+----------------------------------+

| ID                                   | Name      | Status    | Size | Attached to                      |

+--------------------------------------+-----------+-----------+------+----------------------------------+

| 76e0ac86-411f-4db8-bf21-5785ab8ec47b | nfs2      | available |    1 |                                  |

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use    |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+-----------+------+----------------------------------+

[root@controller /]# openstack server list

+--------------------------------------+---------+--------+------------------------------------+---------+---------+

| ID                                   | Name    | Status | Networks                           | Image   | Flavor  |

+--------------------------------------+---------+--------+------------------------------------+---------+---------+

| f4ef944f-aa3d-4665-a50f-e65a16676bd1 | cirros2 | ACTIVE | int_net=10.1.1.10, x.x.200.204 | cirros1 | m1.tiny |

| b4db5a9b-fc50-46eb-b7e2-b1d6a3fc541b | cirros4 | ACTIVE | int_net=10.1.1.3, x.x.200.220  | cirros4 | m1.tiny |

| 9071c032-1d68-4c45-a1e6-1ef7c80dbbf2 | ciross  | ACTIVE | int_net=10.1.1.24                  | cirros  | m1.tiny |

+--------------------------------------+---------+--------+------------------------------------+---------+---------+

[root@controller /]# openstack volume type list

+--------------------------------------+------+-----------+

| ID                                   | Name | Is Public |

+--------------------------------------+------+-----------+

| e95b8727-a7ce-4daf-bc53-173bbe115517 | nfs  | True      |

+--------------------------------------+------+-----------+

만든 볼륨 서버에 붙임

[root@controller /]# openstack server add volume cirros4 nfs2

[root@controller /]#

[root@controller /]# openstack volume list

+--------------------------------------+-----------+--------+------+----------------------------------+

| ID                                   | Name      | Status | Size | Attached to                      |

+--------------------------------------+-----------+--------+------+----------------------------------+

| 76e0ac86-411f-4db8-bf21-5785ab8ec47b | nfs2      | in-use |    1 | Attached to cirros4 on /dev/vdb  |

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+--------+------+----------------------------------+

[root@controller /]#

 

볼륨 백업할때 vm에 붙어 있으면 에러남

[root@controller /]# openstack volume backup create 76e0ac86-411f-4db8-bf21-5785ab8ec47b --name backup_nfs2

Invalid volume: Backing up an in-use volume must use the force flag. (HTTP 400) (Request-ID: req-33d851e2-d6b1-466a-bb92-fd64a778bdab)

볼륨을 서버에서 제거

[root@controller /]# openstack server remove volume cirros4 nfs2

볼륨 백업

[root@controller /]# openstack volume backup create 76e0ac86-411f-4db8-bf21-5785ab8ec47b --name backup_nfs2

+-------+--------------------------------------+

| Field | Value                                |

+-------+--------------------------------------+

| id    | 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1 |

| name  | backup_nfs2                          |

+-------+--------------------------------------+

[root@controller /]# cinder backup-list

+--------------------------------------+--------------------------------------+----------+-------------+------+--------------+---------------+

| ID                                   | Volume ID                            | Status   | Name        | Size | Object Count | Container     |

+--------------------------------------+--------------------------------------+----------+-------------+------+--------------+---------------+

| 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1 | 76e0ac86-411f-4db8-bf21-5785ab8ec47b | creating | backup_nfs2 | 1    | 0            | volumebackups |

+--------------------------------------+--------------------------------------+----------+-------------+------+--------------+---------------+

[root@controller /]#

[root@controller /]#

[root@controller /]# swift stat

                        Account: AUTH_afe0d5f4a89041f599ec12e5a1685019

                     Containers: 2

                        Objects: 0

                          Bytes: 0

Containers in policy "policy-0": 2

   Objects in policy "policy-0": 0

     Bytes in policy "policy-0": 0

    X-Account-Project-Domain-Id: default

         X-Openstack-Request-Id: txfd84b4f3dc964cedaefe6-00602de759

                    X-Timestamp: 1611045488.90564

                     X-Trans-Id: txfd84b4f3dc964cedaefe6-00602de759

                   Content-Type: application/json; charset=utf-8

                  Accept-Ranges: bytes

[root@controller /]# cinder backup-list

+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+---------------+

| ID                                   | Volume ID                            | Status    | Name        | Size | Object Count | Container     |

+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+---------------+

| 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1 | 76e0ac86-411f-4db8-bf21-5785ab8ec47b | available | backup_nfs2 | 1    | 22           | volumebackups |

+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+---------------+

[root@controller /]# swift list

container1

volumebackups

[root@controller /]# swift list volumebackups

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00001

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00002

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00003

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00004

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00005

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00006

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00007

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00008

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00009

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00010

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00011

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00012

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00013

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00014

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00015

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00016

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00017

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00018

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00019

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00020

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1-00021

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1_metadata

volume_76e0ac86-411f-4db8-bf21-5785ab8ec47b/20210218040359/az_nova_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1_sha256file

[root@controller /]#

[root@controller /]#

[root@controller /]# openstack volume backup list

+--------------------------------------+-------------+-------------+-----------+------+

| ID                                   | Name        | Description | Status    | Size |

+--------------------------------------+-------------+-------------+-----------+------+

| 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1 | backup_nfs2 | None        | available |    1 |

+--------------------------------------+-------------+-------------+-----------+------+

[root@controller /]# openstack volume list

+--------------------------------------+-----------+-----------+------+----------------------------------+

| ID                                   | Name      | Status    | Size | Attached to                      |

+--------------------------------------+-----------+-----------+------+----------------------------------+

| 76e0ac86-411f-4db8-bf21-5785ab8ec47b | nfs2      | available |    1 |                                  |

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use    |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+-----------+------+----------------------------------+

 

볼륨 삭제

[root@controller /]# openstack volume delete 76e0ac86-411f-4db8-bf21-5785ab8ec47b

[root@controller /]# openstack volume list

+--------------------------------------+-----------+--------+------+----------------------------------+

| ID                                   | Name      | Status | Size | Attached to                      |

+--------------------------------------+-----------+--------+------+----------------------------------+

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+--------+------+----------------------------------+

 

볼륨 복구

[root@controller /]# cinder backup-restore 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1

+-------------+-----------------------------------------------------+

| Property    | Value                                               |

+-------------+-----------------------------------------------------+

| backup_id   | 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1                |

| volume_id   | ebff0ca9-c90d-4479-8555-504a6bbb5e89                |

| volume_name | restore_backup_2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1 |

+-------------+-----------------------------------------------------+

[root@controller /]# openstack volume list

+--------------------------------------+-----------+-----------+------+----------------------------------+

| ID                                   | Name      | Status    | Size | Attached to                      |

+--------------------------------------+-----------+-----------+------+----------------------------------+

| ebff0ca9-c90d-4479-8555-504a6bbb5e89 | nfs2      | available |    1 |                                  |

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use    |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+-----------+------+----------------------------------+

볼륨 서버에 add

[root@controller /]# openstack server add volume cirros4 nfs2

[root@controller /]# openstack volume list

+--------------------------------------+-----------+--------+------+----------------------------------+

| ID                                   | Name      | Status | Size | Attached to                      |

+--------------------------------------+-----------+--------+------+----------------------------------+

| ebff0ca9-c90d-4479-8555-504a6bbb5e89 | nfs2      | in-use |    1 | Attached to cirros4 on /dev/vdb  |

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+--------+------+----------------------------------+

[root@controller /]# cinder backup-list

+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+---------------+

| ID                                   | Volume ID                            | Status    | Name        | Size | Object Count | Container     |

+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+---------------+

| 2b2f14b9-5bf9-4d5e-8dd3-4dff01c5fde1 | 76e0ac86-411f-4db8-bf21-5785ab8ec47b | available | backup_nfs2 | 1    | 22           | volumebackups |

+--------------------------------------+--------------------------------------+-----------+-------------+------+--------------+---------------+

 

백업삭제

[root@controller /]# cinder backup-delete backup_nfs2

Request to delete backup backup_nfs2 has been accepted.

[root@controller /]# cinder backup-list

+----+-----------+--------+------+------+--------------+-----------+

| ID | Volume ID | Status | Name | Size | Object Count | Container |

+----+-----------+--------+------+------+--------------+-----------+

+----+-----------+--------+------+------+--------------+-----------+

[root@controller /]# swift stat

                        Account: AUTH_afe0d5f4a89041f599ec12e5a1685019

                     Containers: 2

                        Objects: 0

                          Bytes: 0

Containers in policy "policy-0": 2

   Objects in policy "policy-0": 0

     Bytes in policy "policy-0": 0

    X-Account-Project-Domain-Id: default

         X-Openstack-Request-Id: txc9b3bb7f7a1948d6888e7-00602de999

                    X-Timestamp: 1611045488.90564

                     X-Trans-Id: txc9b3bb7f7a1948d6888e7-00602de999

                   Content-Type: application/json; charset=utf-8

                  Accept-Ranges: bytes

[root@controller /]# swift list

container1

volumebackups

[root@controller /]# swift list volumebackups

[root@controller /]# openstack volume list

+--------------------------------------+-----------+--------+------+----------------------------------+

| ID                                   | Name      | Status | Size | Attached to                      |

+--------------------------------------+-----------+--------+------+----------------------------------+

| ebff0ca9-c90d-4479-8555-504a6bbb5e89 | nfs2      | in-use |    1 | Attached to cirros4 on /dev/vdb  |

| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | in-use |    1 | Attached to cirros2 on /dev/vdb  |

+--------------------------------------+-----------+--------+------+----------------------------------+

[root@controller /]#

확인

 

 

 

instance를 swift로 스냅샷 백업 및 복구

########## controller 에서 구성 #################

 

[root@controller /]# openstack server stop cirros4

[root@controller /]#

[root@controller /]# openstack server list

+--------------------------------------+---------+---------+------------------------------------+---------+---------+

| ID                                   | Name    | Status  | Networks                           | Image   | Flavor  |

+--------------------------------------+---------+---------+------------------------------------+---------+---------+

| f4ef944f-aa3d-4665-a50f-e65a16676bd1 | cirros2 | ACTIVE  | int_net=10.1.1.10, 192.168.200.204 | cirros1 | m1.tiny |

| b4db5a9b-fc50-46eb-b7e2-b1d6a3fc541b | cirros4 | SHUTOFF | int_net=10.1.1.3, 192.168.200.220  | cirros4 | m1.tiny |

| 9071c032-1d68-4c45-a1e6-1ef7c80dbbf2 | ciross  | ACTIVE  | int_net=10.1.1.24                  | cirros  | m1.tiny |

+--------------------------------------+---------+---------+------------------------------------+---------+---------+

[root@controller /]#

[root@controller /]#

[root@controller /]#

[root@controller /]# openstack image list

+--------------------------------------+---------+--------+

| ID                                   | Name    | Status |

+--------------------------------------+---------+--------+

| e553450b-5280-492d-b51a-e82503c3d08f | cirros  | active |

| 35245ade-6adb-49b2-8844-b5ef580f8bd7 | cirros1 | active |

| 0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f | cirros2 | active |

| 1c091f20-2a16-4393-b726-9655da23c662 | cirros4 | active |

+--------------------------------------+---------+--------+

 

 

 

 

[root@controller /]# openstack server image create cirros4 --name ciroos4Snapshot

+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

| Field            | Value                                                                                                                                                                                                                                                                                                                                                   |

+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

| checksum         | None                                                                                                                                                                                                                                                                                                                                                    |

| container_format | None                                                                                                                                                                                                                                                                                                                                                    |

| created_at       | 2021-02-18T05:50:46Z                                                                                                                                                                                                                                                                                                                                    |

| disk_format      | None                                                                                                                                                                                                                                                                                                                                                    |

| file             | /v2/images/6432a3f4-6628-4f68-956f-8e3ef541e4df/file                                                                                                                                                                                                                                                                                                    |

| id               | 6432a3f4-6628-4f68-956f-8e3ef541e4df                                                                                                                                                                                                                                                                                                                    |

| min_disk         | 1                                                                                                                                                                                                                                                                                                                                                       |

| min_ram          | 0                                                                                                                                                                                                                                                                                                                                                       |

| name             | ciroos4Snapshot                                                                                                                                                                                                                                                                                                                                         |

| owner            | afe0d5f4a89041f599ec12e5a1685019                                                                                                                                                                                                                                                                                                                        |

| properties       | base_image_ref='1c091f20-2a16-4393-b726-9655da23c662', boot_roles='member,reader,admin', clean_attempts='1', image_type='snapshot', instance_uuid='b4db5a9b-fc50-46eb-b7e2-b1d6a3fc541b', os_hash_algo='None', os_hash_value='None', os_hidden='False', owner_project_name='admin', owner_user_name='admin', user_id='a883b52024484c30bf09d560aca028d2' |

| protected        | False                                                                                                                                                                                                                                                                                                                                                   |

| schema           | /v2/schemas/image                                                                                                                                                                                                                                                                                                                                       |

| size             | None                                                                                                                                                                                                                                                                                                                                                    |

| status           | queued                                                                                                                                                                                                                                                                                                                                                  |

| tags             |                                                                                                                                                                                                                                                                                                                                                         |

| updated_at       | 2021-02-18T05:50:46Z                                                                                                                                                                                                                                                                                                                                    |

| virtual_size     | None                                                                                                                                                                                                                                                                                                                                                    |

| visibility       | private                                                                                                                                                                                                                                                                                                                                                 |

+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

 

[root@controller ~]# cinder get-pools

+----------+----------------------------------+

| Property | Value                            |

+----------+----------------------------------+

| name     | network.park.com@nfs#Generic_NFS |

+----------+----------------------------------+

+----------+---------------------------+

| Property | Value                     |

+----------+---------------------------+

| name     | network.park.com@ceph#RBD |

+----------+---------------------------+

 

 

[root@controller /]# openstack image list

+--------------------------------------+-----------------+--------+

| ID                                   | Name            | Status |

+--------------------------------------+-----------------+--------+

| 6432a3f4-6628-4f68-956f-8e3ef541e4df | ciroos4Snapshot | active |

| e553450b-5280-492d-b51a-e82503c3d08f | cirros          | active |

| 35245ade-6adb-49b2-8844-b5ef580f8bd7 | cirros1         | active |

| 0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f | cirros2         | active |

| 1c091f20-2a16-4393-b726-9655da23c662 | cirros4         | active |

+--------------------------------------+-----------------+--------+

 

 

[root@controller /]# source ~/glancerc
[root@controller /]# swift list
glance
[root@controller /]# swift list glance
0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f
0d9fa3a4-0b37-4a62-bc51-b1dc87a76d3f-00001
6432a3f4-6628-4f68-956f-8e3ef541e4df
6432a3f4-6628-4f68-956f-8e3ef541e4df-00001
[root@controller /]# swift stat

 

이미지 파일로 떨굼

[root@controller /]# source ~/keystonerc

[root@controller /]# openstack image save --file ciroos4Snapshot.raw 6432a3f4-6628-4f68-956f-8e3ef541e4df

[root@controller /]# du -sh ciroos4Snapshot.raw

40M     ciroos4Snapshot.raw

 

 

instance를  스냅샷 사용

#source ~/keystonerc

[root@controller ~]# openstack server create --flavor m1.tiny --image ciroos4Snapshot --security-group provider --nic net-id=bf4dcb31-f3dc-4b7f-ada9-1dd91ac22f22 cirros4-snap

[root@controller ~]# openstack server list

[root@controller ~]# openstack image list