Archives 2024

Proxmox VM Live Migration | Migrate VM to another host without Downtime

  1. Cluster Setup: Ensure that your Proxmox hosts are part of the same cluster. A Proxmox cluster consists of multiple Proxmox VE servers (nodes) combined to offer high availability and load balancing to virtual machines. Nodes in a cluster share resources such as storage and can migrate VMs between each other.
  2. Shared Storage: Live migration requires shared storage accessible by both the source and target hosts. This shared storage can be implemented using technologies like NFS, iSCSI, or Ceph. Shared storage allows the VM’s disk images and configuration files to be accessed by any node in the cluster.
  3. Migration Prerequisites: Before initiating a live migration, ensure that the target host has enough resources (CPU, memory, storage) to accommodate the migrating VM. Proxmox will check these prerequisites before allowing the migration to proceed.
  4. Initiating Migration: In the Proxmox web interface (or using the Proxmox command-line interface), select the VM you want to migrate and choose the “Migrate” option. Proxmox will guide you through the migration process.
  5. Migration Process:
    • Pre-Copy Phase: Proxmox starts by copying the memory pages of the VM from the source host to the target host. This is done iteratively, with the majority of memory pages copied in the initial phase.
    • Stopping Point: At a certain point during the migration, Proxmox determines a stopping point. This is the point at which the VM will be paused briefly to perform a final synchronization of memory pages and state information.
    • Pause and Synchronization: The VM is paused on the source host, and any remaining memory pages and state information are transferred to the target host. This pause is usually very brief, minimizing downtime.
    • Completion: Once the final synchronization is complete, the VM is resumed on the target host. From the perspective of the VM and its users, the migration is seamless, and the VM continues to run without interruption on the target host.
  6. Post-Migration: After the migration is complete, the VM is running on the target host. You can verify this in the Proxmox web interface or using the command-line tools. The source host frees up resources previously used by the migrated VM.
  7. High Availability (HA): In a Proxmox cluster with HA enabled, if a host fails, VMs running on that host can be automatically migrated to other hosts in the cluster, ensuring minimal downtime.

Overall, Proxmox VM live migration is a powerful feature that enables you to move virtual machines between hosts in a Proxmox cluster with minimal downtime, providing flexibility and high availability for your virtualized environment.

Proxmox Cluster | Free Virtualization with HA Feature | Step by Step

    1. Cluster Configuration:
      • Nodes: A Proxmox cluster consists of multiple nodes, which are physical servers running Proxmox VE.
      • Networking: Nodes in a Proxmox cluster should be connected to a common network. A private network for internal communication and a public network for client access are typically configured.
      • Shared Storage: Shared storage is crucial for a Proxmox cluster to enable features like live migration and high availability. This can be achieved through technologies like NFS, iSCSI, or Ceph.
    2. High Availability (HA):
      • Proxmox VE includes a feature called HA, which ensures that critical VMs are automatically restarted on another node in the event of a node failure.
      • HA relies on fencing mechanisms to isolate a failed node from the cluster and prevent split-brain scenarios. This can be achieved through power fencing (e.g., IPMI, iLO, iDRAC) or network fencing (e.g., switch port blocking).
      • When a node fails, the HA manager on the remaining nodes detects the failure and initiates the restart of the affected VMs on healthy nodes.
    3. Corosync and Pacemaker:
      • Proxmox VE uses Corosync as the messaging layer and Pacemaker as the cluster resource manager. These components ensure that cluster nodes can communicate effectively and coordinate resource management.
      • Corosync provides a reliable communication channel between nodes, while Pacemaker manages the resources (VMs, containers, services) in the cluster and ensures they are highly available.
    4. Resource Management:
      • Proxmox clusters allow for dynamic resource allocation, allowing VMs and containers to use resources based on demand.
      • Memory and CPU resources can be allocated and adjusted for each VM or container, and live migration allows these resources to be moved between nodes without downtime.
    5. Backup and Restore:
      • Proxmox includes backup and restore functionality, allowing administrators to create scheduled backups of VMs and containers.
      • Backups can be stored locally or on remote storage, providing flexibility in backup storage options.
    6. Monitoring and Logging:
      • Proxmox provides monitoring and logging capabilities to help administrators track the performance and health of the cluster.
      • The web interface includes dashboards and graphs for monitoring resource usage, as well as logs for tracking cluster events.
    7. Updates and Maintenance:
      • Proxmox clusters can be updated and maintained using the web interface or command-line tools. Updates can be applied to individual nodes or the entire cluster.

    Replace expensive VMware to Proxmox, Free Virtualization Platform | How to Install Proxmox

    1. Download Proxmox VE ISO:
    2. Create a Bootable USB Drive:
    3. Boot from USB Drive:
      • Insert the bootable USB drive into the server where you want to install Proxmox VE.
      • Power on or restart the server and boot from the USB drive. You may need to change the boot order in the BIOS settings to boot from USB.
    4. Proxmox VE Installer:
      • Once the server boots from the USB drive, you’ll see the Proxmox VE installer menu.
      • Select “Install Proxmox VE” and press Enter.
    5. Select Installation Target:
      • Select the target disk where you want to install Proxmox VE. This will typically be the server’s local disk.
      • You can choose to use the entire disk for Proxmox VE or manually partition the disk.
    6. Set Root Password:
      • Set a password for the root user of the Proxmox VE system.
    7. Configure Network:
      • Configure the network settings for Proxmox VE. This includes setting the IP address, netmask, gateway, and DNS servers.
    8. Begin Installation:
      • Review the installation summary and confirm to begin the installation process.
    9. Installation Progress:
      • The installer will copy the necessary files and install Proxmox VE on the selected disk. This may take some time depending on your hardware.
    10. Installation Complete:
      • Once the installation is complete, remove the USB drive and reboot the server.
    11. Access Proxmox VE Web Interface:
      • Open a web browser on a computer connected to the same network as the Proxmox VE server.
      • Enter the IP address of the Proxmox VE server in the address bar.
      • Log in to the Proxmox VE web interface using the root user and the password you set during installation.
    12. Configure Proxmox VE:
      • From the web interface, you can configure additional settings such as storage, networks, and backups.
    13. Create VMs and Containers:
      • Use the web interface to create virtual machines (VMs) and containers to run your applications and services.

    Setup Free Firewall at Home or Office, Install and Configure pfSense

    1. Download pfSense:
      • Go to the pfSense website (https://www.pfsense.org/download/) and download the appropriate installation image for your hardware. Choose between the Community Edition (CE) or pfSense Plus.
    2. Create Installation Media:
      • Burn the downloaded image to a CD/DVD or create a bootable USB drive using software like Rufus (for Windows) or dd (for Linux).
    3. Boot from Installation Media:
      • Insert the installation media into the computer where you want to install pfSense and boot from it. You may need to change the boot order in the BIOS settings.
    4. Install pfSense:
      • Follow the on-screen instructions to install pfSense. You’ll be asked to select the installation mode (e.g., Quick/Easy Install, Custom Install), configure network interfaces, set up disk partitions, and create an admin password.
    5. Reboot:
      • Once the installation is complete, remove the installation media and reboot the computer.

    Configuration:

    1. Initial Setup:
      • After rebooting, pfSense will start up and present you with a console menu.
      • Use the keyboard to select ‘1’ to boot pfSense in multi-user mode.
    2. Access the Web Interface:
      • Open a web browser on a computer connected to the same network as pfSense.
      • Enter the IP address of the pfSense firewall in the address bar (default is 192.168.1.1).
      • Log in with the username ‘admin’ and the password you set during installation.
    3. Initial Configuration Wizard:
      • The first time you access the web interface, you’ll be guided through the initial configuration wizard.
      • Set the WAN and LAN interfaces, configure the LAN IP address, set the time zone, and configure the admin password.
    4. Configure Interfaces:
      • Navigate to ‘Interfaces’ in the web interface to configure additional interfaces if needed (e.g., DMZ, OPT interfaces). Assign interfaces and configure IP addresses.
    5. Firewall Rules:
      • Set up firewall rules under ‘Firewall’ > ‘Rules’ to allow or block traffic between interfaces. Configure rules for the WAN, LAN, and any additional interfaces.
    6. NAT (Network Address Translation):
      • Configure NAT rules under ‘Firewall’ > ‘NAT’ to translate private IP addresses to public IP addresses. Set up Port Forwarding, 1:1 NAT, or Outbound NAT rules as needed.
    7. DHCP Server:
      • If you want pfSense to act as a DHCP server, configure DHCP settings under ‘Services’ > ‘DHCP Server’. Set up the range of IP addresses to lease, DNS servers, and other DHCP options.
    8. VPN:
      • Set up VPN connections (e.g., OpenVPN, IPsec) under ‘VPN’ > ‘IPsec’ or ‘OpenVPN’. Configure VPN settings, certificates, and user authentication.
    9. Packages:
      • Install additional packages for extra functionality under ‘System’ > ‘Package Manager’. Popular packages include Snort (for Intrusion Detection/Prevention), Squid (for web caching), and HAProxy (for load balancing).
    10. Save Configuration:
      • Click on ‘Apply Changes’ to save your configuration.
    11. Final Steps:
      • Test your configuration to ensure everything is working as expected.
      • Consider setting up backups of your pfSense configuration under ‘Diagnostics’ > ‘Backup & Restore’.

    How to Run Any Specific Command or Script on Linux Startup

    1. Using cron:

    The cron method is convenient for running commands or scripts at startup. The @reboot directive in the crontab allows you to specify tasks to be run when the system starts.

    Open the crontab file

    crontab -e

    Add the following line:

    @reboot /path/to/your/script.sh

    Save and exit the editor. This ensures that your script will run each time the system reboots.

    2. Using rc.local:

    The /etc/rc.local file is traditionally used to run commands at the end of the system boot process.

    Open the rc.local file

    sudo nano /etc/rc.local

    Add your command or script just before the exit 0 line:

    /path/to/your/script.sh

    Save and exit. Make sure the file is executable:

    sudo chmod +x /etc/rc.local

    This method may not be available on all distributions, as some are moving away from using rc.local in favor of systemd.

    3. Using systemd:

    Systemd is a modern init system used by many Linux distributions. You can create a systemd service to execute your script at startup.

    Create a new service file, for example, /etc/systemd/system/myscript.service:

    [Unit]
    Description=My Startup Script

    [Service]
    ExecStart=/path/to/your/script.sh

    [Install]
    WantedBy=default.target

    Reload systemd and enable/start the service:

    sudo systemctl daemon-reload
    sudo systemctl enable myscript.service
    sudo systemctl start myscript.service

    This method provides more control and flexibility and is widely used in modern Linux distributions.

    4. Using ~/.bashrc or ~/.bash_profile (for user-specific commands):

    If you want a command or script to run when a specific user logs in, you can add it to the ~/.bashrc or ~/.bash_profile file.

    Open the .bashrc file

    nano ~/.bashrc

    Add your command or script at the end of the file:

    /path/to/your/script.sh

    Save and exit the editor. This method is user-specific and will run the script when the user logs in.

    Remember to replace /path/to/your/script.sh with the actual path to your script or command in each case. The appropriate method may vary depending on your distribution and system configuration.

    FortiGate 80F Firewall Unbox and Configure

    Unboxing:

    1. Inspect the Package:
      • Open the shipping box and check for the following components:
        • FortiGate 80F unit
        • Power adapter
        • Ethernet cables
        • Mounting hardware (if applicable)
        • Documentation and setup guide
    2. Connectivity:
      • Identify the WAN (Wide Area Network), LAN (Local Area Network), and DMZ (Demilitarized Zone) ports on the FortiGate 80F.
      • Connect the appropriate network cables to these ports based on your network architecture.
    3. Power On:
      • Connect the power adapter to the FortiGate 80F and plug it into a power source.
      • Power on the device and wait for it to complete the boot-up process. You can monitor the status using the indicator lights on the unit.

    Initial Configuration:

    1. Access Web Interface:
      • Open a web browser and enter the default IP address of the FortiGate 80F (e.g., https://192.168.1.99).
      • Log in using the default credentials (usually “admin” for both username and password).
    2. Initial Setup Wizard:
      • Follow the prompts of the setup wizard to configure basic settings:
        • Set the system name and administrator password.
        • Configure the time zone and date/time settings.
    3. Network Configuration:
      • Set up the WAN and LAN interfaces:
        • Assign IP addresses to the interfaces.
        • Define DHCP settings if applicable.
        • Configure any additional interfaces based on your network design.
    4. Security Policies:
      • Define security policies to control traffic flow. This includes inbound and outbound rules based on source, destination, and services.
      • Implement firewall rules, NAT (Network Address Translation), and security profiles (antivirus, intrusion prevention, etc.).
    5. Update Firmware:
      • Check for firmware updates in the web interface.
      • Download and apply the latest firmware to ensure security patches and feature enhancements.
    6. VPN Configuration (Optional):
      • If your organization requires VPN connectivity, configure VPN settings:
        • Set up IPsec or SSL VPN tunnels.
        • Define VPN users and access policies.
    7. Monitoring and Logging:
      • Configure logging settings to capture events and monitor network activity.
      • Set up alerts for critical events.
    8. User Authentication (Optional):
      • If applicable, configure user authentication:
        • Integrate with LDAP or RADIUS for centralized user management.
        • Implement two-factor authentication for additional security.
    9. Wireless Configuration (Optional):
      • If the FortiGate 80F has wireless capabilities, configure wireless settings, including SSID, security protocols, and access controls.
    10. Testing:
      • Perform thorough testing to ensure that the firewall is functioning as expected.
      • Test internet access, VPN connections, and the enforcement of security policies.