Tech:Proxmox

IPV6 setup: 1. Go to https://ca.ovh.com/manager/#/configuration/ip?tab=ip

2. Select the host you want to configure the ipv6 address for, from the dropdown.

3. You should see a ipv6 looking address in the list

4. Click on it to expand the list

5. Copy the ipv6 address for example `2001:41d0:800:1056::/64`, you can pick `2001:41d0:800:1056::1` and so on. (You must setup a dns entry for the cloud/vps in the miraheze/dns repo as the ipv6 address requires reverse (it checks that the dns exist)).

6. Now go back to `https://ca.ovh.com/manager/#/configuration/ip?tab=ip` site, click on “You can select an IPv6 from this block by clicking here.” and enter the ipv6 address you choose (make sure the dns is updated by running puppet on the nameserver hosts)

7. Now once that’s all finished, go to the cloud host first afterwards go to the vps.

8. Run `vi /etc/network/interfaces` and put the following.

Cloud setup + vps
1. Install by changing Type Of OS to “Basic”

2. Select “Debian 10 "Buster" - debian10 (Linux)” from the list and proceed to install, make sure to select your ssh key.

3. When you get to the end, enter server name and select your ssh key from the drop down.

4. After server has come back up, login by doing `ssh debian@cloud[num].miraheze.org -i `

5. Edit /etc/hosts and remove `127.0.1.1` section, then add  cloud[num].miraheze.org cloud[num] 6. Edit /etc/cloud/cloud.cfg, changing manage_etc_hosts to false.

7. echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list

8. wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg

9. Run the following `apt update && apt full-upgrade`.

10. Run the following `apt install proxmox-ve postfix open-iscsi`

11. Empty /etc/network/interfaces.d/50-cloud-init.cfg and enter the following:

12. echo “network: {config: disabled}” > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

13. Empty /etc/network/interfaces and insert the following

13. Reboot the server.

14. Run `passwd root` and set the password, make sure it is secure.

15. Run the following `cd /var/lib/vz/template/iso ; wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.3.0-amd64-netinst.iso` (note that this may be removed, in which case bump version like 10.3.0 -> 10.4.0).

16. Run the following `ssh -L 8006:127.0.0.1:8006 @.miraheze.org`

17. Go to https://localhost:8006 (and accept the invalid certificate as connection will be secure due to ssh) and login using your account and password.

18. Create a vm using the UI (make sure after the vm is created, to change the vmac for the network adapter to match that of the fallover ip you want to use (done in ovh ui), you can refer to the ipv6 doc above which some of it will be relevant to doing this).

19. Once VM is setup, click start and go through the installation, when you get onto the network step enter the following (ip is different per vm): `51.77.107.210` for address, `51.77.107.254` for gateway (note the ips should be different, and should be the fallover ips configured in OVH UI) Note that the gateway is the fallover ip.

20. Once vps is started (you may have to change the ordering so that booting disk is first), edit /etc/ssh/sshd_config changing PermitRootLogin to yes. Restart ssh afterwards (`service ssh restart`).

21. Run `ssh root@`.

22. Empty /etc/network/interfaces and insert the following in it (doin’t forget to change the ipv4/ipv6 address, the example shown is for cp6):


 * 1) This file describes the network interfaces available on your system
 * 2) and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

auto lo iface lo inet loopback
 * 1) The loopback network interface

allow-hotplug ens18 auto ens18 iface ens18 inet static address gateway  netmask 255.255.255.0 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 8.8.4.4 dns-search miraheze.org

iface ens18 inet6 static address netmask 64 post-up /sbin/ip -f inet6 route add dev ens18 post-up /sbin/ip -f inet6 route add default via pre-down /sbin/ip -f inet6 route del default via pre-down /sbin/ip -f inet6 route del dev ens18

And reboot the vps

Make sure you follow `IPV6 setup` above for this, replacing the above ip’s.

Firewall
1. apt-get install ufw

2. ufw allow ssh

3. sudo ufw default deny incoming

4. ufw enable

5. sudo ufw allow from  to any port 5404:5405 proto udp

6. sudo ufw allow from to any port 5404:5405 proto udp

7. sudo ufw allow from  to any port 8006 proto tcp (should be done on both cloud hosts)

8. sudo ufw allow from to any port 8006 proto tcp (should be done on both cloud hosts)

Cluster
Creating a cluster:

1. Run the following `ssh -L 8006:127.0.0.1:8006 @.miraheze.org`

2. Go to https://localhost:8006

3. Enter login details, click on “Datacenter” then “Cluster”.

4. Click “Create Cluster” and enter the details.

5. Run the following `pvecm e 1`

6. Click on “Join Cluster”

7. Where it says “Join information” copy what’s in the text box.

8. Now go onto the other cloud virt (for instance, cloud2)

9. Following the above steps to get into cloud2 ui

10. This time instead of clicking “Create Cluster”, we want to click “Join Cluster”

11. Paste into “Join information” text box (the details you copied from cloud1).

And your finished! The two cluster are now configured to connect to each other.