Skip to main content

This tool can be used for generating virtual machine images.

Project description

This package can be used for generating virtual machine images.

Dependencies

The dependencies required to use this package to generate virtual machine images can be found in the dep directory for the supported distributions.

Setup

The qemu-kvm command might not be available in the default PATH. This can be determined via the which command:

which qemu-kvm

If the command is not available, the qemu-kvm might be in a different location that is not part of your current PATH. In this case, you can create a symbolic link to the qemu-kvm command in a directory

An example of this could be:

ln -s /usr/share/bash-completion/completions/qemu-kvm /usr/local/bin/qemu-kvm

The gen-vm-image command can be used to generate virtual machine images for the supported distributions. To define which images should be generated, architecture.yml file should be created and defined beforehand.

Build a Virtual Machine Image

Before an image can be generated, you first have to create an architecture file that defines which images should be built. What name this architecture file is given is not important, but it should be in YAML format and contain the following structure:

owner: <string> # The owner of the image.
images: <key-value pair> # The images to be generated.
  <image-name>:
    name: <string> # The name of the image.
    version: <string> # The version of the image.
    size: <string> # The size of the to be generated vm image disk, can use suffixes such as 'K', 'M', 'G', 'T'.
    input: <dict> # Input can be defined if the generated image should be based on a pre-existing image.
      url: <string> # An URL to an image that should be used as the input image for the generated image.
      format: <string> # The format of the input image, could for instance be `raw` or `qcow2`.
      checksum: <dict> # A dictionary that defines the checksum that should be used to validate the input image.
        type: <string> # The type of checksum that should be used to validate the image. For valid types, see the supported algorithms `Here <https://docs.python.org/3/library/hashlib.html#hashlib.new>`_
        value: <string> # The checksum value that should be used to validate the image.

An example of such a file can be found in the examples directory.

Upon creating such a file, the gen-vm-image command can be used to generate the virtual machine image. The totality of the command can be seen below:

usage: gen-vm-image [-h]
                    [--images-output-directory IMAGES_OUTPUT_DIRECTORY]
                    [--generate-gocd-config]
                    [--gocd-config-name GOCD_CONFIG_NAME]
                    [--gocd-build-branch GOCD_BUILD_BRANCH]
                    [--verbose]
                    architecture_path

positional arguments:
  architecture_path     The path to the architecture file that defines the images to build

options:
  -h, --help            show this help message and exit
  --images-output-directory IMAGES_OUTPUT_DIRECTORY
                        The path to the output directory where the images will be saved (default: generated-images)
  --generate-gocd-config
                        Generate a GoCD config based on the architecture file (default: False)
  --gocd-config-name GOCD_CONFIG_NAME
                        Name of the generated gocd config file (default: 1.gocd.yml)
  --gocd-build-branch GOCD_BUILD_BRANCH
                        The branch that GoCD should use to build images (default: main)
  --verbose, -v         Print verbose output (default: False)

When the gen-vm-image command is executed, the generated VM disk image will be placed in the --image-output-path directory.

If every default value is acceptable, the VM image can be built by simply running make build in the root directory of the project:

make build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gen_vm_image-0.0.2a9.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

gen_vm_image-0.0.2a9-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file gen_vm_image-0.0.2a9.tar.gz.

File metadata

  • Download URL: gen_vm_image-0.0.2a9.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.2

File hashes

Hashes for gen_vm_image-0.0.2a9.tar.gz
Algorithm Hash digest
SHA256 893a2b2fff5f9c7ac8b1cae084334d23c326836dd66ddaab7b5e5f42e856db08
MD5 5aaadce5d2c5e84d4cef566ca860bb67
BLAKE2b-256 5030348f072fcc16aea74e90f05b776a0336fbecbe39dfb9569e9b53034edd2d

See more details on using hashes here.

File details

Details for the file gen_vm_image-0.0.2a9-py3-none-any.whl.

File metadata

File hashes

Hashes for gen_vm_image-0.0.2a9-py3-none-any.whl
Algorithm Hash digest
SHA256 da95e83c6a96ccc46a5d02c02cb3d722053744f8ebe8a6b8994176c9422b3003
MD5 ee3cb8666248ac32271fa243b6503628
BLAKE2b-256 40ddacb293cdf35c5bd260e4171fba7955a85c43f6cca3e9f3bd6aaeaf481c4a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page