Supplementary Tools
This page describes supplementary command-line tools available in Virtuozzo Server.
c2v-convert
The c2v-convert tool converts a Virtuozzo Server 7 system container to a virtual machine.
Find below a list of options you can use when running the c2v-convert command.
| |
| Name | Description |
|---|---|
ct | The name of the container to be converted to a virtual machine. |
-h, --help | Provides a list of flags used with the c2v-convert command. |
--version | Specifies the program's version number. |
-q, --quiet | Skips the confirmation prompt and suppresses the output. Useful when calling from a script. |
-y, --yes | The system automatically selects Y for all requests. The -y option assumes Ask me later for data collection by CEP. |
-v, --verbose | The verbose mode provides detailed processing information. |
-b, --batch_log | Creates a batch log file that provides log records for the containers subject to conversion. |
--timeout TIMEOUT | The operation timeout in minutes [5..60]. By default, it is 30 minutes. |
--swap SWAP | The swap size in the target virtual machine in MB. The default value is 2,048 MB. |
--target-state {keep,start,stop} | This option specifies the desired target state of virtual machine(s) after conversion: 1. 2. 3. By default, the value of this option is |
--log LOG | The path to the directory to store log files. |
--temp TEMP | The path to the directory to store temporary files. By default, it is /vz/tmp. |
-f FROM_FILE, --from-file FROM_FILE | The path to the batch file. |
For more information, refer to Converting Containers to Virtual Machines with the c2v-convert Tool.
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.
| |
| Name | Description |
|---|---|
-v | Increase the command output verbosity. Multiple -v options can be specified to produce a more verbose output. |
-n | Display the actions the command will execute but do not actually compact the disks. |
-s | Stop the command execution after compacting the first virtual disk. |
-t <timeout>[s|m|h] | Terminate the command after the specified timeout, in seconds (default), minutes or hours. |
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.
| |
Subcommands:
| Name | Description |
|---|---|
mark | Enables caching of the specified files, directories or subdirectories in containers. |
unmark | Disables caching of the specified files, directories or subdirectories in containers. |
purge | Frees up space in the memory and IOPS deduplication cache image. |
verify | Verifies the integrity of the specified mounted memory and IOPS deduplication cache and deletes corrupted files. |
check | Checks for and fixes memory and IOPS deduplication cache errors in the specified container root directory. |
stat | Displays inodes summary for a running container. |
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 check
Checks for and fixes memory and IOPS deduplication cache errors in the specified container root directory.
| |
| Name | Description |
|---|---|
<dir> | Container root directory. |
--dry-run | Report errors but do not make changes to the file system. |
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.
| |
| Name | Description |
|---|---|
<dir> | Container root directory. |
--csummed | Outputs information on checksummed inodes. |
-a, --all | Outputs information on all inodes. |
<csum> | Outputs information on inodes with the specified checksum. |
--column <col> [...] | Displays only the chosen column(s).
|
pfcache mark, unmark
Enables or disables caching of the specified files, directories or subdirectories in containers.
| |
| Name | Description |
|---|---|
<file> | File to enable/disable caching of. |
<dir> | Directory to enable/disable caching of. |
<subdir> | Subdirectory to enable/disable caching of. |
--recursive | Process directory’s or subdirectory’s current contents. |
pfcache purge
Frees up space in the memory and IOPS deduplication cache image. If no options are specified, purges entire cache.
| |
| Name | Description |
|---|---|
<cache_dir> | Memory and IOPS deduplication cache image location. |
--unused | Remove only files unused at the moment. |
--size <size> | Attempt to free size bytes in the memory and IOPS deduplication cache image. |
--expire <date> | 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:
|
pfcache stat
Displays a summary of all files in the specified file system which have been accessed recently or are being accessed now.
| |
| Name | Description |
|---|---|
<dir> | Container root directory. |
Displayed Information
| Name | Description |
|---|---|
csums | The number of checksummed files and their percentage in the total number of files fetched by the command. Only checksummed files can be cached. |
inodes | The number of files which have been accessed recently or are being accessed now. |
size | The size of the files, in kilobytes. |
RAM | Memory used by the files, in kilobytes. |
fetched | The number of files fetched by the command. |
uncached | The number of files only in container’s private area. |
cached | The number of files which have copies in the PFCache area and their percentage in fetched. |
pfcache verify
Verifies the integrity of the specified mounted memory and IOPS deduplication cache and deletes corrupt files.
| |
| Name | Description |
|---|---|
<cache_dir> | Memory and IOPS deduplication cache image location. |
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
/vzpartition:1# df -h /vzResize the
pfcacheploop device to a greater value by specifying its new full size:1# ploop resize -s 50G /vz/pfcache.hdd/DiskDescriptor.xml50Gis an example. Specify smaller or greater values depending on the currentpfcachesize and the amount of space you want to add.
prl_disk_tool
The prl_disk_tool utility is used to manage virtual hard disk drives.
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.
| |
| Name | Description |
|---|---|
--hdd <disk_path> | Full path to the virtual disk. |
--force | Forces the compacting operation for suspended virtual disks. |
-i, --info | Do not compact the virtual disk; just display the information about the size the disk will have after compacting. |
prl_disk_tool merge
Merges all snapshots of the virtual hard disk.
| |
| Name | Description |
|---|---|
--hdd <disk_path> | Full path to the virtual disk. |
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.
| |
| Name | Description |
|---|---|
--size | The new size of the virtual disk. It can be set in kilobytes (K), megabytes (M, default), gigabytes (G), or terabytes (T). |
--resize_partition | Resizes the last partition of the specified virtual disk. You cannot reduce XFS file systems (the default choice for CentOS 7 and Red Hat Enterprise Linux 7). |
--hdd <disk_path> | Full path to the virtual disk. |
--force | Forces the resizing operation for suspended virtual disks. |
-i, --info | Do not resize the virtual disk; just show the size the disk will have after resizing. |
--units | Displays the disk size in kilobytes (K), megabytes (M, default), gigabytes (G), or terabytes (T). |
vzpid
This utility prints the ID of the container where the process is running.
| |
Multiple process IDs can be specified as arguments.
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).
vzsplit
This utility is used to generate a sample container configuration file with a set of system resource control parameters.
| |
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 |
|---|---|
-n <num> | Desired number of containers to be simultaneously run on the server. |
-f <sample_name> | Name of the sample configuration to create. |
-s <swap_size> | 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.