Removing a Block Device from a VM
This operation enables you to remove a block device from a VM.
Prerequisites
At least one VM instance has been created in the storage system and block devices have been added.
Procedure
- Go to the CLI.
- Run the remove virtual_machine block vm_id=? block_id_list=? command.Table 7-11 describes the related parameters.Table 7-11 Parameters for removing a block from a VM
Parameter
Description
Value
vm_id=?
ID of a VM.
To obtain the value, run the show virtual_machine general command without parameters.
block_id_list=?
List of block device IDs.
To obtain the value, run the show virtual_machine block vm_id=? command with parameter vm_id. When multiple blocks need to be removed, separate the block IDs with commas(,) or range separated by hyphens(-). For example, block_id_list=1-5,7,9-11.
- Confirm that all required parameters are correctly configured.
Example
Remove block devices from a VM.
admin:/>remove virtual_machine block vm_id=1 block_id_list=2,3
WARNING: You are about to remove the selected blocks mapped to a virtual machine. This operation will cause the virtual machine unable to access these blocks.
Suggestion: Before performing this operation, ensure that you have selected the correct virtual machine and blocks.
Have you read warning message carefully?(y/n)y
Are you sure you really want to perform the operation?(y/n)y
Remove block 2 successfully.
Remove block 3 successfully.