08.存儲Cinder→5.場景學習→06.Delete Volume

背景:
  1. 狀態爲 Available 的 volume 纔可以被 delete
  2. 若是 volume 當前已經 attach 到 instance,須要先 detach 後才能 delete。
描述 詳細
  1. 向 cinder-api 發送 delete 請求
    1. 客戶(能夠是 OpenStack 最終用戶,也能夠是其餘程序)向 cinder-api 發送請求:「請 delete 指定的 volume。」
    2. 這裏咱們將 delete volume 「vol-1」。進入 GUI 操做菜單 Project -> Volumes -> Volumes。



  1. cinder-api 將接收到 delete volume 的請求。查看c-api日誌文件:
1
2
3
4
5
Jun 20 19:30:25 controller devstack@c-api.service[31309]: 
INFO cinder.api.openstack.wsgi 
[None req-03b18f0a-eee4-4855-ad8c-a0dfc4fa068f admin admin] 
DELETE http://172.16.1.17/volume/v3/51743f081cb7477f9a1f4ccdf6490d8e/
volumes/f0a54ac7-5423-4794-8883-d753f6a903cd
1
2
3
4
Jun 20 19:30:25 controller devstack@c-api.service[31309]: 
INFO cinder.api.v3.volumes 
[None req-03b18f0a-eee4-4855-ad8c-a0dfc4fa068f admin admin] 
Delete volume with id: f0a54ac7-5423-4794-8883-d753f6a903cd
  1. cinder-api 發送消息
    1. cinder-api 發送消息 delete 消息。cinder-api 沒有打印發送消息的日誌,只能經過源代碼查看 /opt/stack/cinder/cinder/volume/api.py,方法爲 delete。
  1. cinder-volume delete volume
    1. cinder-volume 執行 lvremove 命令 delete volume
1
2
3
4
5
6
Jun 20 19:30:27 controller cinder-volume[304]: 
DEBUG oslo_concurrency.processutils 
[None req-03b18f0a-eee4-4855-ad8c-a0dfc4fa068f admin None] 
CMD "sudo cinder-rootwrap /etc/cinder/rootwrap.conf lvremove --config activation { retry_deactivation = 1} 
 -f stack-volumes-lvmdriver-1/volume-f0a54ac7-5423-4794-8883-d753f6a903cd" returned: 0 in 1.107s 
{{(pid=460) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:409
1
2
3
4
Jun 20 19:30:27 controller cinder-volume[304]: I
NFO cinder.volume.drivers.lvm 
[None req-03b18f0a-eee4-4855-ad8c-a0dfc4fa068f admin None] 
Successfully deleted volume: f0a54ac7-5423-4794-8883-d753f6a903cd
相關文章
相關標籤/搜索