metalsmith.sources module

Image sources to use when provisioning nodes.

class metalsmith.sources.FilePartitionImage(location, kernel_location, ramdisk_location, checksum=None)

Bases: metalsmith.sources.FileWholeDiskImage

A partition image from a local file location.

Warning

The location must be local to the ironic-conductor process handling the node, not to metalsmith itself! Since there is no easy way to determine which conductor handles a node, the same file must be available at the same location to all conductors in the same group.

Create a local file source.

Parameters
  • location – Location of the image, optionally starting with file://.

  • kernel_location – Location of the kernel of the image, optionally starting with file://.

  • ramdisk_location – Location of the ramdisk of the image, optionally starting with file://.

  • checksum – MD5 checksum of the image. DEPRECATED: checksums do not actually work with file images.

class metalsmith.sources.FileWholeDiskImage(location, checksum=None)

Bases: metalsmith.sources._Source

A whole-disk image from a local file location.

Warning

The location must be local to the ironic-conductor process handling the node, not to metalsmith itself! Since there is no easy way to determine which conductor handles a node, the same file must be available at the same location to all conductors in the same group.

Create a local file source.

Parameters
  • location – Location of the image, optionally starting with file://.

  • checksum – MD5 checksum of the image. DEPRECATED: checksums do not actually work with file images.

class metalsmith.sources.GlanceImage(image)

Bases: metalsmith.sources._Source

Image from the OpenStack Image service.

Create a Glance source.

Parameters

imageImage object, ID or name.

class metalsmith.sources.HttpPartitionImage(url, kernel_url, ramdisk_url, checksum=None, checksum_url=None)

Bases: metalsmith.sources.HttpWholeDiskImage

A partition image from an HTTP(s) location.

Create an HTTP source.

Parameters
  • url – URL of the root disk image.

  • kernel_url – URL of the kernel image.

  • ramdisk_url – URL of the initramfs image.

  • checksum – MD5 checksum of the root disk image. Mutually exclusive with checksum_url.

  • checksum_url – URL of the checksum file for the root disk image. Has to be in the standard format of the md5sum tool. Mutually exclusive with checksum.

class metalsmith.sources.HttpWholeDiskImage(url, checksum=None, checksum_url=None)

Bases: metalsmith.sources._Source

A whole-disk image from HTTP(s) location.

Some deployment methods require a checksum of the image. It has to be provided via checksum or checksum_url.

Only checksum_url (if provided) has to be accessible from the current machine. Other URLs have to be accessible by the Bare Metal service (more specifically, by ironic-conductor processes).

Create an HTTP source.

Parameters
  • url – URL of the image.

  • checksum – MD5 checksum of the image. Mutually exclusive with checksum_url.

  • checksum_url – URL of the checksum file for the image. Has to be in the standard format of the md5sum tool. Mutually exclusive with checksum.

metalsmith.sources.detect(image, kernel=None, ramdisk=None, checksum=None)

Try detecting the correct source type from the provided information.

Note

Images without a schema are assumed to be Glance images.

Parameters
  • image – Location of the image: file://, http://, https:// link or a Glance image name or UUID.

  • kernel – Location of the kernel (if present): file://, http://, https:// link or a Glance image name or UUID.

  • ramdisk – Location of the ramdisk (if present): file://, http://, https:// link or a Glance image name or UUID.

  • checksum – MD5 checksum of the image: http:// or https:// link or a string.

Returns

A valid source object.

Raises

ValueError if the given parameters do not correspond to any valid source.