Storage - leoswaldo/ciao GitHub Wiki
Potential Storage Use Cases
- User creates volume ahead and attach at launch
- User creates volume ahead and attaches later
- Boot from volume
- Create automatcially at launch time using cloud init
- Detach volume
- Destroy volume
- Destroy when VM exits
Initial implementation will utilize ceph. ISCSI will be supported later.
Initially Supported Use Cases / Usage Flows
Attach pre-created volume at launch
Expectation is this should be easy to implement and will follow easily after the next case. The implementation will include changes to:
- Controller
- Verify user permission
- Get image URI
- Create workload yaml with image URI included
- Launcher
- Insure volume is attachable (eg: local rbd commands)
- Pass volume as qemu command line argument, if vm workload
- Local mount of volume and pass volume as fs overlay, if container workload
Attach pre-created volume after launch
This is harder to implement than attachment of a volume ahead of workload launch. We'll focus on implementing it first. The implementation will include changes to:
- Controller
- Verify user permission
- request will be made by UI using the /v2.1/{tenant_id}/servers/{server_id}/os-volume_attachments endpoint
- ssntp command dispatched to node hosting the workload
- Scheduler
- routes ssntp command to node hosting the workload
- Launcher
- send qemu QMP commands for volume attachment (needs qemu >= 2.5?), if vm workload
- ???, if container workload
Setup of Your Dev Environment for ceph
The easiest way to get going with ceph is to run a ceph cluster in a container on your dev box.
-
Start the docker ceph/demo image: Run
docker run -d --net=host -v /etc/ceph:/etc/ceph -e MON_IP=10.0.1.4 -e CEPH_PUBLIC_NETWORK=10.0.1.0/24 ceph/demo
. If your IP address changes, you need to delete /etc/ceph before restarting the container. -
Add a ciao user: Run
ceph auth get-or-create client.ciao -o /etc/ceph/ceph.client.ciao.keyring mon 'allow *' osd 'allow *' mds 'allow'
Ciao specific ceph configuration (to be implemented):
- Configure the ciao-storage block driver to use the location of the ceph keyring and ID.
- Controller and launcher will need to pass this information to the ciao-storage block driver at init time.