Russian version
Add to Del.icio.us
English version
Digg It!

 Old-School dkLab | Constructor | dklab_vzenter: "vzctl enter" using a domain name part (for OpenVZ) 

Site map :: Project Orphus :: Constructor


2009-09-10
Discuss at the Forum

You may help to develop and improve this library at GitHub

dklab_vzenter is a simple tool for system administrators which allows you to enter an OpenVZ container (vzctl enter) specifying a minimal noncontradictory part of its domain name. Now you do not need to memorize CTID or use vzlist very often.

The installation is very simple. Just enter your host system and type:

Listing 1: Installation commands
cd /usr/sbin 
wget https://github.com/DmitryKoterov/dklab_vzenter/raw/master/e  
chmod +x e

The usage is simple too:

Listing 2: Usage sample
# e <domain_name_part>

Note that <domain_name_part> may have letters absence in any place (even in the middle), it it does not cause a contradictory with other names in the system. Assume you have the following 4 containers in your host system:

web-a-01.pr.example.com
web-a-02.pr.example.com
ns1.example.com
test.pr.example.com

Let's consider how e command (shorten spelling of dklab_vzenter) works:

# e web-a-01
Entering web-a-01.pr.example.com
entered into CT 110

# e w1
Entering web-a-01.pr.example.com
entered into CT 110

# e w2
Entering web-a-02.pr.example.com
entered into CT 111

# e ns
Entering ns1.example.com
entered into CT 310

# e test
Entering test.pr.example.com
entered into CT 210

You see, dklab_vzenter tries to find names which includes typed characters in their order, but not necessarily successively. Now let's see what would happen if more than one matches are found:

# e web
More than one match found, please detalise:
  110  web-a-01.pr.example.com
  111  web-a-02.pr.example.com

So, you may enter a container only typing a noncontradictory part of its domain name.

Resume

The dklab_vzenter tool (command-line e) speeds up the usage of OpenVZ's popular vzctl enter NNN instruction allowing you to type a domain name part instead of CTID.





Dmitry Koterov, Dk lab. ©1999-2017
GZip
Add to Del.icio.us   Digg It!   Reddit