LabNameGen is a flexible and dynamic hostname generator tailored for homelab environments, built with WPF in C#. It simplifies the process of generating consistent, professional hostnames based on customizable inputs such as location, operating system, hypervisor, and VMware products. The tool is designed for homelab enthusiasts, system administrators, and IT professionals who want to maintain a clean, organized naming convention across their infrastructure.
- IP-Based Hostname Generation: Automatically extracts and uses the last two octets of the IP address.
- Location Awareness: Supports multiple predefined locations such as
HLDCA
(Homelab DC A) andCDCB
(Contabo VPS). - Dynamic Input Handling: Automatically adjusts available input fields based on selected VMware products.
- Clean, Consistent Hostnames: Generates hostnames following best practices (lowercase, alphanumeric with hyphen).
- Custom VMware Product Abbreviations: Includes support for products like vCenter, ESXi, NSX, vSAN, and more.
- Easy-to-Use UI: Modern, responsive WPF interface that’s intuitive and efficient.
VMware Product | Location | Example Output |
---|---|---|
vCenter Appliance | HLDCA | hldca-vca-17820 |
ESXi | CDCB | cdcb-esx-17820 |
Ubuntu + VMware | HLDCA | hldca-vmw-ubnt-17820 |
Windows Server Core | CDCB | cdcb-vmw-wsc-17820 |
- Windows OS
- .NET Core SDK (or any recent .NET runtime for C#)
- Visual Studio or any C# IDE
-
Clone the Repository:
git clone https://github.com/Paul1404/LabNameGen.git cd labnamegen
-
Open the Project in Visual Studio:
- Navigate to the project folder and open the
.csproj
file with Visual Studio or your preferred C# IDE.
- Navigate to the project folder and open the
-
Build and Run:
- Simply build and run the application within your IDE.
- Enter IP Address: Input the device's IP address (e.g.,
192.168.178.20
). - Select Location: Choose the location from the dropdown (e.g.,
HLDCA
,CDCB
). - Choose VMware Product or OS + Hypervisor: Select a VMware product (e.g., vCenter, ESXi) or configure your OS and hypervisor manually.
- Generate: Click
Generate Hostname
to see your dynamically generated hostname. - Copy: Use the
Copy
button to copy the hostname to the clipboard for quick usage. - Clear: Reset the form with the
Clear
button.
The application dynamically adjusts based on user input. For example:
-
If a VMware product like vCenter Appliance is selected, OS and Hypervisor fields are hidden to avoid redundancy.
-
Hostnames are generated in the format:
<location>-<product/hypervisor>-<os>-<last-two-octets>
The CleanHostname()
function ensures all hostnames follow best practices (lowercase, limited special characters, length ≤ 63 characters).
We welcome contributions to LabNameGen! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push the changes (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.