<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>VM on Kevin Heruer</title><link>/tags/vm/</link><description>Recent content in VM on Kevin Heruer</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 21 Jan 2022 21:00:00 +0100</lastBuildDate><atom:link href="/tags/vm/index.xml" rel="self" type="application/rss+xml"/><item><title>Monitoring is important</title><link>/posts/2022/01/21/monioring-is-important/</link><pubDate>Fri, 21 Jan 2022 21:00:00 +0100</pubDate><guid>/posts/2022/01/21/monioring-is-important/</guid><description>I&amp;rsquo;ve been experimenting with monitoring systems because I was not satisfied with Proxmox&amp;rsquo;s limited reporting of system stats. But that was not the only reason I set up a monitoring system.
I stumbled upon SNMP (Simple Network Management Protocol) and found it it&amp;rsquo;s implemented in anything that has a network connection, it&amp;rsquo;s even implemented in printers and routers. This protocol lets you fetch (and set) a limited set of data, but this is enough for monitoring.</description><content>&lt;p>I&amp;rsquo;ve been experimenting with monitoring systems because I was not satisfied with
Proxmox&amp;rsquo;s limited reporting of system stats. But that was not the only reason
I set up a monitoring system.&lt;/p>
&lt;p>I stumbled upon SNMP (Simple Network Management Protocol) and found it it&amp;rsquo;s
implemented in anything that has a network connection, it&amp;rsquo;s even implemented
in printers and routers. This protocol lets you fetch (and set) a limited set of
data, but this is enough for monitoring. At first I set up Observium, it&amp;rsquo;s a valid
system but I quickly ran in the problem that it doesn&amp;rsquo;t play nice with mDNS for
some reason. I also have not set up an enterprice grade network so I do not have
a local DNS server. I do not want to hack into hosts files or use IP addresses
even though all non-user systems have static IP addresses.&lt;/p>
&lt;p>Next was Zabbix, it&amp;rsquo;s open source and very mature software. Setting it up
(correctly) was quite a lot of work, and the learning curve is a bit steep if you
never really used complete monitoring systems before. However, once Zabbix was
set up and using the built-in templates it&amp;rsquo;s quite easy to start monitoring a
server.&lt;/p>
&lt;p>Currently I have 11 servers running in VM on Proxmox, adding a server to Zabbix
is as easy as &lt;code>apt install zabbix-agent&lt;/code> and adding an IP range into the config.
The most work I had to do for a server was getting the source and building it
myself which was unnecessary because I had to restore the backup anyway
(long story short: I upgraded the OS, it got borked).&lt;/p>
&lt;p>Once I started adding my hosts I noticed that I was getting long disk write wait&amp;rsquo;s,
this could mean a lot of things. Including failing drives. I ignored it mostly and
continued adding all the servers, once that was done I saw more servers throwing
this error. I started investigating and found out there were 2 servers running
MySQL/MariaDB database servers for the applications running on the servers, turns
out that database servers love to read and write (duh). They were slamming the cheap
HDD&amp;rsquo;s I&amp;rsquo;m running in the server which they didn&amp;rsquo;t like, I optimized the configs for
the databases and now most is well.&lt;/p>
&lt;p>&lt;a href="/posts/2022/01/21/images/mysql_config_tweak_full.png">
&lt;figure class="left" >
&lt;img src="/posts/2022/01/21/images/mysql_config_tweak.png" />
&lt;/figure>
&lt;/a>&lt;/p>
&lt;p>I did notice an increase in server/VM responsiveness but the warning(s) still remain,
however looking at the graph it does show a great improvement and it currently just
barely triggers the warning each time. I&amp;rsquo;m thinking of increasing the check for now
and see if I can upgrade the HDD&amp;rsquo;s in the future.&lt;/p>
&lt;p>Another thing I noticed was that running a DB from an SSD really makes a difference:&lt;/p>
&lt;p>&lt;a href="/posts/2022/01/21/images/migration_full.png">
&lt;figure class="left" >
&lt;img src="/posts/2022/01/21/images/migration.png" />
&lt;/figure>
&lt;/a>&lt;/p>
&lt;p>It&amp;rsquo;s obvious SSDs are fast, but seeing a direct impact is really cool! I suggest you
start setting up a monitoring system if you have any interest, the things you can
do with the data is amazing. I might even connect Home Assistant to Zabbix so I have
a single dashboard for all the data.&lt;/p></content></item><item><title>Increasing VM disk size: Final edition</title><link>/posts/2021/07/23/increasing-vm-disk-size-final-edition/</link><pubDate>Fri, 23 Jul 2021 21:47:00 +0100</pubDate><guid>/posts/2021/07/23/increasing-vm-disk-size-final-edition/</guid><description>This post merges both A little follow up on this post and Increasing Disk Size on Existing VM and fixes a couple of mistakes.
First off, go to your Proxmox host. Run the resize command: bash qm resize &amp;lt;vmid&amp;gt; &amp;lt;disk&amp;gt; &amp;lt;size&amp;gt; where vmid is the ID in your VM ID, disk is the identifier of the disk inside the VM, it&amp;rsquo;s most likely to be scsi0. size is the size you want to add or remove, something like +100G or +1T is both valid.</description><content>&lt;p>This post merges both &lt;a href="/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk">A little follow up on this post&lt;/a> and &lt;a href="/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk">Increasing Disk Size on Existing VM&lt;/a>
and fixes a couple of mistakes.&lt;/p>
&lt;p>First off, go to your Proxmox host. Run the resize command:
&lt;div class="collapsable-code">
&lt;input id="763845219" type="checkbox" />
&lt;label for="763845219">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
qm resize &amp;lt;vmid&amp;gt; &amp;lt;disk&amp;gt; &amp;lt;size&amp;gt;
&lt;/code>&lt;/pre>
&lt;/div>
where &lt;code>vmid&lt;/code> is the ID in your VM ID, &lt;code>disk&lt;/code> is the identifier of the disk inside the VM, it&amp;rsquo;s most likely to be &lt;code>scsi0&lt;/code>.
&lt;code>size&lt;/code> is the size you want to add or remove, something like &lt;code>+100G&lt;/code> or &lt;code>+1T&lt;/code> is both valid.&lt;/p>
&lt;p>Now go into your VM, run the following command to check if the system has notices a disk resize:
&lt;div class="collapsable-code">
&lt;input id="617843592" type="checkbox" />
&lt;label for="617843592">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
dmesg | grep sda
&lt;/code>&lt;/pre>
&lt;/div>
Where &lt;code>sda&lt;/code> is the disk, it could be vda or sdb.&lt;/p>
&lt;p>Run the following command to get your disk and display the partitions, remember to change &lt;code>sda&lt;/code> if required.
&lt;div class="collapsable-code">
&lt;input id="147835296" type="checkbox" />
&lt;label for="147835296">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
fdisk -l /dev/sda | grep ^/dev
&lt;/code>&lt;/pre>
&lt;/div>
Remember the number of the partition you want to increase, it&amp;rsquo;s most likely the biggest one.&lt;/p>
&lt;p>Run the following command to open parted with the drive:
&lt;div class="collapsable-code">
&lt;input id="394721685" type="checkbox" />
&lt;label for="394721685">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
parted /dev/sda
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>Run a &lt;code>list&lt;/code> to check if everything is recognized correctly and run the following command:
&lt;div class="collapsable-code">
&lt;input id="438971526" type="checkbox" />
&lt;label for="438971526">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
resizepart &amp;lt;partition number, integer only&amp;gt; 100%
&lt;/code>&lt;/pre>
&lt;/div>
You could change the 100% to add only a percentage of the free space and add the remaining
space to another partition, but to keep it simple we&amp;rsquo;ll give it all to this partition.&lt;/p>
&lt;p>If it asks to fix the unused space type &lt;code>F&lt;/code> to fix it, if it asks for a partition number and
size; just put in the values like above.&lt;/p>
&lt;p>Ctrl-C out of Parted and run &lt;code>df -h&lt;/code>, you&amp;rsquo;ll notice that you still do not have your extra space!
Run &lt;code>pvresize /dev/&amp;lt;block&amp;gt;&lt;/code> to start resizing, remember to subsitute &lt;code>&amp;lt;block&amp;gt;&lt;/code> with your partition
like &lt;code>sda3&lt;/code>.&lt;/p>
&lt;p>Now run &lt;code>lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv&lt;/code> and &lt;code>resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv&lt;/code>
to actually resize your LVM partition. Remember to replace &lt;code>/dev/mapper/ubuntu--vg-ubuntu--lv&lt;/code>
with your LVM partition, you can find it by running &lt;code>df -h&lt;/code> and looking for the one mounted on &lt;code>/&lt;/code>.&lt;/p>
&lt;p>That&amp;rsquo;s it! The drive has been expanded and readily available, no need to reboot!&lt;/p>
&lt;p>Sources:&lt;br>
&lt;a href="https://pve.proxmox.com/wiki/Resize_disks">https://pve.proxmox.com/wiki/Resize_disks&lt;/a>&lt;/p></content></item><item><title>Follow up on increasing existing VM disk size</title><link>/posts/2021/03/21/follow-up-on-increasing-existing-vm-disk-size/</link><pubDate>Sun, 21 Mar 2021 13:47:57 +0100</pubDate><guid>/posts/2021/03/21/follow-up-on-increasing-existing-vm-disk-size/</guid><description>A little follow up on this post: Increasing Disk Size on Existing VM Disk
When extending an LVM system you should also run the following commands:
pvresize /dev/sda3 (replace with your partition)
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv (replace with your lvm partition)
resize2fs /dev/mapper/dev/ubuntu--vg-ubuntu--lv (again replace with your lvm partition)</description><content>&lt;p>A little follow up on this post: &lt;a href="/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk">Increasing Disk Size on Existing VM Disk&lt;/a>&lt;/p>
&lt;p>When extending an LVM system you should also run the following commands:&lt;/p>
&lt;p>&lt;code>pvresize /dev/sda3&lt;/code> (replace with your partition)&lt;/p>
&lt;p>&lt;code>lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv&lt;/code> (replace with your lvm partition)&lt;/p>
&lt;p>&lt;code>resize2fs /dev/mapper/dev/ubuntu--vg-ubuntu--lv&lt;/code> (again replace with your lvm partition)&lt;/p></content></item><item><title>Increasing Disk Size on Existing VM Disk</title><link>/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk/</link><pubDate>Thu, 21 Jan 2021 17:05:03 +0100</pubDate><guid>/posts/2021/01/21/increasing-disk-size-on-existing-vm-disk/</guid><description>When you&amp;rsquo;re using your Proxmox server you might run in the problem of not having enough HDD space defined for some of your VMs, using ZFS (pools) it&amp;rsquo;s really easy to fix this.
Since all my VM disks are simple files you can easily increase their size by running the following command: bash qm resize &amp;lt;vmid&amp;gt; &amp;lt;disk&amp;gt; &amp;lt;size&amp;gt; Let&amp;rsquo;s say you have a VM with a disk named vm-100-disk-0 and you wan to increase the disk size by 100GB, you just run bash qm resize 100 vm-100-disk-0 &amp;#43;100G and you&amp;rsquo;re halfway there!</description><content>&lt;p>When you&amp;rsquo;re using your Proxmox server you might run in the problem of not having enough
HDD space defined for some of your VMs, using ZFS (pools) it&amp;rsquo;s really easy to fix this.&lt;/p>
&lt;p>Since all my VM disks are simple files you can easily increase their size by running
the following command:
&lt;div class="collapsable-code">
&lt;input id="157429683" type="checkbox" />
&lt;label for="157429683">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
qm resize &amp;lt;vmid&amp;gt; &amp;lt;disk&amp;gt; &amp;lt;size&amp;gt;
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>Let&amp;rsquo;s say you have a VM with a disk named vm-100-disk-0 and you wan to increase the disk
size by 100GB, you just run
&lt;div class="collapsable-code">
&lt;input id="582417639" type="checkbox" />
&lt;label for="582417639">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
qm resize 100 vm-100-disk-0 &amp;#43;100G
&lt;/code>&lt;/pre>
&lt;/div>
and you&amp;rsquo;re halfway there!&lt;/p>
&lt;p>Now you need to tell the VM to use the newly added space, first you need to check if
the system sees the new space by running
&lt;div class="collapsable-code">
&lt;input id="395684127" type="checkbox" />
&lt;label for="395684127">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
dmesg | grep sda
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>Now we need the right partition to add the space to, run the following to check which
partitions there are
&lt;div class="collapsable-code">
&lt;input id="594613782" type="checkbox" />
&lt;label for="594613782">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
fdisk -l /dev/sda | grep ^/dev
&lt;/code>&lt;/pre>
&lt;/div>
Remember the number /dev/sda3 for example would be 3.&lt;br>
(Just make sure you&amp;rsquo;re grepping the right device, vda is also a possibility.)&lt;/p>
&lt;p>Now run pared with the right device
&lt;div class="collapsable-code">
&lt;input id="539741826" type="checkbox" />
&lt;label for="539741826">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
parted /dev/sda
&lt;/code>&lt;/pre>
&lt;/div>
&lt;/p>
&lt;p>It will ask you to fix the unused space, enter &lt;code>F&lt;/code> for fix, then run
&lt;div class="collapsable-code">
&lt;input id="549763812" type="checkbox" />
&lt;label for="549763812">
&lt;span class="collapsable-code__language">bash&lt;/span>
&lt;span class="collapsable-code__toggle" data-label-expand="△" data-label-collapse="▽">&lt;/span>
&lt;/label>
&lt;pre class="language-bash" >&lt;code>
resizepart 3 100%
&lt;/code>&lt;/pre>
&lt;/div>
This will resize partition (sda)3 to use 100% of the newly added space.&lt;/p>
&lt;p>That&amp;rsquo;s it, no need to reboot!&lt;/p>
&lt;p>You can find a more detailed description at the source: &lt;a href="https://pve.proxmox.com/wiki/Resize_disks">https://pve.proxmox.com/wiki/Resize_disks&lt;/a>&lt;/p></content></item><item><title>My Proxmox Setup</title><link>/posts/2021/01/11/my-proxmox-setup/</link><pubDate>Mon, 11 Jan 2021 11:39:26 +0100</pubDate><guid>/posts/2021/01/11/my-proxmox-setup/</guid><description>Proxmox VE is an interface for managing virtual machines and containers, it&amp;rsquo;s a lightweight solution that could run from ram/usb stick. Proxmox has more solutions like backup and email etc. but I only use the VE software. It&amp;rsquo;s free and open-source, is production ready, and is being worked on actively.
With Proxmox VE you can setup VMs on machines and also cluster multiple machines together, it&amp;rsquo;s easy to use (if you know how to use it) and fast.</description><content>&lt;p>Proxmox VE is an interface for managing virtual machines and containers,
it&amp;rsquo;s a lightweight solution that &lt;em>could&lt;/em> run from ram/usb stick.
Proxmox has more solutions like backup and email etc. but I only use the VE
software. It&amp;rsquo;s free and open-source, is production ready, and is being worked
on actively.&lt;/p>
&lt;p>With Proxmox VE you can setup VMs on machines and also cluster multiple machines
together, it&amp;rsquo;s easy to use (if you know how to use it) and fast. Currenly I am
running 6 VMs on my server, most of them still need some work done but all of
them are running Ubuntu Server 20.04.&lt;/p>
&lt;p>Proxmox VE also supports hardware passthrough for when a VM needs it, in my case
I use it for Plex to use the GPU for transcoding.&lt;/p>
&lt;p>Storage management is also easy to do in Proxmox, however when building a server
always calculate how much storage you thing you need and then double that. I am
currently running into the issue that I&amp;rsquo;m running out of storage, mainly because
I am running in ZFS mirror (RAID1) and cuts my storage in half. Thankfully storage
is not terribly expensive, unless you need multiple tens of TB.&lt;/p>
&lt;p>There are alternatives to Proxmox VE and it all comes down to your preference, the
reason I&amp;rsquo;m using Proxmox is because it made sense the first time I saw it. It does
not have a flashy UI but it works and everything is where it&amp;rsquo;s supposed to be.
But I might change my mind in the future and start using unRAID, who knows.&lt;/p></content></item></channel></rss>