Snapshot 可以为 volume 创建快照,快照中保存了 volume当前的状态,以后可以通过snapshot 回溯。snapshot操作比较简单,流程图如下:
 
 
 
1、向 cinder-api 发送Snapshot请求
2、cinder-api发送消息
3、cinder-volume执行snapshot操作
 
 
[root@DevStack-Rocky-Controller-21 ~]# lvdisplay stack-volumes-lvmdriver-1
  --- Logical volume ---
  LV Name                stack-volumes-lvmdriver-1-pool
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                v2e1XT-EMCl-K8uo-CJsX-mPzs-hM2C-OAGMQg
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-06-11 19:18:14 +0800
  LV Pool metadata       stack-volumes-lvmdriver-1-pool_tmeta
  LV Pool data           stack-volumes-lvmdriver-1-pool_tdata
  LV Status              available
  # open                 3
  LV Size                22.80 GiB
  Allocated pool data    0.17%
  Allocated metadata     0.67%
  Current LE             5837
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:5
   
  --- Logical volume ---
  LV Path                /dev/stack-volumes-lvmdriver-1/volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  LV Name                volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                gNIbdc-CY8b-uqjg-vWZs-U3fp-t4J7-onYFr6
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-07-01 20:42:09 +0800
  LV Pool name           stack-volumes-lvmdriver-1-pool
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Mapped size            3.83%
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:7
   
  --- Logical volume ---
  LV Path                /dev/stack-volumes-lvmdriver-1/volume-45717894-ccb6-49d3-a3ca-337e3667731c
  LV Name                volume-45717894-ccb6-49d3-a3ca-337e3667731c
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                XbwNeV-zMQ0-t1M8-OAuS-Hq1Z-dL1N-Tvx1Yq
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-07-01 20:42:13 +0800
  LV Pool name           stack-volumes-lvmdriver-1-pool
  LV Thin origin name    volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Mapped size            3.83%
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:8
   
 
 
 
这里我们看到界面提示当前volume已经attach到某个Instance,创建snapshot可能导致数据不一致。我们可以先pause Instance,或者确认当前Instance 没有大量的磁盘IO,处于相对稳定的状态,则可以创建snapshot,否则还是建议先detach volume 再做snapshot。
 
 
 
[root@DevStack-Rocky-Controller-21 ~]# lvdisplay stack-volumes-lvmdriver-1
  --- Logical volume ---
  LV Name                stack-volumes-lvmdriver-1-pool
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                v2e1XT-EMCl-K8uo-CJsX-mPzs-hM2C-OAGMQg
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-06-11 19:18:14 +0800
  LV Pool metadata       stack-volumes-lvmdriver-1-pool_tmeta
  LV Pool data           stack-volumes-lvmdriver-1-pool_tdata
  LV Status              available
  # open                 3
  LV Size                22.80 GiB
  Allocated pool data    0.17%
  Allocated metadata     0.67%
  Current LE             5837
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:5
   
  --- Logical volume ---
  LV Path                /dev/stack-volumes-lvmdriver-1/volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  LV Name                volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                gNIbdc-CY8b-uqjg-vWZs-U3fp-t4J7-onYFr6
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-07-01 20:42:09 +0800
  LV Pool name           stack-volumes-lvmdriver-1-pool
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Mapped size            3.83%
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:7
   
  --- Logical volume ---
  LV Path                /dev/stack-volumes-lvmdriver-1/volume-45717894-ccb6-49d3-a3ca-337e3667731c
  LV Name                volume-45717894-ccb6-49d3-a3ca-337e3667731c
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                XbwNeV-zMQ0-t1M8-OAuS-Hq1Z-dL1N-Tvx1Yq
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-07-01 20:42:13 +0800
  LV Pool name           stack-volumes-lvmdriver-1-pool
  LV Thin origin name    volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Mapped size            3.83%
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:8
   
  --- Logical volume ---
  LV Path                /dev/stack-volumes-lvmdriver-1/_snapshot-6589c650-8d85-4495-8e3d-93d2c3f04c51
  LV Name                _snapshot-6589c650-8d85-4495-8e3d-93d2c3f04c51
  VG Name                stack-volumes-lvmdriver-1
  LV UUID                ZtIrYn-ioyR-Rfn8-8Uax-urLn-KKE5-Xoxbnt
  LV Write Access        read/write
  LV Creation host, time DevStack-Rocky-Controller-21, 2019-07-02 20:31:24 +0800
  LV Pool name           stack-volumes-lvmdriver-1-pool
  LV Thin origin name    volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73
  LV Status              NOT available
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
 
cinder-volume 执行 lvcreate 创建 snapshot
 
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] POST http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/snapshots
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: DEBUG cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Action: 'create', calling method: create, body: {"snapshot": {"description": "", "metadata": {}, "force": true, "name": "snap-01", "volume_id": "06984f3c-44e1-42a5-b03c-08a0cfa19f73"}} {{(pid=21071) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:869}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.volume.api [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Volume info retrieved successfully.
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.v2.snapshots [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Create snapshot from volume 06984f3c-44e1-42a5-b03c-08a0cfa19f73
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: DEBUG cinder.quota [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Created reservations ['0f75ca2a-d47c-4005-8859-221e553ea890', '1787c063-b59f-45c6-a2c6-0d983a73caf3', '2393b16d-b008-44f8-af30-b80c8b7c5611', '645559d2-24b9-4974-b1d6-9ca71936e267'] {{(pid=21071) reserve /opt/stack/cinder/cinder/quota.py:1029}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.volume.api [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Snapshot force create request issued successfully.
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/snapshots returned with HTTP 202
 
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.host_manager [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Updating capabilities for DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1: {u'pool_name': u'lvmdriver-1', u'filter_function': None, u'goodness_function': None, u'multiattach': True, u'total_volumes': 3, u'provisioned_capacity_gb': 2.0, 'timestamp': datetime.datetime(2019, 7, 2, 12, 31, 3, 194910), u'allocated_capacity_gb': 2, 'volume_backend_name': u'lvmdriver-1', u'thin_provisioning_support': True, u'free_capacity_gb': 22.76, 'driver_version': u'3.0.0', u'location_info': u'LVMVolumeDriver:DevStack-Rocky-Controller-21:stack-volumes-lvmdriver-1:thin:0', u'total_capacity_gb': 22.8, u'thick_provisioning_support': False, u'reserved_percentage': 0, u'QoS_support': False, u'max_over_subscription_ratio': u'20.0', 'vendor_name': u'Open Source', 'storage_protocol': u'iSCSI', u'backend_state': u'up'} {{(pid=21820) update_from_volume_capability /opt/stack/cinder/cinder/scheduler/host_manager.py:358}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.host_manager [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Updating capabilities for DevStack-Rocky-Compute-22@lvmdriver-1lvmdriver-1: {u'pool_name': u'lvmdriver-1', u'filter_function': None, u'goodness_function': None, u'multiattach': True, u'total_volumes': 1, u'provisioned_capacity_gb': 0.0, 'timestamp': datetime.datetime(2019, 7, 2, 12, 30, 47, 114948), u'allocated_capacity_gb': 0, 'volume_backend_name': u'lvmdriver-1', u'thin_provisioning_support': True, u'free_capacity_gb': 22.8, 'driver_version': u'3.0.0', u'location_info': u'LVMVolumeDriver:DevStack-Rocky-Compute-22:stack-volumes-lvmdriver-1:thin:0', u'total_capacity_gb': 22.8, u'thick_provisioning_support': False, u'reserved_percentage': 0, u'QoS_support': False, u'max_over_subscription_ratio': u'20.0', 'vendor_name': u'Open Source', 'storage_protocol': u'iSCSI', u'backend_state': u'up'} {{(pid=21820) update_from_volume_capability /opt/stack/cinder/cinder/scheduler/host_manager.py:358}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.base_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Starting with 2 host(s) {{(pid=21820) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:95}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.base_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Filter AvailabilityZoneFilter returned 2 host(s) {{(pid=21820) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:125}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filters.capacity_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Checking if host DevStack-Rocky-Compute-22@lvmdriver-1lvmdriver-1 can create a 1 GB volume (None) {{(pid=21820) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:62}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filters.capacity_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Checking provisioning for request of 1 GB. Backend: host 'DevStack-Rocky-Compute-22@lvmdriver-1lvmdriver-1':free_capacity_gb: 22.8, total_capacity_gb: 22.8,allocated_capacity_gb: 0, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 0.0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2019-07-02 12:30:47.114948 {{(pid=21820) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:134}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filters.capacity_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Space information for volume creation on host DevStack-Rocky-Compute-22@lvmdriver-1lvmdriver-1 (requested / avail): 1/22.8 {{(pid=21820) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:172}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filters.capacity_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Checking if host DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1 can create a 1 GB volume (None) {{(pid=21820) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:62}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filters.capacity_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Checking provisioning for request of 1 GB. Backend: host 'DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1':free_capacity_gb: 22.76, total_capacity_gb: 22.8,allocated_capacity_gb: 2, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 2.0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2019-07-02 12:31:03.194910 {{(pid=21820) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:134}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filters.capacity_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Space information for volume creation on host DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1 (requested / avail): 1/22.76 {{(pid=21820) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:172}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.base_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Filter CapacityFilter returned 2 host(s) {{(pid=21820) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:125}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.base_filter [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Filter CapabilitiesFilter returned 2 host(s) {{(pid=21820) get_filtered_objects /opt/stack/cinder/cinder/scheduler/base_filter.py:125}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.filter_scheduler [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Filtered [host 'DevStack-Rocky-Compute-22@lvmdriver-1lvmdriver-1':free_capacity_gb: 22.8, total_capacity_gb: 22.8,allocated_capacity_gb: 0, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 0.0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2019-07-02 12:30:47.114948, host 'DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1':free_capacity_gb: 22.76, total_capacity_gb: 22.8,allocated_capacity_gb: 2, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 2.0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2019-07-02 12:31:03.194910] {{(pid=21820) _get_weighted_candidates /opt/stack/cinder/cinder/scheduler/filter_scheduler.py:342}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.base_weight [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Weigher CapacityWeigher returned, weigher value is {max: 456.0, min: 454.0} {{(pid=21820) get_weighed_objects /opt/stack/cinder/cinder/scheduler/base_weight.py:153}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.host_manager [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Weighed [WeighedHost [host: DevStack-Rocky-Compute-22@lvmdriver-1lvmdriver-1, weight: 1.0], WeighedHost [host: DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1, weight: 0.0]] {{(pid=21820) get_weighed_backends /opt/stack/cinder/cinder/scheduler/host_manager.py:500}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-scheduler: DEBUG cinder.scheduler.host_manager [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Consumed 1 GB from backend: host 'DevStack-Rocky-Controller-21@lvmdriver-1lvmdriver-1':free_capacity_gb: 21.76, total_capacity_gb: 22.8,allocated_capacity_gb: 3, max_over_subscription_ratio: 20.0,reserved_percentage: 0, provisioned_capacity_gb: 3.0,thin_provisioning_support: True, thick_provisioning_support: False,pools: None,updated at: 2019-07-02 12:31:23.800880 {{(pid=21820) consume_from_volume /opt/stack/cinder/cinder/scheduler/host_manager.py:316}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] GET http://10.12.30.21/volume//
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: DEBUG cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Empty body provided in request {{(pid=21071) get_body /opt/stack/cinder/cinder/api/openstack/wsgi.py:718}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: DEBUG cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Calling method 'all' {{(pid=21071) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:872}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] http://10.12.30.21/volume// returned with HTTP 300
Jul  2 20:31:23 DevStack-Rocky-Controller-21 cinder-volume: DEBUG oslo_concurrency.processutils [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvs --noheadings --unit=g -o vg_name,name,size --nosuffix stack-volumes-lvmdriver-1/volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73 {{(pid=22852) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:372}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] GET http://10.12.30.21/volume//
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: DEBUG cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Empty body provided in request {{(pid=21071) get_body /opt/stack/cinder/cinder/api/openstack/wsgi.py:718}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: DEBUG cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] Calling method 'all' {{(pid=21071) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:872}}
Jul  2 20:31:23 DevStack-Rocky-Controller-21 devstack@c-api.service: INFO cinder.api.openstack.wsgi [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin admin] http://10.12.30.21/volume// returned with HTTP 300
Jul  2 20:31:24 DevStack-Rocky-Controller-21 cinder-volume: DEBUG oslo_concurrency.processutils [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] CMD "sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvs --noheadings --unit=g -o vg_name,name,size --nosuffix stack-volumes-lvmdriver-1/volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73" returned: 0 in 0.266s {{(pid=22852) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409}}
Jul  2 20:31:24 DevStack-Rocky-Controller-21 cinder-volume: DEBUG oslo_concurrency.processutils [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate --name _snapshot-6589c650-8d85-4495-8e3d-93d2c3f04c51 --snapshot stack-volumes-lvmdriver-1/volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73 {{(pid=22852) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:372}}
Jul  2 20:31:24 DevStack-Rocky-Controller-21 cinder-volume: DEBUG oslo_concurrency.processutils [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] CMD "sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate --name _snapshot-6589c650-8d85-4495-8e3d-93d2c3f04c51 --snapshot stack-volumes-lvmdriver-1/volume-06984f3c-44e1-42a5-b03c-08a0cfa19f73" returned: 0 in 0.571s {{(pid=22852) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409}}
Jul  2 20:31:24 DevStack-Rocky-Controller-21 cinder-volume: INFO cinder.volume.manager [None req-c5bdbbaa-7c70-406c-9259-5a68f5d6dc9d admin None] Create snapshot completed successfully
 
有了snapshot,我们就可以 将 volume 回溯到创建snapshot时的状态。方法是通过snapshot创建新的 volume,新创建的volume 容量必须大于或者等于snapshot的容量。
 
 
如果一个volume存在snapshot,则这个volume是无法删除的,这是因为snapshot依赖于volume,snapshot无法独立存在。在LVM作为volume provider 的环境中,snapshot是从源volume完全copy来的,所以这种依赖关系不强。但在其他volume provider (比如商业存储设备或者分布式文件系统),snapshot通常是源volume创建快照时数据状态的一个引用(指针),占用空间非常小,在这种实现方式里snapshot对源volume的依赖就非常明显。
 
 

O058、Snapshot Volume 操作的更多相关文章

  1. Snapshot Volume 操作 - 每天5分钟玩转 OpenStack(58)

    Snapshot 可以为 volume 创建快照,快照中保存了 volume 当前的状态,以后可以通过 snapshot 回溯.snapshot 操作实现比较简单,流程图如下: 向 cinder-ap ...

  2. Detach Volume 操作 - 每天5分钟玩转 OpenStack(55)

    上一节我们成功地通过 attach 操作为 instance 添加了 volume,而与之相对的操作是 detach,就是将 volume 从 instance 上卸载下来. 下图是 Detach 操 ...

  3. Create Volume 操作(Part I) - 每天5分钟玩转 OpenStack(50)

    前面已经学习了 Cinder 的架构和相关组件,从本节我们开始详细分析 Cinder 的各种操作,首先讨论 Cinder 如何创建 volume. Create 操作流程如下: 客户(可以是 Open ...

  4. O050、Create Volume 操作 (Part I)

    参考https://www.cnblogs.com/CloudMan6/p/5603312.html   前面已经学习了Cinder的架构和相关组件,从本节开始详细分析 Cinder 的各种操作,首先 ...

  5. Backup Volume 操作 - 每天5分钟玩转 OpenStack(59)

    本节我们讨论 volume 的 Backup 操作. Backup 是将 volume 备份到别的地方(备份设备),将来可以通过 restore 操作恢复. Backup VS Snapshot 初看 ...

  6. Delete Volume 操作 - 每天5分钟玩转 OpenStack(57)

    今天讨论 cinder 如何删除 volume . 状态为 Available 的 volume 才能够被 delete.如果 volume 当前已经 attach 到 instance,需要先 de ...

  7. O059、Backup Volume 操作

    参考https://www.cnblogs.com/CloudMan6/p/5662236.html   BackUp是将Volume备份到别的地方(备份设备),将来可以通过restore操作恢复. ...

  8. Restore Volume 操作 - 每天5分钟玩转 OpenStack(60)

    前面我们 backup 了 voluem,今天我们将讨论如何 restore volume. restore 的过程其实很简单,两步走: 在存储节点上创建一个空白 volume. 将 backup 的 ...

  9. Extend Volume 操作 - 每天5分钟玩转 OpenStack(56)

    前面我们讨论了 volume 的 attach 和 detach 操作,今天讨论如何扩大 volume 的容量.为了保护现有数据,cinder 不允许缩小 volume. Extend 操作用于扩大 ...

随机推荐

  1. data binding 优缺点

    文章: 1. [译文] 我不使用Android Data Binding的四个理由 https://www.jianshu.com/p/559adeaaeffd 2. 原文:https://blog. ...

  2. MySQL的分页查询及Oracle分页查询

    MySQL: Select ... from ...where ...order by...limit start,pageNum 例:比如从 取 个数据 , String sql = )*pageR ...

  3. handler四元素

    Looper 一个线程可以产生一个Looper对象,由它来管理此线程里的MessageQueue(消息队列). 我们知道一个线程是一段可执行的代码,当可执行代码执行完成后,线程生命周期便会终止,线程就 ...

  4. HttpURLConnection 多线程下载

    影响下载的速度 * 宽带的带宽 * 服务器的限制 * 服务器的资源固定,开启的线程越多抢占的资源就越多 import java.io.InputStream; import java.io.Rando ...

  5. ssm整合用到的依赖jar包(不充足)

    <!--spring 的核心的jar包--><dependency> <groupId>org.springframework</groupId> &l ...

  6. Data - 大数据分析学习之路

    一.大数据分析的五个基本方面 可视化分析 大数据分析的使用者有大数据分析专家,同时还有普通用户,但是他们二者对于大数据分析最基本的要求就是可视化分析,因为可视化分析能够直观的呈现大数据特点,同时能够非 ...

  7. maven-插件地址

    Maven官方有两个插件列表, 第一个列表的GroupId 为 org.apache.maven.plugins,这里的插件最为成熟,具体地址为:http://maven.apache.org/plu ...

  8. powerDesigner关联数据库显示中文注释

    最近使用powerdesigner,遇到些问题,记录一下[安装过程就略过了] 一.安装odbc驱动 分享下驱动,百度网盘链接:https://pan.baidu.com/s/1UYPq_PEQkDOJ ...

  9. 安装networking-sfc

    申明: 主参考:https://docs.openstack.org/networking-sfc/queens/ 辅参考: https://blog.csdn.net/linshenyuan1213 ...

  10. Prometheus + Grafana 监控 Redis

    Prometheus安装 .linux-amd64.tar.gz .linux-amd64. cd /prometheus # Start Prometheus. # By default, Prom ...