Project

General

Profile

Task #6900

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 4 months ago. Updated 3 months ago.

Status:
In Progress
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 ll nu for a test ceph cluster to try this out


Related issues

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

Actions

History

#1

Updated by Ahmed Bilal 4 months ago

  • Status changed from New to Seen
#2

Updated by Nico Schottelius 4 months ago

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

Updated by Nico Schottelius 4 months ago

  • Description updated (diff)
#4

Updated by Ahmed Bilal 4 months 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 ll nu 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

#5

Updated by Ahmed Bilal 3 months ago

  • Status changed from Seen to In Progress
#6

Updated by Ahmed Bilal 3 months ago

  • Status changed from In Progress to Feedback
#7

Updated by Ahmed Bilal 3 months ago

  • Status changed from Feedback to In Progress

Also available in: Atom PDF