package
0.0.0-20240905033552-c50090bf3da5
Repository: https://github.com/tinkerbell/actions.git
Documentation: pkg.go.dev

# README

image2disk

quay.io/tinkerbell/actions/image2disk:latest

This Action will stream a remote disk image (raw) to a block device, and is mainly used to write cloud images to a disk. It is recommended to use the qemu-img tool to convert disk images into raw, it is also possible to compress the raw images with tar+gzip to prevent wasted disk space.

env vardata typedefault valuerequireddescription
IMG_URLstring""yesURL of the image to be streamed
DEST_DISKstring""yesBlock device to which to write the image
COMPRESSEDboolfalsenoDecompress the image before writing it to the disk
RETRY_ENABLEDboolfalsenoRetry the Action, using exponential backoff, for the duration specified in RETRY_DURATION_MINUTES before failing
RETRY_DURATION_MINUTESint10noDuration for which the Action will retry before failing
PROGRESS_INTERVAL_SECONDSint3noInterval at which the progress of the image transfer will be logged
TEXT_LOGGINGboolfalsenoOutput from the Action will be logged in a more human friendly text format, JSON format is used by default

The below example will stream a raw ubuntu cloud image (converted by qemu-img) and write it to the block storage disk /dev/sda. The raw image is uncompressed in this example.

qemu-img convert ubuntu.img ubuntu.raw
actions:
- name: "stream ubuntu"
  image: quay.io/tinkerbell/actions/image2disk:latest
  timeout: 90
  environment:
      IMG_URL: http://192.168.1.2/ubuntu.raw
      DEST_DISK: /dev/sda
      COMPRESSED: false

The below example will stream a compressed raw ubuntu cloud image (converted by qemu-img) and write it to the block storage disk /dev/sda. The raw image is compressed with gzip in this example.

qemu-img convert ubuntu.img ubuntu.raw
gzip ubuntu.raw
actions:
- name: "stream ubuntu"
  image: quay.io/tinkerbell/actions/image2disk:latest
  timeout: 90
  environment:
      IMG_URL: http://192.168.1.2/ubuntu.tar.gz
      DEST_DISK: /dev/sda
      COMPRESSED: true

Supported Compression formats

  • bzip2 (.bzip2)
  • gzip (.gz)
  • xz (.xz)
  • xs (.xs)

# Packages

No description provided by the author