Best Steps to Post-installation requirements in Virtualizor

Posted on

Best Steps to Post-installation requirements in Virtualizor

In the previous article, we discussed how to install Virtualizor on AlmaLinux, and in this article, we intend to teach you the Post-installation requirements in Virtualizor.

After installing Virtualizor, we should configure some settings like adding IP pool, storage, templates, etc., on the Virtualizor server; then, we can create a VPS.

In this article on the Orcacore website, we will follow how we can complete all these items.

The preparation of Virtualizor for the installation of a VPS will have several steps. In these steps, we will review the important and required items step by step.

Step 1 – How to Make the Storage Virtualizor Server Usable?

At the first step of Post-installation requirements in Virtualizor, for using the hard disk space to install the VPS, some steps must be taken to prepare the storage space. To do this, follow the steps below:

Step 1-1 – How to Add Storage to Virtualizor

Before you start adding storage to Virtualizor, you need to prepare it with some commands.

Point: Virtualizor supports multiple formats for storing VPS and adding storage space. In this tutorial, we will prepare and add LVM storage.

Step 1-2 – Make a Partition with the parted Tool

First, we describe how to add storage. Make an SSH connection to the server and use the below command to see how much free space is on the server:

parted
p free
Post-installation requirements in Virtualizor - Storage setting on Virtualizor
Post-installation requirements in Virtualizor

After finding the free space on the Virtualizor server, we should make a partition that we can add to the panel. Use the below commands to make a partition:

mkpart
primary
[let it free]
[write start block]
[write end block]
Post-installation requirements in Virtualizor

Step 1-3 – How to Make Volume Group

After making a partition from the previous step, we should add it to a volume group.

Note: Please note that we can add storage only with a volume group to a Virtualizor panel.

Then try the below command to add the new partition to a volume group named “vg1”:

vgcreate vg1 /dev/sda4
Post-installation requirements in Virtualizor

Step 1-4 – Add Storage to a Virtualizor Panel

Finally, we should define the volume group to the Virtulizor panel.

Open the panel and navigate to the “storage >> add storage” from the left panel.

Post-installation requirements in Virtualizor

You see some fields that we should write as described below:

  • Name: You can write any name for your storage.
  • Volume Group: Select the volume group name that you create in the previous step.
  • Max LVs: Number of LVs on this storage.
  • Min. Free Space: Minimum free space on storage.
  • Status: Select enable for using this storage.
Post-installation requirements in Virtualizor

Step 2 – Adding IP Pool to the Virtualizor Panel

After that, on the second step of Post-installation requirements in Virtualizor, We should add an IP pool to the Virtualizor panel.

When we want to create VPS, it can assign an IP to the VPS.

Navigate to the “IP Pool >> Create IP Pool” menu from the left panel.

Step 2-1 – How to Add IPv4 Pool to the Virtualizor Panel

From the top of the page, select type as “IPv4” and complete the fields as described below:

  • Name: You can write any name for your IP Pool.
  • Gateway: Write the Gateway of your IP Pool.
  • Netmask: Write the Netmask of your IP Pool.
  • Start IP: First IP of your IP Pool.
  • End IP: Last IP of your IP Pool.
Post-installation requirements in Virtualizor

Step 2-2 – How to Add IPv6 Pool to the Virtualizor Panel

Also, You can add an IPv6 pool, and Virtualizor assign them to the VPS. Then, like in the last step, we describe how to add an IPv6 Pool. Select “Type” as IPv6 and complete the items:

  • Name: You can write any name for your IP Pool.
  • Gateway: Write the Gateway of your IP Pool.
  • Start IP: First IP of your IP Pool.
  • End IP: Last IP of your IP Pool.
Post-installation requirements in Virtualizor

Step 3 – How to Add Linux OS Template to Virtualizor

The last step of Post-installation requirements in Virtualizor is how we can add some Linux templates to create a VPS based on these templates.

We can use the “Template browser” item from the “Media” menu in the left panel to see all Linux temps with type and distro.

Check the checkbox that you want to add. click on the “Save settings” to finalize the selected item. The Virtulizor will start to download selected templates automatically.

Point: If you follow the previous article and Install KVM as a hypervisor, you must choose a template of KVM type.

Post-installation requirements in Virtualizor

Conclusion

Three base items that need to create a VPS on the Virtulizor panel are described in this post.

You can read our other posts from the Virtualizor tutorials section to make your server more flexible and reliable.

If you have any problem or any questions, Comment for us. And if this article is useful and practical for you share it with your friends and community on social Networks.

Alternative Solutions for Post-Installation Requirements in Virtualizor

While the article effectively outlines the standard procedures for setting up storage, IP pools, and templates in Virtualizor, let’s explore alternative solutions that could streamline or enhance these processes.

Alternative 1: Using a Configuration Management Tool (Ansible)

Instead of manually partitioning disks, creating volume groups, and configuring IP pools through the Virtualizor panel, a configuration management tool like Ansible can automate these tasks. This approach is particularly beneficial when managing multiple Virtualizor servers or when consistency and repeatability are crucial.

Explanation:

Ansible uses playbooks written in YAML to define the desired state of the system. These playbooks can then be executed on one or more servers, ensuring that the configurations are applied consistently. For storage configuration, Ansible can use modules like parted and lvm to automate the partitioning and volume group creation process. For IP pool management, you can interact with the Virtualizor API (if available) or directly manipulate the database (with caution and proper backups) to add or modify IP pools.

Code Example (Ansible Playbook Snippet for LVM Setup):

---
- hosts: virtualizor_server
  become: true
  tasks:
    - name: Create a partition
      parted:
        device: /dev/sdb # Replace with your device
        number: 1
        state: present
        flags: [ lvm ]
        part_type: primary
        # Specify the start and end, or use the entire disk
        # start: 0%
        # end: 100%
    - name: Create a volume group
      lvm:
        vg: vg1
        pvs: /dev/sdb1 # Replace with your partition
        state: present

Benefits:

  • Automation: Reduces manual effort and potential for errors.
  • Idempotency: Ansible ensures the desired state is achieved, even if the playbook is run multiple times.
  • Scalability: Easily manage configurations across multiple Virtualizor servers.
  • Version Control: Playbooks can be stored in version control systems like Git, allowing for tracking changes and rollbacks.

Alternative 2: Using Pre-built Images with Cloud-Init

The traditional approach of adding OS templates involves downloading them from Virtualizor’s template browser. A faster and more customizable alternative is to use pre-built cloud images with Cloud-Init support.

Explanation:

Cloud-Init is a widely used package that allows you to customize cloud instances during their first boot. You can create custom OS images (e.g., using Packer) with your desired software and configurations, and then use Cloud-Init to further customize the VPS during its initial setup. This allows you to skip the template download step in Virtualizor and have a ready-to-use VPS with your specific requirements.

Steps:

  1. Create a Custom Image: Use tools like Packer to build a custom OS image with Cloud-Init installed. Include any base software or configurations you require.
  2. Upload the Image: While Virtualizor’s template browser is the common method, you can potentially use Virtualizor’s API or command-line tools (if available) to upload your custom image to the server’s storage. Another option, if your server has direct access to object storage (like AWS S3 or MinIO), would be to download the image directly from there during VPS creation using a custom script within Cloud-Init.
  3. Configure Cloud-Init: Provide a Cloud-Init configuration file (user-data) when creating the VPS. This file can specify tasks like setting the hostname, adding SSH keys, installing additional software, and configuring network settings.

Code Example (Cloud-Init user-data – install nginx):

#cloud-config
package_update: true
package_upgrade: true
packages:
  - nginx
runcmd:
  - [ systemctl, start, nginx ]
  - [ systemctl, enable, nginx ]

Benefits:

  • Faster Deployment: Skips the template download step, resulting in faster VPS creation.
  • Customization: Allows for creating highly customized VPS instances with pre-installed software and configurations.
  • Consistency: Ensures that all VPS instances are created with the same base configuration.
  • Reduced Network Load: Instead of downloading templates repeatedly, the image is pre-staged.

In summary, while the outlined steps in the original article provide a solid foundation for post-installation configuration in Virtualizor, adopting alternative solutions like configuration management with Ansible or leveraging pre-built images with Cloud-Init can significantly improve efficiency, scalability, and customization capabilities.