Lenovo Servers Setup. CentOS Stream 9 2x x3550 M5 + 1x x3650M5 ![Darren-Longnecker-3sites](https://hackmd.io/_uploads/HkKXc3kVkl.jpg) **Deployment shown below is for the Van Nuys Server** #1 Created RAID 1 on 2x 240G SSDs #2 Created RAID 5 on 6x 1.2TB HDDs #3 Installed CentOS 9 Stream. #4 Selected server with GUI and added Virt selections. #5 root user enabled SSH login. #6 skrenz user added. ![Pic1](https://hackmd.io/_uploads/Hk9a3vy4kg.jpg) #7 updated host name of the server. (forgot to do it during install) using this command "**hostnamectl set-hostname van-nuys.server**" #8 Generate SSH Key pair for the server using the **ssh-keygen -b 4096** command. No passphrase used. ![pic2](https://hackmd.io/_uploads/HJ5D7O1EJe.jpg) #9 updating "authorized keys" on other hosts using the **ssh-copy-id** command. ![image](https://hackmd.io/_uploads/r11okt1N1l.png) #10 updated **/etc/hosts** file with info on other servers ![pic4](https://hackmd.io/_uploads/r1ky3u1Eyg.jpg) #11 Enabled Cockpit "**systemctl enable --now cockpit.socket**" ![image](https://hackmd.io/_uploads/BJDY3dJEkg.png) #11 enable ROOT user to use cockpit by commenting out root in this file. **/etc/cockpit/disallowed-users** ![image](https://hackmd.io/_uploads/ryqqIFy4kg.png) ![image](https://hackmd.io/_uploads/BJWgDtkEke.png) #12 Log into Cockpit and configure a few things. https://192.168.1.219:9090/ ![image](https://hackmd.io/_uploads/HkuHvFyEye.png) #13 DARK MODE! ![image](https://hackmd.io/_uploads/B1WdwFJVke.png) #14 Click View Metrics and history and install PCP support ![image](https://hackmd.io/_uploads/SyLhPF1EJx.png) #15 Click **Metric Settings** and enable **Collect metrics** ![image](https://hackmd.io/_uploads/r1SMOFJ41g.png) #16 Click **Applications** and install **Files** and **Machines** #17 Click **File browser** and create a folder where to mount the RAID 5 Dataset in the **/mnt** directory ![image](https://hackmd.io/_uploads/SykHtYyEJe.png) #18 Click **Storage** and prepare the storage and mount it. Click **3 dots** next to **Free Space** line on the 5.99TB partition and click **Create partition** ![image](https://hackmd.io/_uploads/HJHk9F1E1l.png) Fill in the data and click **Create and mount** ![image](https://hackmd.io/_uploads/SyUv9K1Nke.png) #19 Now create some folders for the Machines program to use for VM and ISO storage. Click **File browser** and create two folders in **/mnt/6TB-RAID5** folder. ![image](https://hackmd.io/_uploads/SkVXsK1VJe.png) #20 Click on **Virtual machines** then click **Storage pools**. Click **Create storage pool**. ![image](https://hackmd.io/_uploads/S1kqstkEyx.png) Name the pool for VMs "**default**" ![image](https://hackmd.io/_uploads/HJORjFJN1l.png) #21 Active both pools ![image](https://hackmd.io/_uploads/Hky-3Y14yg.png) #22 Click on Virtual Machines and select "Network" **Deactivate** then click 3 dots and **delete** the **virbri0** device. ![image](https://hackmd.io/_uploads/ByzRnYy4ke.png) #23 Click **Networking** then click Add Bond and inlcude eno1 and eno2. ![image](https://hackmd.io/_uploads/SJbiaFJEyx.png) ![image](https://hackmd.io/_uploads/Sknr3qkN1e.png) Now lets add a bridge for the VMs to connect to. Click **Add bridge** and select **bond0** ![image](https://hackmd.io/_uploads/rk24b2x4Je.png) ![image](https://hackmd.io/_uploads/r1BL-hl4Jg.png) eno3 and eno4 are ports 3 and 4 of the Systems onboard 4 port 1G NIC. ens1f0 and ens1f1 are the two 10G ports on adapter in PCIe slot 1. enp0s20u13u5 is the servers out of band management adapters connection to the OS. 169.254.95.120 is the OS's address and the IMM2's address is 169.254.95.118. This IP can be accessed from the host console either via SSH or a webUI in the host desktop. This is a way to access the systems managment device "IMM2" in the case its external IP is offline or cable is disconnected. #24 CLick the Servers name in the upper left corner of the cockpit screen and lets add the other hosts so we can manage them from the same web browser window ![image](https://hackmd.io/_uploads/ryj4T9y4Jl.png) Click **Add new host** and fill in the info. Since we added the SSH key pairs, there is no need to type the root password here. Click **ADD** when done ![image](https://hackmd.io/_uploads/By2OT91Ekl.png) Now, click on the name of the server again and select another server to manage. ![image](https://hackmd.io/_uploads/SkF6ackNyl.png) When managing other system, make note of the **Blue Line** across the top of the web UI. That tells you that you are on the system that you originally logged into. ![image](https://hackmd.io/_uploads/BkNLmiJ41l.png) When it is any other color, you are on a remote system. You are able to change the color presented for each host if you select the **Edit hosts** button and chanage the color. ![image](https://hackmd.io/_uploads/ryv1VokVke.png) Click **Edit** ![image](https://hackmd.io/_uploads/rkPe4oyVye.png) Change the color for that host. Click **Set** when done ![image](https://hackmd.io/_uploads/rk_b4jyEJl.png) ******************************************************* Creating a Linux VM #1 Click **Virtual machines** Then click **Create VM**. #2 We are going to allow the tool to **Download an OS** of our choosing. Click dropdown for **Choose an operating system** Set the size of the storage required **50GiB**. Memory of **4GiB** Then click **Create and edit**. ![image](https://hackmd.io/_uploads/HyYyPpJEye.png) #3 Make sure Networking is selected correctly. In this case, **Bridge to LAN** to the **Bridge0** device. ![image](https://hackmd.io/_uploads/B1NFWhx4yg.png) Add more vCPUs if required. Enable Autostart so VM will start on host boot. ![image](https://hackmd.io/_uploads/HyXe_TJNkl.png) #4 Click Install! Then click expand to get a bigger console screen. Walk through the install. ![image](https://hackmd.io/_uploads/Syyzca1Vyg.png) #5. To delete a VM, power off the VM and click the **3 dots** next to the VM name. Click **Delete**. You will be given an option to delete the virtual disk as well. If you uncheck the box, it will leave the virtual disk and simply delete the VM config file. ![image](https://hackmd.io/_uploads/SyN05Ty4Jx.png) ** Migrating VMs to another host ** Requirements: #1 VM is powered ON. #2 SSHs keys installed and share between hosts. (DONE previously) #3 Source host must have a path to target host #4 Target host must have the same network names #5 Source and Target must have the same directory names for the storage paths mounted. **In this case /mnt/6TB-RAID5/VMs/** as this is all part of the VM config file. #6 Migration ports must be opened in the hosts firewall. TCP Ports 49152-49215. #7 Shared storage is optional. Add this like to the **Destination URI** qemu+ssh://hostname-or-IP/system **Note: If you type in that URI, the browser cache will save it so the next time you will be able to select it. Copy and pasting the URI does not do this.** Since no shared storage in this setup, **Copy storage** is selected ![image](https://hackmd.io/_uploads/ryiC2TyEJx.png) Click **Migrate** on target server, VM is in a PAUSED state until all data is moved over and it will be active when it is done. ![image](https://hackmd.io/_uploads/S1Ytp6yV1e.png) This prcess length is dependant on network speed, of course. This 20G VM took about 1 min on a 1G Network. ![image](https://hackmd.io/_uploads/HyFux0kN1e.png) Hope this helps! :) Shane.