📜 ⬆️ ⬇️

Creating your own applications for installation through the standard Parallels Cloud Server tools


Hello,

I want to tell you about our research in the field of automating the installation of custom solutions based on Parallels Cloud Server.

From the moment PCS was introduced to service the nodes for our clients, the question immediately arose about automating the installation of their images (Debian + panel of choice ISPmanager Lite / Pro or FastPanel), since at OpenVZ we had some success in creating exactly the final images with the already installed stuffing , it was decided to make similar images for PCS.

')
What is the profit of this decision? First of all, in the speed and convenience of activation for customers. Managers did not need to install first a clean image of the system, then go to the server, install the panel with their hands and run special scripts to tune the server with the panel. Literally in two clicks we get a ready-made working server without any extra movements, and this is good news. No sooner said than done. The base for the transfer was prepared and, as soon as the first image was transferred and successfully launched on the container, then we thought it was the final victory. Servers are working, customers are happy. In the process of servicing, changes were made to the images (software updates, improvements in configurations, closing of bugs) and the more changes there were, the more clearly we understood that the current situation is not particularly satisfactory, because when making changes to the image on OpenVZ, it was necessary to check clean up excess garbage in the form of logs, or history, convert to ploop format for working with PCS, deploy and test there.

So it was decided to investigate and implement the installation of the FastPanel panel (we chose the first one, since it is easier for us to handle it) using standard PCS tools, and in particular through the PVA section - applications.

Applications (applications) in Parallels Virtual Automation are applications for the required system, made in the style of repository packages and installed, including through a web interface.

In essence, applications are installed via the standard vzctl toolkit with the command:
vzpkg install -q CTID .ourapp 


The advantage of this approach is that you do not need to keep your own customized image up to date, but only need to maintain the package and its compatibility with the system, and the image will be updated on its own, including when reinstalling the container, all packages that were selected for it, will be installed automatically. Applications are installed after the image setup, if it was a clean installation, or after saving the list of necessary packages, if they were selected while the server was running.

The procedure for installing the system and selected packages from scratch:

1. Automation puts a clean image of the system.
2. Automation puts all packages from the list approved for this container.

Another advantage can be considered tracking application updates, again, through the web panel.

Before introducing your own package, let’s learn a little how it should be

The path to the directory from the application config is:
 /vz/template/$OS/$VER/$BIT/config/app      - Debian 6 x86_64       : /vz/template/debian/6.0/x86_64/config/app/ 


Create a minimal template for any application:
 mkdir /vz/template/debian/6.0/x86_64/config/app/fastpanel #    

 mkdir /vz/template/debian/6.0/x86_64/config/app/fastpanel/default #      

 touch /vz/template/debian/6.0/x86_64/config/app/fastpanel/default/description #    ,            ( Manage Applications ) 

 touch /vz/template/debian/6.0/x86_64/config/app/fastpanel/default/packages #      .      : ourapp 

 touch /vz/template/debian/6.0/x86_64/config/app/fastpanel/default/release #  ,     ,       . 

 touch /vz/template/debian/6.0/x86_64/config/app/fastpanel/default/repositories #  ,   ,        .      : http://fastpanel.fastvps.ru/fastpanel squeeze main 

 touch /vz/template/debian/6.0/x86_64/config/app/fastpanel/default/summary # ,     summary   .  summary = description 

 touch /vz/template/debian/6.0/x86_64/config/app/fastpanel/default/version #     


An example of a working config package
 [root@xx default]# ls description packages release repositories summary version 

 [root@xx default]# cat description FastPanel for Debian GNU/Linux 6.0 (for AMD64) packaged as a Virtuozzo EZ Template. 

 [root@xx default]# cat packages fastpanel 

 [root@xx default]# cat release 1 

 [root@xx default]# cat repositories http://fastpanel.fastvps.ru/fastpanel squeeze main 

 [root@xx default]# cat summary FastPanel for Debian GNU/Linux 6.0 (for AMD64) EZ Template 

 [root@xx default]# cat version 0.0.1 



After creating the necessary skeleton and filling it with the necessary data:
1. Go to PVA.
2. Select the desired container whose template matches, in our case, debian-6.0-x86_64
Screenshot


3. Click on Applications and find your package in the list.
Screenshot


4. Select the package and click ">>" then it should be transferred to the right column.
5. Click “Submit” and wait until the package is installed.
Screenshot


In case of successful installation our package will appear on the container card:
Screenshot



PS Also, if this topic is interesting, then I could write about creating a whole image with my software for PCS using its standard tools (image configs + pre / post scripts).

Regards, Vaganov Nikolay
System administrator FastVPS.ru

Source: https://habr.com/ru/post/206276/


All Articles