Services like Ironic want to use Cinder w/o Nova. Also it would be useful to attach Cinder volumes not only for Nova/Ironic instances: e.g. make simple CLI to attach volume to some host (VM, workstation, etc) outside OpenStack cloud.
Currently there is not a tool which could automate all the attach/detach process without using Nova.
Provide a command-line (CLI) tool and Python API which could interact with Cinder and attach volumes to the local host. It will be implemented as python-cinderclient extension and won’t require to add any dependency if extension is not used. This extension won’t be installed by default. Users will be able to install it using PIP or OS package management tool:
pip install python-brick-cinderclient-ext
CLI interface e.g.:
cinder local-attach <volume_id> cinder local-detach [--attachment-id attachment-id] <volume_id> cinder get-connector
In case of Ironic when we don’t want to install any package into the user’s instances. Users could install package themselves via pip or OS package managers (apt, yum, etc.).
After this command cinder client will call Cinder API to change volume status to ‘in-use’ because we don’t know when user will attach volume to the host.
cinder local-attach [--mountpoint /mnt/disk] [--multipath True] [--enforce-multipath True] [--mode rw] <volume_id>
cinder local-detach [--attachment-id id] [--multipath True] [--enforce-multipath True] [--device-info device-info] <volume_id>
‘attachment_uuid’ is required option only for multi-attachment scenario.
Detach procedure should contain the following steps:
Force detach feature is out of scope of this spec and will be described in a separate spec.
Get connector details:
Since mount/unmount is admin only operation we need to run python-cinderclient as root to not add oslo.rootwrap dependency.
This change will provide new CLI options and Python for python-cinderclient.
User manual will be updated to contain information about python-cinderclient extension.