Announcement

Collapse
No announcement yet.

Common Used OpenVZ Commands:

Collapse
X
Collapse

  • Common Used OpenVZ Commands:

    Hello Everyone,

    This article covers most commonly used OpenVZ commands that can be useful for system administrator who are using OpenVZ:

    1. To list running VPSs on the node:
    [Command ]# vzlist

    Code:
    Example:
    # vzlist
          CTID      NPROC STATUS    IP_ADDR         HOSTNAME
           101        112 running   xx.xx.xx.xx  server1.24x7.com    
           102         54 running   xx.xx.xx.xx  server2.24x7.com
    2. To list all running as well as stopped VPSs on the node:
    [Command ]# vzlist -a

    Code:
    Example:
    # vzlist -a
            CTID      NPROC STATUS    IP_ADDR         HOSTNAME
          CTID      NPROC STATUS    IP_ADDR         HOSTNAME
           101        112 running   xx.xx.xx.xx  server1.24x7.com    
           102         54 running   xx.xx.xx.xx  server2.24x7.com    
           103          - stopped   xx.xx.xx.xx  server3.24x7.com
    3. To start a VPS
    [Command ]# vzctl start CTID
    Code:
    Example:
    # vzctl start 110
    4. To stop or shutdown a VPS
    [Command ]# vzctl stop CTID
    Code:
    Example:
    # vzctl stop 110
    5. To view the status of a VPS
    [Command ]# vzctl status CTID
    Code:
    Example:
    # vzctl status 110
    CTID 116 exist unmounted down
    6. To restart a VPS
    [Command ]# vzctl restart CTID
    Code:
    Example:
    # vzctl restart 110
    Logging into a container
    7. To enter a VPS
    [Command ]# vzctl enter CTID
    Code:
    Example:
    # vzctl enter 106
    entered into CT 106
    Suspend and delete a container
    8. To delete a container:
    [Command ]# vzctl destroy CTID

    9. To suspending a container:
    [Command ]# vzctl suspend CTID

    10. To set hostname for a Server:
    [Command ]# vzctl set CTID --hostname New_hostname --save

    11. To add new IP to VPS:
    [Command ]# vzctl set CTID --ipadd xx.xx.xx.xx --save

    12. To delete IP from the VPS
    [Command ]# vzctl set CTID --ipdel xx.xx.xx.xx --save

    13. To reset root password of the VPS:
    [Command ]# vzctl set CTID --userpasswd root:new_password --save

    14. To add nameserver IP to VPS:
    [Command ]# vzctl set CTID --nameserver xx.xx.xx.xx --save

    15. To executes command inside container from the node:
    [Command ]# vzctl exec CTID command
    Code:
    Example:
    # vzctl exec 101 df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/simfs 130G 89G 27G 78% /
    none 8.0G 4.0K 8.0G 1% /dev
    none 8.0G 0 8.0G 0% /dev/shm
    16. To check the VPS resource usages:
    [Command ]# vzcalc -v CTID
    Code:
    Example:
    # vzcalc -v 101
    Resource     Current(%)  Promised(%)  Max(%)
    Low Mem          1.32 343754532205.77 343754532205.77
    Total RAM       16.50        n/a        n/a
    Mem + Swap       5.61 75011961258353.81        n/a
    Alloc. Mem      28.13 75011961258353.81 75011961258353.81
    Num. Proc        0.08        n/a 3607713474246657.00
    --------------------------------------------
    Memory          28.13 75011961258353.81 3607713474246657.00
    17. To Synchronize time between OpenVZ host and guest containers:
    [Command ]# vzctl set CTID --capacity sys_timen --save







    I hope this has been informative for you and I would like to thank you for reading it.



    Last edited by Jayant R. Danech; 06-28-2019, 10:26 PM.
      Posting comments is disabled.

    Categories

    Collapse

    Latest Articles

    Collapse

    • Top Command
      Akash Gorane
      [COLOR=rgba(0, 0, 0, 0.9)]'top' command is used to display dynamic real-time information about running processes in the system.[/COLOR] - PID: Shows task’s unique process id. - PR: Stands for priority
      01-12-2023, 05:12 PM
    • Drupal 10 is here, here's all the new features that you will get
      ramankumarlnwebworks
      The latest version of Drupal 10 is all set to release on 14 December 2022. Here are all the features that you will get after you updgrade to drupal 10
      • CKEditor
      • Symfony
      • PHP
      • Composer
      12-06-2022, 02:39 PM
    • Common Used OpenVZ Commands:
      Jayant R. Danech
      Hello Everyone,

      This article covers most commonly used OpenVZ commands that can be useful for system administrator who are using OpenVZ:

      1. To list running VPSs on the node:
      [Command ]# vzlist

      :
      Example:
      # vzlist
            CTID      NPROC STATUS    IP_ADDR         HOSTNAME
             101        112 running   xx.xx.xx.xx  server1.24x7.com    
             102         54 running   xx.xx.xx.xx  server2.24x7.com
      2. To list all running
      ...
      10-06-2018, 11:40 AM
    • cPanel Crash Drive Recovery
      Jayant R. Danech
      Hi,

      I hope this topic will be helpful for all of you..

      You have a server whose disk is crashed for some reason and you have been provided with a new disk with OS and cPanel installed on it (SDA). The old drive is attached to the disk and this will be the second disk on the server (SDB)

      Check what partition contained the data through below command:

      :
      # fdisk -l
      Once you find the partition, you can mount it to /old_drive
      ...
      10-05-2018, 03:46 PM
    • Error Codes
      Jayant R. Danech
      Error codes and their descriptions:

      Error Code 300 [Multiple Choices]
      Description: Description:The URI refers to more than one file. The server may respond with an error message or a list of options.

      Error Code 301 [Moved Permanently]
      Description: The page has been permanently moved. The client will normally perform a redirection to the new URL. References to the old URL should be updated.

      Error Code 302 [Moved Temporarily]
      Description:
      ...
      09-21-2018, 12:56 PM
    • Javascript Frameworks and Libraries to Learn in 2018
      Mangesh Thakur
      Take a quick look of projects on GitHub and you’ll realize that there are over 1 million JavaScript projects. In this article we’ll take a look at some of the JavaScript frameworks that were a big hit in 2017 and which you should try and take advantage of.

      One thing to note is that the popularity of JavaScript frameworks is ever changing. So, what might be in today may not be in tomorrow.
      Let’s begin by defining what a framework is.

      Think of a car. Every working...
      01-04-2018, 06:54 PM
    Working...
    X