Project

General

Profile

Actions

Task #6900

closed

Task #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

Added by Nico Schottelius over 5 years ago. Updated 9 months ago.

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


Related issues 1 (0 open1 closed)

Related to Open Infrastructure - Task #6904: Implement ucloud-image-store managementRejected06/29/2019

Actions
Actions #1

Updated by Ahmed Bilal over 5 years ago

  • Status changed from New to Seen
Actions #2

Updated by Nico Schottelius over 5 years ago

  • Related to Task #6904: Implement ucloud-image-store management added
Actions #3

Updated by Nico Schottelius over 5 years ago

  • Description updated (diff)
Actions #4

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

Actions #5

Updated by Ahmed Bilal over 5 years ago

  • Status changed from Seen to In Progress
Actions #6

Updated by Ahmed Bilal over 5 years ago

  • Status changed from In Progress to Feedback
Actions #7

Updated by Ahmed Bilal about 5 years ago

  • Status changed from Feedback to In Progress
Actions #8

Updated by Ahmed Bilal almost 4 years ago

  • Assignee deleted (Ahmed Bilal)
Actions #9

Updated by Nico Schottelius 9 months ago

  • Status changed from In Progress to Rejected
Actions

Also available in: Atom PDF