List and manage VM images

Synopsis

pcocc image [COMMAND] [ARG]

Description

List and manage virtual machine images.

All the subcommands of pcocc image operate on images stored in pcocc repositories. The list of pcocc repositories is defined in repos.yaml (see pcocc-repos.yaml(5)).

Images in repositories are uniquely identified by a name and revision number. In all pcocc commands and configuration files, images in repositories are specified with the following URI syntax: [REPO:]IMAGE[@REVISION]. If REPO is omitted the command will look in all defined repositories by order of priority until it finds a matching image. If REVISION is omitted, the highest revision of the image is selected.

Images are made of a stack of layers with each layer containing the differences from the previous layers. Layers can be shared between images in a repository which allows to reduce the storage footprint and speeds up operations by avoiding unnecessary data movement.

Sub-Commands

list [-R repo] [REGEX]
List image in repositories. The result can be filtered by repository and/or by image name with a regular expression.
show [IMAGE]
Show a detailed description of the specified imagge
import [-t fmt] [KIND] [SOURCE] [DEST]
Import the source image file to an image in the destination repository. The destination image name must not already be used in the destination repository and the revision is ignored since the import operation creates the first revision of a new image. See below for supported image kinds and file formats.
export [-t fmt] [SOURCE] [DEST]
Export the source image file from a repository to the destination file.
copy [SOURCE] [DEST]
Copy an image from a repository to another image in a repository. The destination image name must not already be used in the destination repository and the destination revision is ignored since a copy operation creates the first revision of a new image.
delete [IMAGE]
Delete an image from a repository. If a revision is specified, only the specified revision is deleted, otherwise all revisions of the image are deleted.
resize [IMAGE] [NEW_SZ]
A new image revision is created with the new image size.
repo list
List configured repositories
repo gc [REPO]
Cleanup unnecessary data from a repository. This command should be run to free space used by data no longer used by any image.

Import and export file formats

pcocc repositories currently only manage VM images so the only valid value for KIND is vm. The following VM image file formats are supported: raw, qcow2, qed, vdi, vpc, vmdk. By default, pcocc will try to guess the file format from the image file itself or from its extension. The file format of the imported / exported file can be forced with the -t option.

Examples

To list available images:

pcocc image list

To import an image into a repository named global:

pcocc image import vm $HOME/CentOS-7-x86_64-GenericCloud.qcow2 global:centos7-cloud

To copy an image between repositories:

pcocc image copy global:centos7-cloud user:mycentos7

To get detailed information relative to an image:

pcocc image show user:mycentos7

To delete a specific revision of an image:

pcocc image delete user:mycentos7@5

To completely delete all revisions of an image:

pcocc image delete myrepo:centos7-cloud