Table of Contents
- 1. Creating a Container:
- 2. Starting a Container:
- 3. Stopping a Container:
- 4. Entering a Container:
- 5. Setting Resources:
- 6. Mounting Directories:
- 7. Setting IP Address:
- 8. Removing a Container:
- 9. Listing Containers:
- 10. Container Information:
- 11. Snapshotting a Container:
- 12. Setting Hostname:
- 13. Applying Configurations:
Certainly! vzctl is a utility used for managing containers in Virtuozzo, a virtualization platform. Here’s a quick guide to everyday vzctl commands:
1. Creating a Container:
vzctl create <CTID> --ostemplate <OS_template>- Replace
<CTID>with the Container ID. <OS_template>is the OS template to use for creating the container.
2. Starting a Container:
vzctl start <CTID>- Start the container with the specified
<CTID>.
3. Stopping a Container:
vzctl stop <CTID>- Stop the running container with the specified
<CTID>.
4. Entering a Container:
vzctl enter <CTID>- Enter the container’s shell to execute commands.
5. Setting Resources:
vzctl set <CTID> --cpus <number>:<limit> --save vzctl set <CTID> --ram <amount>:<limit> --swap <amount>:<limit> --save- Set CPU, RAM, and swap limits for the container.
6. Mounting Directories:
vzctl mount <CTID> vzctl umount <CTID>- Mount and unmount directories in the container.
7. Setting IP Address:
vzctl set <CTID> --ipadd <IP_address> --save- Assign an IP address to the container.
8. Removing a Container:
vzctl destroy <CTID>- Remove the container with the specified
<CTID>.
9. Listing Containers:
vzlist -a- List all containers, including those not currently running.
10. Container Information:
vzctl exec <CTID> df -h vzctl exec <CTID> ps aux- Execute commands within the container to get disk space or process information.
11. Snapshotting a Container:
vzctl suspend <CTID> vzctl resume <CTID>- Suspend and resume a container to create a snapshot.
12. Setting Hostname:
vzctl set <CTID> --hostname <new_hostname> --save- Change the hostname of the container.
13. Applying Configurations:
vzctl applyconfig <CTID> --save- Apply changes made to the container’s configuration.
These are basic commands for everyday use with vzctl in Virtuozzo. Adjust parameters and options based on your specific requirements and Virtuozzo setup.