Author Topic: cinder volume show stuck on deleting state how to delete it ?  (Read 2899 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
cinder volume show stuck on deleting state how to delete it ?
« on: กุมภาพันธ์ 07, 2018, 01:19:56 PM »
วันนี้เจอเคส ลบ volume ตัวหนึ่งใน cinder ไม่ออก และค้างอยู่ที่ deleting state นานอยู่หลายชั่วโมง
ทั้งๆก็แค่ 10GB เองครับ ปกติไม่ควรนานเกิน 5 นาที ฮ่าๆ
หลังจาก debug ดูพบว่า cinder-volume นั้นเปลี่ยนชื่อ block storage ไป ครับ

cinder volume show stuck on deleting state how to delete it ?

If the volume is in ‘in-use’ status, you first have to change to an available status though before you can issue a delete:

1. cinder reset-state --state available $VOLUME_ID
2. cinder delete $VOLUME_ID

If ‘cinder delete’ doesn’t work and you have admin privileges, you can try force-delete.

#cinder force-delete $VOLUME_ID
But may be that will fix it. May be it will not. If the volume is still stuck, try going to the database and setting the status of the volume to a detached state:

#update volume_attachment set attach_status="detached" where id="<attachment_id>";
#update volumes set attach_status="detached" where id="<volume_id>";

Once I did that, I was able to delete or force-delete any stuck volumes.
Thank : http://sacharya.com/deleting-stuck-cinder-volumes/