MHC
The easy-way to create and manage a Mini Home Cloud. mHC is built using Shell, Proxmox-VE, Packer, Terraform, Ansible and is not completely reliable for Production environments.
Install / Use
/learn @BarisGece/MHCREADME
<!-- omit in toc -->
Table of Contents<!-- omit in toc -->
Proxmox-VE
It is an open source Server Virtualization Platform. [Proxmox-VE][Proxmox-VE] includes two different virtualization technologies which are Kernel-Based Virtual Machine (KVM) and Container-Based Virtualization (LXC). Proxmox-VE can run on a single node, or assemble a cluster of many nodes. This way, your virtual machines and containers can run on Proxmox-VE with high availability.
<div id="mHC" align="center"> <img src="./img/Proxmox-VE_Architecture.svg" alt="Proxmox-VE Architecture"> </div>Installation - Manual Step
- Download the installer ISO image from: [Proxmox-VE ISO Image][PVE-ISO]
- Create an USB flash drive and Boot from USB
- [baleneEtcher][Etcher] is an easy way to create Proxmox-VE USB flash drive.
| Installing Proxmox VE | |
| :-------------------- | :--- |
| The Proxmox VE menu will be displayed and select Install Proxmox VE to starts the normal installation.<br> [Click for more detail about Options][PVE-Installation] |
|
| After selecting Install Proxmox VE and accepting the EULA, the prompt to select the target hard disk(s) will appear. The Options button opens the dialog to select the target file system. In my instruction, we can select the default file system ext4, or xfs different from the one in the screenshot.<br> The installer creates a Volume Group (VG) called pve, and additional Logical Volumes (LVs) called root, data, and swap. To control the size of these volumes use:<br> <ul><li>hdsize: The total hard disk size to be used (Mine: 223)</li><li>swapsize: Defines the size of the swap volume. The default is the size of the installed memory, minimum 4 GB and maximum 8 GB. The resulting value cannot be greater than hdsize/8. If set to 0, no swap volume will be created (Mine: 4) </li><li>maxroot: Defines the maximum size of the root volume, which stores the operation system. The maximum limit of the root volume size is hdsize/4 (Mine: 23)</li><li>minfree: Defines the amount of free space left in the LVM volume group pve. With more than 128GB storage available the default is 16GB, else hdsize/8 will be used (Mine: 16)</li><li>maxvz: Defines the maximum size of the data volume. The actual size of the data volume is:<br> datasize = hdsize - rootsize - swapsize - minfree<br> Where datasize cannot be bigger than maxvz (Mine: 180)</li></ul><br> [Click for more detail about Advanced LVM Options][PVE-LVM_Options] |
|
| After setting the disk options the next page asks for basic configuration options like the location, the time zone, and keyboard layout. They only need to be changed in the rare case that auto detection fails or a different keyboard layout should be used. |
|
| Next the password of the superuser (root) and an email address needs to be specified. The password must be at least 5 characters. However, it is highly recommended that you use a stronger password, so set a password that is at least 12 to 14 characters. The email address is used to send notifications to the system administrator. |
|
| The last step is the network configuration. Please note that during installation you can either use an IPv4 or IPv6 address, but not both. To configure a dual stack node, add additional IP addresses after the installation. There will be created a proxmox cluster consisting of 3 physical servers. Therefore, 3 different network information is given below.<ul><li>Management Interface: xx:xx:xx:xx:30:39 - xx:xx:xx:xx:30:31 - xx:xx:xx:xx:2f:04</li><li>Hostname(FQDN): one.mhc.pve - two.mhc.pve - three.mhc.pve</li><li>IP Adress: 192.168.50.10 - 192.168.50.20 - 192.168.50.30</li><li>Netmask: 255.255.255.0</li><li>Gateway: 192.168.50.1</li><li>DNS Server: 192.168.50.1</li></ul> |
|
| The next step shows a summary of the previously selected options. Re-check every setting and use the Previous button if a setting needs to be changed. To accept, press Install. The installation starts to format disks and copies packages to the target. Please wait until this step has finished; then remove the installation medium and restart your system.<br> Then point your browser to the IP address given during installation https://youripaddress:8006 to reach Proxmox Web Interface.<br> Default login is "root" and the root password is defined(step 4) during the installation process. |
|
- After the installation is completed, the files which repositories are defined should be as follows in order to use APT Package Management tool successfully.
- File /etc/apt/sources.list
deb http://ftp.debian.org/debian buster main contribdeb http://ftp.debian.org/debian buster-updates main contribdeb http://security.debian.org/debian-security buster/updates main contribdeb http://download.proxmox.com/debian/pve buster pve-no-subscription- Note: PVE pve-no-subscription repository provided by proxmox.com, but NOT recommended for production use
- File /etc/apt/sources.list
- File /etc/apt/sources.list.d/pve-enterprise.list
#deb https://enterprise.proxmox.com/debian/pve buster pve-enterprise
- Then check
localeif there is an error like "Cannot set LC_ALL(or others) to default locale: No such file or directory"- Run the following commands for each error
echo "export LC_CTYPE=en_US.UTF-8" >> ~/.bashrcecho "export LC_ALL=en_US.UTF-8" >> ~/.bashrcsource ~/.bashrc- then run the following commands once
locale-gen en_US en_US.UTF-8dpkg-reconfigure localeschoose en_US.UTF-8
- Run the following commands for each error
- Get latest updates
apt update && apt upgrade -y && apt dist-upgrade
- RESTART/REBOOT System
- For more information to [Create Proxmox-VE Cluster][Create Proxmox-VE Cluster]
Creating Ubuntu Image
Ubuntu ISO images can be downloaded from [releases of Ubuntu][releases of Ubuntu]. For popular architectures, please use releases of Ubuntu. Also other Ubuntu images not found on releases of Ubuntu, such as builds for less popular architectures and other non-standard and unsupported images and daily build images, can downloaded from [the cdimage server][the cdimage server]. For old releases, see [old-releases of Ubuntu][old-releases of Ubuntu].
As of the Ubuntu LTS release in 2020, the server documentation has moved to [Ubuntu Server Guide][Ubuntu Server Guide]. However; the detailed ubuntu latest LTS installation guide can be found [here][Ubuntu Installation Guide].
Fully automated installations are possible on Ubuntu using [Ubuntu Installer(debian-installer)][Ubuntu Installer(debian-installer)] or [Ubuntu Live Server Installer(autoinstall)][Ubuntu Live Server Installer(autoinstall)].
- The Ubuntu Installer (based on the Debian Installer, and so often called simply debian-installer or just d-i) consists of a number of special-purpose components to perform each installation task. The debian-installer(d-i)) supports automating installs via preconfiguration(preseed.cfg) files. Preseeding method provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. For more information visit [Automating the Installation using Preseeding][Automating the Installation using Preseeding], [Example Preseed File][Example Preseed File] and [Packer Preseed Ubuntu][Packer Preseed Ubuntu].
- However, Ubuntu [announced][Server installer plans for 20.04 LTS] that it will complete the transition to the Live Server Installer(autoinstall) with 20.04 LTS. It lets you answer all those configuration questi
