Vzctl Operations

Manage OpenVZ containers with vzctl.

Facts used in these operations: vzctl.OpenvzContainers.

vzctl.create

Stateless operation

This operation will always execute commands and is not idempotent.

Create OpenVZ containers.

vzctl.create(ctid: str, template: str | None=None, **kwargs)
  • ctid: CTID of the container to create

Note:

This operation also inherits all global arguments.

vzctl.delete

Stateless operation

This operation will always execute commands and is not idempotent.

Delete OpenVZ containers.

vzctl.delete(ctid: str, **kwargs)
  • ctid: CTID of the container to delete

Note:

This operation also inherits all global arguments.

vzctl.mount

Stateless operation

This operation will always execute commands and is not idempotent.

Mount OpenVZ container filesystems.

vzctl.mount(ctid: str, **kwargs)
  • ctid: CTID of the container to mount

Note:

This operation also inherits all global arguments.

vzctl.restart

Stateless operation

This operation will always execute commands and is not idempotent.

Restart OpenVZ containers.

vzctl.restart(ctid: str, force=False, **kwargs)
  • ctid: CTID of the container to restart

  • force: whether to force container start

Note:

This operation also inherits all global arguments.

vzctl.set

Stateless operation

This operation will always execute commands and is not idempotent.

Set OpenVZ container details.

vzctl.set(ctid: str, save=True, **kwargs)
  • ctid: CTID of the container to set

  • save: whether to save the changes

  • settings: settings/arguments to apply to the container

Settings/arguments:

these are mapped directly to vztctl arguments, eg hostname='my-host.net' becomes --hostname my-host.net.

Note:

This operation also inherits all global arguments.

vzctl.start

Stateless operation

This operation will always execute commands and is not idempotent.

Start OpenVZ containers.

vzctl.start(ctid: str, force=False, **kwargs)
  • ctid: CTID of the container to start

  • force: whether to force container start

Note:

This operation also inherits all global arguments.

vzctl.stop

Stateless operation

This operation will always execute commands and is not idempotent.

Stop OpenVZ containers.

vzctl.stop(ctid: str, **kwargs)
  • ctid: CTID of the container to stop

Note:

This operation also inherits all global arguments.

vzctl.unmount

Stateless operation

This operation will always execute commands and is not idempotent.

Unmount OpenVZ container filesystems.

vzctl.unmount(ctid: str, **kwargs)
  • ctid: CTID of the container to unmount

Note:

This operation also inherits all global arguments.