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
Updated by Nico Schottelius over 5 years ago
- Related to Task #6904: Implement ucloud-image-store management added
Updated by Ahmed Bilal over 5 years ago
Nico Schottelius wrote:
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
Instead of image-create-from-file sub-command, the sub-command would be create-image-from-file
Updated by Ahmed Bilal over 5 years ago
- Status changed from In Progress to Feedback
Updated by Ahmed Bilal about 5 years ago
- Status changed from Feedback to In Progress
Updated by Nico Schottelius 9 months ago
- Status changed from In Progress to Rejected
Actions