Halgrant is a robust solution designed to streamline the process of virtual machine (VM) creation and management. This repository contains a Vagrantfile and supporting scripts that leverage the power of Vagrant, the versatility of AlmaLinux 8.8, and the efficiency of Hyper-V for a seamless VM setup. It's tailored for developers and system administrators who need a reliable, automated, and scalable environment for testing, development, or deployment purposes. Whether you're creating a single VM or orchestrating a cluster, Halgrant offers a simplified yet powerful way to manage your virtual infrastructure.
Key Features:
- Easy Configuration: Set up your VMs with a simple, intuitive configuration process.
- Cross-Platform Compatibility: Utilizing AlmaLinux 8.8, enjoy a stable, secure, and open-source platform.
- Hyper-V Integration: Take advantage of Hyper-V for robust and efficient virtualization.
- Automated Workflow: Automate repetitive tasks in VM provisioning and management.
- Scalability: Effortlessly scale your VM setup as your project grows.
Halgrant is ideal for those who seek a balanced blend of simplicity, power, and flexibility in their virtualization tasks. Dive into the world of efficient VM management with Halgrant!
This command creates a new virtual switch named “vInternal” (used later in Vagrantfile) with the switch type set to Internal. An internal switch allows communication between the virtual machines on the host and the host operating system.
New-VMSwitch -Name "vInternal" -SwitchType Internal
This command gets the basic network adapter properties. By default, it only returns the visible adapters, but you can use the -IncludeHidden or -Physical parameters to include hidden or physical adapters. You can also filter the adapters by name, interface description, or interface index
Get-NetAdapter
When you're successful, you should see something like this:
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
vEthernet (vInternal) Hyper-V Virtual Ethernet Adapter #3 19 Up ----------------- 10 Gbps
Wi-Fi RZ608 Wi-Fi 6E 80MHz 11 Up ----------------- 866.7 Mbps
Ethernet Realtek Gaming 2.5GbE Family Controller 4 Disconnected ----------------- 0 bps
Bluetooth Network Conn... Bluetooth Device (Personal Area Netw... 2 Disconnected ----------------- 3 Mbps
This command enables the optional Windows feature named Microsoft-Hyper-V on the online (running) operating system. The -All parameter specifies that all parent features and subfeatures should also be enabled
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Please, check the details described in official Install Vagrant page
Some of the parameters below need to be adjusted to achieve functionality, and some of them can be adjusted according to your preferences
WORKER_COUNT = 7
NETWORK_PREFIX = "172.21"
NETWORK_MASK = "255.255.240.0"
NETWORK_GATEWAY = "172.21.112.1"
NETWORK_DNS = ["8.8.8.8", "8.8.4.4"]
BOX_NAME = "almalinux/8"
BOX_VERSION = "8.8.20230524"
# Available versions (03/Dec/2023): 8.3.20210203, 8.3.20210222, 8.3.20210330, 8.3.20210427, 8.4.20210527, 8.4.20210724, 8.4.20211014, 8.5.20211111, 8.5.20211118, 8.5.20211208, 8.5.20220316, 8.6.20220513, 8.6.20220715, 8.6.20220802, 8.6.20220819, 8.6.20220830, 8.6.20221001, 8.7.20221112, 8.7.20230228, 8.8.20230524, 8.8.20230606, 8.9.20231125
# Check the compatibility of 'Available versions' with hyperv provider
# https://app.vagrantup.com/almalinux/boxes/8
INFRA_MEMORY = 6144
WORKER_MEMORY = 3072
INFRA_CPU = 8
WORKER_CPU = 4
CUSTOM_USER = "<ChangeMe!>"
CUSTOM_PASS = "<ChangeMe!>"
KEY_PRIV = "<ChangeMe!>"
KEY_PUB = "<ChangeMe!>"
vagrant up
in case of issue related to provider:
vagrant up --provider hyperv
As mentioned above, the infra VM has internet access via the public network and can communicate with the worker nodes via the private network called 'vInternal'.