Actions
Task #6900
closedTask #6869: Challenge OpenStack and OpenNebula with ucloud
Task #6897: Create ucloud-image service
Allow creating an image from a file in ucloud-api and ucloud-cli
Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/28/2019
Due date:
% Done:
0%
Estimated time:
PM Check date:
Description
Objective¶
Users can upload files. Files can be used as images for VMs, if they are in the qcow2 format.
How it works¶
- Files are uploaded to a specific VM (likely files.datacenterlight.ch)
- Users can use the ucloud-cli to convert a file to an image
CLI¶
- ucloud image-create-from-file --uuid $UUID --name <name-of-the-image> --image-store <name> [--desc "optional description"] [--public]
- if --public is passed, the image is public
- do not implement --public before v2
- for --public we need to clarify how is paying for the storage
- Need to specify the name of the image store; OR we use the UUID (persisten!) of the image store
- ucloud image-set-permission [--public|--private]
- makes image public or private
- do not implement before v2
API¶
The API modifies entries in etcd as follows:
- Finds the file in etcd
- if it does not exist -> error out
- Only accept "sane" filenames (i.e. no .. and funky stuff)
- Creates an image entry below /v1/image/$UUID
- maybe the same UUID as the file OR a random UUID - to be discussed in ucloud channel
- JSON: set status on create to "TO_BE_CREATED", needs to include "owner" field
Cron job on files.datacenterlight.ch¶
- Scans all entries in /v1/image
- If there is a json with TO_BE_CREATED
- Look for the filename below basepath/$owner/$filename
- If it is not there, error out
- If image is found
- Verify that it is qcow2 format (file or qemu-img)
- Convert it to raw and import it into ceph
- qemu-img convert ... | rbd import ...
-> ping @llnu for a test ceph cluster to try this out
Actions