3.4. Supplementary Tools¶
3.4.1. c2v-convert¶
The c2v-convert
tool converts a Virtuozzo Hybrid Server 7 system container to a virtual machine.
Find below a list of options you can use when running the c2v-convert
command.
c2v-convert [-h] [--version] [-q] [-y] [-v] [-b] [--timeout TIMEOUT]
[--swap SWAP] [--target-state {keep,start,stop}] [--log LOG]
[--temp TEMP] [-f FROM_FILE] [ct [ct ...]]
Name |
Description |
---|---|
|
The name of the container to be converted to a virtual machine. |
|
Provides a list of flags used with the |
|
Specifies the program’s version number. |
|
Skips the confirmation prompt and suppresses the output. Useful when calling from a script. |
|
The system automatically selects |
|
The verbose mode provides detailed processing information. |
|
Creates a batch log file that provides log records for the containers subject to conversion. |
|
The operation timeout in minutes [5..60]. By default, it is 30 minutes. |
|
The swap size in the target virtual machine in MB. The default value is 2,048 MB. |
|
This option specifies the desired target state of virtual machine(s) after conversion: 1. 2. 3. By default, the value of this option is |
|
The path to the directory to store log files. |
|
The path to the directory to store temporary files. By default, it is |
|
The path to the batch file. |
For more information, refer to Converting Containers to Virtual Machines with the c2v-convert Tool.
3.4.2. pcompact¶
Utility to compact containers by removing unused blocks from their virtual disks. By compacting virtual disks, you can increase free disk space on the physical server.
pcompact [-v] [-n] [-s] [-t <timeout>[s|m|h]
Name |
Description |
---|---|
|
Increase the command output verbosity. Multiple |
|
Display the actions the command will execute but do not actually compact the disks. |
|
Stop the command execution after compacting the first virtual disk. |
|
Terminate the command after the specified timeout, in seconds (default), minutes or hours. |
3.4.3. pfcache¶
Memory and IOPS deduplication management utility that enables/disables caching for container directories and files, verifies cache integrity, checks containers for cache errors, and purges the cache if needed.
Note
The utility does not support additional disks attached to container.
pfcache <command> {<file>|<dir> [<options>]
Subcommands:
Name |
Description |
---|---|
|
Enables caching of the specified files, directories or subdirectories in containers. |
|
Disables caching of the specified files, directories or subdirectories in containers. |
|
Frees up space in the memory and IOPS deduplication cache image. |
|
Verifies the integrity of the specified mounted memory and IOPS deduplication cache and deletes corrupted files. |
|
Checks for and fixes memory and IOPS deduplication cache errors in the specified container root directory. |
|
Displays inodes summary for a running container. |
|
In addition to the summary provided by stat, shows detailed information on PFCache inodes of a running container. If no options are specified, outputs full information on checksummed peer inodes. |
3.4.3.1. pfcache check¶
Checks for and fixes memory and IOPS deduplication cache errors in the specified container root directory.
pfcache check <dir> [--dry-run]
Name |
Description |
---|---|
|
Container root directory. |
|
Report errors but do not make changes to the file system. |
3.4.3.2. pfcache dump¶
In addition to the summary provided by stat, shows detailed information on PFCache inodes of a running container. If no options are specified, outputs full information on checksummed peer inodes.
pfcache dump <dir> [--csummed{brvbar} -a, --all {brvbar} <csum>] [--column <col> [...]]
Name |
Description |
---|---|
|
Container root directory. |
|
Outputs information on checksummed inodes. |
|
Outputs information on all inodes. |
|
Outputs information on inodes with the specified checksum. |
|
Displays only the chosen column(s).
|
3.4.3.3. pfcache mark, unmark¶
Enables or disables caching of the specified files, directories or subdirectories in containers.
pfcache mark <file>
pfcache mark <dir> [<subdir> [...]] [--recursive]
pfcache unmark <file>
pfcache unmark <dir> [<subdir> [...]] [--recursive]
Name |
Description |
---|---|
|
File to enable/disable caching of. |
|
Directory to enable/disable caching of. |
|
Subdirectory to enable/disable caching of. |
|
Process directory’s or subdirectory’s current contents. |
3.4.3.4. pfcache purge¶
Frees up space in the memory and IOPS deduplication cache image. If no options are specified, purges entire cache.
pfcache purge <cache_dir> [--unused | --size <size> | --expire <date>]
Name |
Description |
---|---|
|
Memory and IOPS deduplication cache image location. |
|
Remove only files unused at the moment. |
|
Attempt to free |
|
Remove files accessed before the specified date. A date can be specified in the ISO 8601 format or in the format defined in your system locale, with optional hours, minutes, and seconds. Examples:
|
3.4.3.5. pfcache stat¶
Displays a summary of all files in the specified file system which have been accessed recently or are being accessed now.
pfcache stat <dir>
Name |
Description |
---|---|
|
Container root directory. |
Displayed Information
Name |
Description |
---|---|
|
The number of checksummed files and their percentage in the total number of files fetched by the command. Note Only checksummed files can be cached. |
|
The number of files which have been accessed recently or are being accessed now. |
|
The size of the files, in kilobytes. |
|
Memory used by the files, in kilobytes. |
|
The number of files fetched by the command. |
|
The number of files only in container’s private area. |
|
The number of files which have copies in the PFCache area and their percentage in fetched. |
3.4.3.6. pfcache verify¶
Verifies the integrity of the specified mounted memory and IOPS deduplication cache and deletes corrupt files.
pfcache verify <cache_dir>
Name |
Description |
---|---|
|
Memory and IOPS deduplication cache image location. |
3.4.3.7. Resizing pfcache¶
The default pfcache
size limit is 10 gigabytes (GB). If the required pfcache
size exceeds the default limit on the production host, the administrator must increase it. There is no single recommended pfcache
size, as it depends on the workloads in containers. Thus, it is only required to expand the pfcache
size when there is no space.
To add more space to pfcache
:
Check space availability on the
/vz
partition:# df -h /vz
Resize the
pfcache
ploop device to a greater value by specifying its new full size:# ploop resize -s 50G /vz/pfcache.hdd/DiskDescriptor.xml
Note
50G
is an example. Specify smaller or greater values depending on the current pfcache
size and the amount of space you want to add.
3.4.4. prl_disk_tool¶
The prl_disk_tool
utility is used to manage virtual hard disk drives.
3.4.4.1. prl_disk_tool compact¶
Removes all empty blocks from the expanding virtual disk to reduce its size on the physical hard disk. The virtual disk must be formatted to NTFS, ext2/ext3/ext4, btrfs, or xfs.
prl_disk_tool compact --hdd <disk_path> [--force]
prl_disk_tool compact -i, --info --hdd <disk_path>
Name |
Description |
---|---|
|
Full path to the virtual disk. |
|
Forces the compacting operation for suspended virtual disks. |
|
Do not compact the virtual disk; just display the information about the size the disk will have after compacting. |
3.4.4.2. prl_disk_tool merge¶
Merges all snapshots of the virtual hard disk.
prl_disk_tool merge --hdd <disk_path>
Name |
Description |
---|---|
|
Full path to the virtual disk. |
3.4.4.3. prl_disk_tool resize¶
Changes the capacity of the specified virtual disk. During resizing, all data present on the disk volumes are left intact. You can also resize the last partition using the --resize_partition
option. The supported file systems are NTFS, ext2/ext3/ext4, btrfs, or xfs.
prl_disk_tool resize --size <size>[K|M|G|T] [--resize_partition]
--hdd <disk_path> [--force]
prl_disk_tool resize -i, --info [--units <K|M|G|T>] --hdd <disk_path>
Name |
Description |
---|---|
|
The new size of the virtual disk. It can be set in kilobytes ( |
|
Resizes the last partition of the specified virtual disk. Note You cannot reduce XFS file systems (the default choice for CentOS 7 and Red Hat Enterprise Linux 7). |
|
Full path to the virtual disk. |
|
Forces the resizing operation for suspended virtual disks. |
|
Do not resize the virtual disk; just show the size the disk will have after resizing. |
|
Displays the disk size in kilobytes ( |
3.4.5. vzpid¶
This utility prints the ID of the container where the process is running.
vzpid <pid> [...]
Multiple process IDs can be specified as arguments.
3.4.6. vzps, vztop¶
These two utilities can be run on the server just as the standard Linux ps
and htop
utilities. For information on the ps
and htop
utilities, consult their man pages. The vzps
and vztop
utilities provide certain additional functionality related to monitoring separate containers running on the server.
The vzps
utility has the following functionality added: the -E <CT_name>
command-line switch can be used to show only the processes running inside the container with the specified ID.
The vztop
utility has the CTID column added to display the container UUID where a particular process is running (0
stands for the server itself).
3.4.7. vzsplit¶
This utility is used to generate a sample container configuration file with a set of system resource control parameters.
vzsplit [-n <num>] [-f <sample_name>] [-s <swap_size>]
This utility is used for dividing the server into equal parts. It generates a full set of containers system resource control parameters based on the total physical memory of the server it runs on and the number of containers the server shall be able to run even if the given number of containers consume all allowed resources.
Without any option the utility prompts for the desired number of containers and outputs the resulting resource control parameters to the screen.
Name |
Description |
---|---|
|
Desired number of containers to be simultaneously run on the server. |
|
Name of the sample configuration to create. |
|
Size of the swap file on the server. It is recommended to specify the swap size to be taken into account when the utility generates sample configurations. |
The resulting sample configuration will be created in the /etc/vz/conf
directory. The file name will be ve-<sample_name>.conf-sample
. Now you can pass <sample_name>
as an argument to the --config
option of the prlctl create
command. If a sample with this name already exists, the utility will output an error message and will not overwrite the existing configuration.