16.1. Virtuozzo Automator Command-Line Utilities

This chapter is an additional reference on the Hardware Node command-line utilities. The chapter documents the utilities that are available after the VA Agent is installed on the Hardware Node. For every utility, all available command-line options are described.

16.1.1. vzagroup

The vzagroup utility is used to logically organize the physical servers and containers. There are two independent ways to design the structure organization. They are called Infrastructure and Logical View and presented as top-level elements in the Virtuozzo Automator left menu. You can use either one of them or, better, both at once, as their functions are different. For more information on building up a logical structure and combining containers into groups, refer to the Organizing Logical Structure section.

The utility is also used as a part of an upgrading procedure for importing data between server.

The utility can be run either on a Master server or a Slave server with a different number of available commands.

Running on VA Slave Server

The utility has the following syntax:

# vzagroup <command> <options> <node>

The restoration options are the following:

Command Description
addToGroup [USER[:PASSWORD]@]ADDRESS Adds the Slave server to the VA group.
list Lists the physical servers within the VA infrastructure. The command shows the statuses (online/offline) and roles (Master/Slave) of the listed servers.
removeFromGroup [USER[:PASSWORD]@]ADDRESS Removes the Slave server, you are logged into, from the VA group.

Running on VA Master Server

The utility has the following syntax:

# vzagroup <command> <options> <node>

Commands:

Command Description
addContainer /<infrastructure | organizational>[/subfolder name] [USER[:PASSWORD]@]ADDRESS <ctid> Includes a container into an Infrastructure (<infrastructure> option) or Logical View (<organizational> option) context. To indicate the container, specify its ID and the hosting physical server IP address.
addFolder /<infrastructure | organizational>[/subfolder name] Creates a new folder/subfolder in the Infrastructure or Logical View context, <infrastructure> or <organizational> option respectively.
addSlave [USER[:PASSWORD]@]ADDRESS Registers a new Slave physical server in the VA infrastructure. Specify the physical server’s IP address. In case the server is registered in another infrastructure, you can force the server re-registration with the [--force] option.
delContainer /<infrastructure | organizational>[/subfolder name] [USER[:PASSWORD]@]ADDRESS <ctid> Removes container from the Infrastructure or Logical View context. Specify the folder/subfolder name where the container belongs, the physical server IP address that host the container and the container ID.
delFolder /<infrastructure | organizational>[/subfolder name] Removes a folder/sub-folder from the Infrastructure or Logical View context.
list Lists the physical servers within the VA infrastructure. The command shows the statuses (online/offline) and roles (Master/Slave) of the listed servers.
listInfrastructure /<infrastructure | organizational>[/subfolder name] Lists the elements (folders, containers, etc.) that are grouped under the Infrastructure or Logical View context. To list the elements of a particular folder/sub-folder, specify its name additionally.
reconfigure [/option-path-in-xml- config option-value]

Changes the configuration settings for a group of containers, such as, managing permissions, scheduling backups, applying system updates, etc.

For example. the log level can be changes with the following command: vzagroup reconfigure /data/system/configuration/log_level 5.

removeSlave [USER[:PASSWORD]@]ADDRESS Unregisters a Slave physical server from the VA infrastructure. Use the [--force] option to unregister the server even if it’s offline.
[--force] Use the option with the addSlave and removeSlave commands. With the addSlave command, the option forces the Slave registration even if it registered in another Infrastructure. With the removeSlave command, the option unregisters the slave server even if it is offline.

Upgrade commands:

Command Description
--switchSlave [USER[:PASSWORD]@]ADDRESS Registers the Slave server from the PIM 4.0 infrastructure in the Virtuozzo Automator Infrastructure. The Slave server’s version remains 4.0.
--importSettings [USER[:PASSWORD]@]ADDRESS [options] Transfers data from the PIM 4.0 infrastructure to the Virtuozzo Automator infrastructure.

The options which can be used with the --importSettings command of vzagroup:

Option Description
--import-security Imports security settings from 4.0 server (roles, role assignments, users, groups).
--import-infrastructure Imports infrastructure folders, logical view from 4.0 server.
--import-alerts Imports alerts and events from 4.0 server.
--import-operations Imports task log from 4.0 server.
--import-tasks Imports scheduled tasks from 4.0 server.
--import-messaging Imports physical server messaging settings from 4.0 server.
--import-backup-settings Imports default backup settings from 4.0 server.
--import-ipranges Imports IP ranges from 4.0 server.
--import-samples Imports container templates from 4.0 server.
--import-networks Imports virtual networks from 4.0 server.
--clear Deletes data from a 6.1 master server before importing information from 4.0 server.
--switch-master

Assigns a 4.0 Master server a Slave server role while registering by 6.1 Master server.

Note

You can also register the server from Virtuozzo Automator.

16.1.2. vzabackup

Note

This feature is only supported for Virtuozzo 6 servers.

The vzabackup utility is used to back up legacy containers or certain container files/folders and can be run on any Virtuozzo 6 host (including the Source and Backup Nodes) with the vzabackup package installed. It has the following syntax:

vzabackup [BACKUP\_OPTIONS] NODE1 ... [CT\_OPTIONS]
vzabackup [STORAGE\_OPTIONS]

Note

For the vzabackup functionality to work, forward and reverse DNS lookups must be correctly configured for both the Source and Backup Nodes.

General backup options:

Option Description
-F, -I, --Tfull Forces performing a full backup.
-i, --Tinc Makes an incremental backup or, if no full backups are available, a full backup. If this and --Tdiff options are omitted, the full backup is created.
--Tdiff Makes a differential backup or, if no full backups are available, a full backup. If this and -i options are omitted, the full backup is created.
-D DESCRIPTION The description of the backup archive. The backup description should always be quoted (e.g. “backup for Container 101”).
-o, --rm-old Creates a new backup and then removes the oldest backup of the specified container.
-d, --rm-tag BACKUP_ID Creates a backup and then removes the backup with the specified ID. You can learn what ID is assigned to this or that container backup by running the vzarestore utility with the -l or -f option.
-Cn, -C0 Creates the container backup without any compression. This will speed up the backing up time; however, it may significantly increase the size of the resulting backup archive.
-Cg, -C1

Compresses the resulting backups with the normal level of compression. This is the default level of compression used to back up all server/containers.

The optimal data compression level depends on the type of files to be stored in the backup archive. For example, it is advisable to use the ‘normal’ and ‘none’ compression types if most of the files to be backed up are already compressed (e.g. the files with the .zip and .rar extensions) or can be compressed with a low degree of efficiency (e.g. all executable files with the .exe extension or image files with the .jpg, .jpeg, and .gif extensions).

-C2 Compresses the resulting backups with the high level of compression. The size of the resulting backup file is smaller than that of the backup file compressed with the -C0 and C1 options; however, it takes longer to create the backup file.
-Cb, -C3 Compresses the resulting backups with the maximum level of compression. In this case the backup file size is the smallest; however, it may take much time to create such backups.
-J If several servers (Hardware Nodes) are specified, this option tells vzabackup to back up the specified Hardware Nodes (and their containers) simultaneously. If the option is omitted, the Hardware Nodes are backed up sequentially one after another.
--force Forces the process of backing up the server (Hardware Nodes)/containers. You are recommended to use this option when simultaneously backing up more than one Node/container.
--storage NODE

The IP address or hostname and the credentials of the Backup Node where the created backup will be stored. Should be specified in the following format: [USER[:PASSWD]]@IP_ADDRESS where:

  • IP_ADDRESS is the IP address or hostname of the Backup Node, and
  • USER and PASSWD denote the credentials of the root user used to log in to the Backup Node.

When using this option, keep in mind the following:

  • If you do not indicate the user and/or password to log in to the Backup Node, you will be asked to do so during the vzabackup execution.
  • If you are backing up containers residing on the local Node and this local Node is also used as the Backup Node, you do not need to specify the Node credentials, provided that you are logged in to this Node as root.
  • If the --storage option is omitted, vzabackup puts the created container backups to the backup directory on the Source Node. By default, this directory is /vz/backups.
NODE1...

The IP address and the root credentials of the Source Node, i.e. of the Node hosting the containers to be backed up. Should be specified in the following form: [USER[:PASSWD]]@IP_ADDRESS where:

  • IP_ADDRESS is the IP address or hostname of the Source Node and
  • USER and PASSWD denote the credentials of the root user used to log in to the Source Node.

When using this option, keep in mind the following:

  • If you do not indicate the user and/or password to log in to the Source Node, you will be asked to do so during the vzabackup execution.
  • If you are backing up containers residing on the Source Node, you do not need to specify the Node credentials, provided that you are logged in to this Source Node as root.
-q, --no-progress Disables logging to the screen during the vzabackup operation.

Per-Container parameters:

Option Description
--chain-length NUMBER An incremental backup parameter. After this number of incremental backups, a full backup will be performed.
--chain-days NUMBER An incremental backup parameter. After this number of days, a full backup will be performed.

Container backup options:

Option Description
-e CT1... The containers to back up on the Source Node. If this and the -x options are omitted, all containers on the given Node will be backed up. containers can be specified using both their IDs (e.g., 101 or 102) and their names (e.g. server1 or server2).
-x CT1... The containers that need not to be backed up, i.e. the containers you wish to exclude from the backup process. If this and the -e options are omitted, all containers on the given Node will be backed up. Containers can be specified using both their IDs (e.g., 101 or 102) and their names (e.g., server1 or server2).
--include-files FILE_LIST The path to the files and directories inside the container to be included in the backup.
--exclude-files FILE_LIST The path to the files and directories inside the container to be excluded from the backup.

Backup storage options:

Option Description
--view-folder Displays the path tothe backup storage directory on the local Node. The default directory is /vz/backups.
--set-folder PATH Sets a new directory on the local Node where the created backups are to be stored (if the local Node is used as the Backup Node). Uses --backup-folder-* parameters.
--set-folder-creds USER[:PASSWD] Sets backup storage login credentials. Required for Samba storage. Uses --backup-folder-* parameters.
--backup-folder-path PATH Path to a custom backup storage location.
--backup-folder-login LOGIN Username for a custom backup storage on a Samba share.
--backup-folder-passwd PASSWD Password for a custom backup storage on a Samba share.

16.1.3. vzarestore

The vzarestore utility is used to restore legacy containers or certain files/folders from container backup archives, list backups existing on the Backup Node, remove backups, etc.

The utility has the following syntax:

vzarestore [CTID[:NEW_CTID] | -e [<CTID[:NEW_CTID]...>] [OPTIONS] [BACKUP_NODE]
vzarestore -r,--remove <BACKUP_ID...>
vzarestore -l,--list [LIST_OPTIONS] [BACKUP_NODE]
vzarestore --browse BACKUP_ID [BROWSE_OPTIONS] [BACKUP_NODE]
vzarestore --print-ct-config BACKUP_ID [BACKUP_NODE]
vzarestore --help

Restoration options:

Option Description
-e CTID[:NEW_CTID]... Comma-separated list of containers to restore. Containers can be specified using both their IDs (e.g., 101) and their names (e.g., computer1).
-x CT1... Comma-separated list of containers to skip. Containers can be specified using both their IDs (e.g., 101) and their names (e.g., computer1).
-b BACKUP_ID

The ID assigned to the container backup. This ID can be used to restore this container or its certain files from the backup with the specified ID. If not specified, the last container backup is used.

This option is incompatible with the -e option.

Note

-b is used for restoring files only and can’t be used to change the restored container ID.

--force Do not stop on errors during the vzarestore execution. You are recommended to use this option when restoring more than one container at once.
--skip-ct-config

Do not restore the container configuration file. This option can be used only when restoring a single container.

Note

The container configuration file is not changed when restoring separate container files.

--files PATH The full path to the file/directory inside the container to be restored. This option is incompatible with the -e option.
--skip-locked Do not stop on errors even if some of the files to be restored are in the ‘locked’ state.
-B Handles the values after the -e option as container backup IDs.
--storage NODE The IP address and the credentials of the Backup Node where the container backups are stored. Can be specified in the following form: USER[:PASSWD]@IP_ADDRESS. If this option is omitted, the local Node is treated as the Backup Node.

Miscellaneous options:

Option Description
-r, --remove BACKUP_ID Removes the container backup with the specified backup ID. You can specify several backup IDs and separate them by spaces.
-l, --list Do not restore any containers. Displays the information on the existing backups located either on the Backup Node or on the local Node if the former is not specified.
--browse BACKUP_ID Displays the contents of the container backup with the specified backup ID.
--print-ct-config BACKUP_ID Displays the configuration file contents of the container with the specified backup ID.

Listing options:

Option Description
-f, --full Displays the full information on the specified container backup. Used only with --list.
--latest Displays the latest containers backups. Used only with --list.
-e CT1... Displays the information on the backups for the specified containers only.
-B Handles the values after the -e option as container backup IDs.

Browsing options:

Option Description
-d, --dir PATH Path to a directory inside a container backup archive contents of which you want to see. Used with --browse.
--backup-folder-path PATH Path to a custom backup storage location.