Project

General

Profile

Bug #23131 ยป Shrinking_of_image_without_warning.txt

Debashis Mondal, 02/26/2018 04:58 AM

 





[root@controller ~(keystone_admin)]# glance image-create --name "Test5" --disk-format qcow2 --container-format bare --visibility public --file cirros-0.3.4-x86_64-disk.qcow2
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 56730d3091a764d5f8b38feeef0bfcef |
| container_format | bare |
| created_at | 2017-09-19T13:48:01Z |
| disk_format | qcow2 |
| id | ab96b1ad-1c87-4900-a5aa-9b63ac3e7284 |
| min_disk | 0 |
| min_ram | 0 |
| name | Test5 |
| owner | df503b76d47b4bc1bbbcf14e8a68c5a8 |
| protected | False |
| size | 41126400 |
| status | active |
| tags | [] |
| updated_at | 2017-09-19T13:48:07Z |
| virtual_size | None |
| visibility | public |
+------------------+--------------------------------------+

===================================================================================================
[root@ceph-server ~]# rbd ls images -l
NAME SIZE PARENT FMT PROT LOCK
ab96b1ad-1c87-4900-a5aa-9b63ac3e7284 40162k 2
ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap 40162k 2 yes
[root@ceph-server ~]# rbd resize --size 20 --allow-shrink images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284
Resizing image: 100% complete...done.
[root@ceph-server ~]# rbd ls images -l
NAME SIZE PARENT FMT PROT LOCK
ab96b1ad-1c87-4900-a5aa-9b63ac3e7284 20480k 2
ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap 40162k 2 yes
[root@ceph-server ~]# rbd snap create images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap1
[root@ceph-server ~]# rbd snap remove images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap1
[root@ceph-server ~]# rbd snap remove images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap
rbd: snapshot 'snap' is protected from removal.
2017-09-19 19:21:03.011080 7fcb6d154d80 -1 librbd::Operations: snapshot is protected
[root@ceph-server ~]# rbd snap unprotect images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap
[root@ceph-server ~]# rbd snap remove images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap
[root@ceph-server ~]# rbd snap create images/ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap
[root@ceph-server ~]# rbd ls images -l
NAME SIZE PARENT FMT PROT LOCK
ab96b1ad-1c87-4900-a5aa-9b63ac3e7284 20480k 2
ab96b1ad-1c87-4900-a5aa-9b63ac3e7284@snap 20480k 2
[root@ceph-server ~]#
=================================================================================

[root@controller ~(keystone_admin)]# glance image-download ab96b1ad-1c87-4900-a5aa-9b63ac3e7284 --file /root/debashis7 <================ CLI is hanged during download
^C... terminating glance client
    (1-1/1)