Editing User Guide/Operations on Containers
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 143: | Line 143: | ||
# '''vzctl set 101 --userpasswd root:test''' | # '''vzctl set 101 --userpasswd root:test''' | ||
− | In this example, we set the root password for Container 101 to "test", and you can log in to the Container via SSH as root and administer it in the same way as you administer a standalone Linux server: install additional software, add users, set up services, and so on. The password will be set inside the Container in the <code>/etc/shadow</code> file in an encrypted form and will not be stored in the Container configuration file. Therefore, if you forget the password, you have to reset it. Note that <code>--userpasswd</code> ignores the <code>--save</code> switch, the password is persistently set for the given Container. | + | In this example, we set the root password for Container 101 to "test", and you can log in to the Container via SSH as root and administer it in the same way as you administer a standalone Linux server: install additional software, add users, set up services, and so on. The password will be set inside the Container in the <code>/etc/shadow</code> file in an encrypted form and will not be stored in the Container configuration file. Therefore, if you forget the password, you have to reset it. Note that <code>--userpasswd</code> ignores the <code>--save</code> switch, the password is anyway persistently set for the given Container. |
While you can create users and set passwords for them using the <code>vzctl exec</code> or <code>vzctl set</code> commands, it is suggested that you delegate user management to the Container administrator advising him/her of the Container root account password. | While you can create users and set passwords for them using the <code>vzctl exec</code> or <code>vzctl set</code> commands, it is suggested that you delegate user management to the Container administrator advising him/her of the Container root account password. | ||
Line 221: | Line 221: | ||
Container start in progress... | Container start in progress... | ||
− | {{Note|You can also use Container names to start, stop, and restart the corresponding Containers. For detailed information on Container names, please turn to the [[#Setting Name for Container]] section. | + | {{Note|You can also use Container names to start, stop, and restart the corresponding Containers. For detailed information on Container names, please turn to the [[#Setting Name for Container]] section. |
== Listing Containers == | == Listing Containers == | ||
Line 240: | Line 240: | ||
103 200000 | 103 200000 | ||
− | This shows only running Containers with the information about their IDs and soft limit on disk inodes (see the {{ | + | This shows only running Containers with the information about their IDs and soft limit on disk inodes (see the {{Chapter link|Managing Resources}} chapter for more information), with the list sorted by this soft limit. The full list of the <code>vzlist</code> command line switches and output and sorting options is available in the {{man|vzlist|8}} man page. |
+ | FIXME | ||
== Setting Name for Container == | == Setting Name for Container == | ||
Line 343: | Line 344: | ||
# The Container on the Destination Node is started. | # The Container on the Destination Node is started. | ||
− | |||
There is a short downtime needed to stop the Container on the Source Node, copy the Container private data changes to the Destination Node, and start the Container on the Destination Node. However, this time is very short and does not usually exceed one minute. | There is a short downtime needed to stop the Container on the Source Node, copy the Container private data changes to the Destination Node, and start the Container on the Destination Node. However, this time is very short and does not usually exceed one minute. | ||
Line 358: | Line 358: | ||
{{Note|For the command to be successful, a direct SSH connection (on port 22) should be allowed between the Source and Destination Nodes.}} | {{Note|For the command to be successful, a direct SSH connection (on port 22) should be allowed between the Source and Destination Nodes.}} | ||
+ | |||
+ | By default, after the migration process is completed, the Container private area and configuration file are removed on the Source Node. However, if you wish the Container private area on the Source Node to be removed after the successful Container migration, you can override the default <code>vzmigrate</code> behavior by using the <code>–r no</code> switch. | ||
=== Zero-downtime (online) migration === | === Zero-downtime (online) migration === | ||
Line 381: | Line 383: | ||
You can delete a Container that is not needed anymore with the <code>vzctl destroy ''CTID''</code> command. This command removes the Container private area completely and renames the Container configuration file and action scripts by appending the <code>.destroyed</code> suffix to them. | You can delete a Container that is not needed anymore with the <code>vzctl destroy ''CTID''</code> command. This command removes the Container private area completely and renames the Container configuration file and action scripts by appending the <code>.destroyed</code> suffix to them. | ||
− | {{Note|Since vzctl-3.0.24, you can also use the | + | {{Note|Since vzctl-3.0.24, you can also use the vzctl delete command introduced in Virtuozzo Containers 4.0 to remove Containers from your Hardware Node. This command has the syntax identical to vzctl destroy and is meant to replace the latter in the future.}} |
A running Container cannot be destroyed with the <code>vzctl destroy</code> command. The example below illustrates destroying Container 101: | A running Container cannot be destroyed with the <code>vzctl destroy</code> command. The example below illustrates destroying Container 101: | ||
− | + | # vzctl destroy 101 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Destroying Container private area: /vz/private/101 | |
− | + | Container is currently mounted (unmount first) | |
− | + | # vzctl stop 101 | |
− | + | Stopping Container ... | |
− | + | Container was stopped | |
− | + | Container is unmounted | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | # vzctl destroy 101 | |
− | + | Destroying Container private area: /vz/private/101 | |
− | + | Container private area was destroyed | |
− | + | # ls /etc/vz/conf/101.* | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | /etc/vz/conf/101.conf.destroyed | |
− | + | # vzctl status 101 | |
− | + | VEID 101 deleted unmounted down | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | If you do not need the backup copy of the Container configuration files (with the .destroyed suffix), you may delete them manually. | ||
+ | == Disabling Container == | ||
+ | == Suspending Container == | ||
== Running Commands in Container == | == Running Commands in Container == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<noinclude>{{UG/Footer}}</noinclude> | <noinclude>{{UG/Footer}}</noinclude> |