Today's discussion cinder how to delete volume.
A volume with a status of Available can be deleted. If volume is currently attach to instance, it needs to be detach before delete.
The delete operation is relatively simple and the flowchart is as follows:
Send Delete request to Cinder-api
Cinder-api sending messages
Cinder-volume performing a delete operation
Let's discuss each step in detail below.
Send Delete request to Cinder-api
The customer (which can be an OpenStack end user, or another program) sends a request to Cinder-api: "Delete the specified volume.
Here we will delete volume "Vol-2"
Enter the GUI operation menu, Compute, Project, Volumes.
Select Volume "Vol-2" and click "Delete Volume".
Confirm again.
CINDER-API will receive a request for the delete volume. The log file is in/opt/stack/logs/c-api.log.
Cinder-api sending Messages
CINDER-API sends a message delete message. CINDER-API does not print the log that sends the message, only the source code to view the/opt/stack/cinder/cinder/volume/api.py, the method is extend.
Cinder-volume Delete Volume
Cinder-volume executes the lvremove command Delete volume. The log is/opt/stack/logs/c-vol.log.
What's interesting here is thatCinder-volume performs a "safe" removal . The so-called "security" is actually erasing the data in volume, and LVM driver uses the DD operation to zero the LV's data. The logs are as follows:
Then delete the LV.
The above is the analysis of delete volume, the next section we discuss the snapshot operation.
Delete Volume operation-5 minutes a day to play OpenStack (57)