I struggled with a Live Backup issue on Ubuntu 2014 LTS a while ago as ralish from Stockholm DevOps describes here.
The problem was a broken installer meta package and ends up in a missing kvp deamon if you tried to install it on Ubuntu.
This daemon is used to interact between Host and VM to get a consistent backup state during snapshot creation on the Hyper-V Host.
So at the end, Backups without kvp can be risky due to a service interruption of the VM workload(s).
A screenshot from the DPM 2012 R2 Backup console shows the offline state.
In the meantime, the bug got fixed, Live Backups without service interruption can be taken, the sun is shining again and so it’s time to wrap some things up and give you a short overview about Hyper-V and common Linux Distributions.
First of all, how is Linux running on Hyper-V anyway?
Almost good. But don’t try to compare the situation with VMware. You get lost. 😉
If you stick on the latest and greatest versions of Suse (open and Enterprise), Oracle Linux, RedHats RHEL /CentOS, Debian and Ubuntu,
you’ll probably get the things done.
Microsoft updated the general TechNet Library articles about Linux on Hyper-V a couple of weeks ago.
You can find them here.
But there are several small differences between the Distributions.
Note: You can setup FreeBSD as well. Since FreeBSD 10, the Hyper-V tools are also part of the distribution and hopefully other projects will integrate them.
Especially pfsense and FreeNAS would be nice. But I’m a dreamer I know. 😉
Update 10.10.2014 - pfsense has Hyper-V support based on FreeBSD 10.1 via beta snapshots. pfsense on Hyper-V – my personal light sword of open source router
Debians reputation to be a rock solid system comes around with an “older” system and lack of Hyper-V support which means it’s not the best choice for Hyper-V at the moment.
Except you’re really into Debian and a lover… 😉
RAM ballooning/Dynamic Memory isn’t supported and a couple of other features like virtual FibreChannel as well.
If you compare the distributions you’ll see some things are working out of the box and some other won’t do it.
I tried to create a ranking but it seems to be more complicated because of the specific needs of your environment, your personal Linux skills and preferences.
But in a rough way without deeper considerations it could be looking like that:
- openSuse (Enterprise as well)
- Ubuntu 2014 LTS (aka 04.2014)
- RedHatRHEL/CentOS 7
- Oracle Linux
- Debian 7/Wheezy
It’s actually based on a “light touch deployment” view of mine
and which one of the distributions can bet set up with maximum Hyper-V support and minimum expense.
In my opinion this is a key value especially for less experienced guys like me. 😉
Let’s stick on Suse 13.1 and Ubuntu 04.2014 LTS.
Suse is running out of the box as generation 1 VM quite well.
Linux Integration Service – LIS 3.1 – will be running and almost everything what you possibly could want.
It includes dynamic memory, static ip injection (VMM!), vFibre Channel, Live Backup and so on.
Out of the box Ubuntu is also running almost well. You can create and install Ubuntu as Gen2 VM but you have to disable “Secure Boot” which is enabled by default on Server 2012 R2.
So type into the terminal of Ubuntu lsmod | grep hv_ and you probably get this output:
enrico@Ubuntu-01:~$ lsmod | grep hv_
hv_balloon 21552 0
hv_netvsc 31255 0
hv_utils 19003 0
hv_storvsc 17785 2
hv_vmbus 50383 7 hv_balloon,hyperv_keyboard,hv_netvsc,hid_hyperv,hv_utils,hyperv_fb,hv_storvsc
compared with Suse:
linux-dc6r:~ # lsmod | grep hv_
hv_balloon 21513 0 [permanent]
hv_utils 14104 0
hv_netvsc 27157 0
hv_storvsc 21922 3
hv_vmbus 56397 7 hid_hyperv,hv_balloon,hv_utils,hyperv_keyboard,hv_netvsc,hv_storvsc,hyperv_fb
Actually it’s looking good. Isn’t it?
But here is a small difference showing up within the VMM console under the VM Additions row:
The Suse Systems got the full feature set Out-of-the-box OOB running.
The specified additions Number 3.1 is a good indicator for that. 😉
So on the other hand “VM additions detected” is a description for “something is missing”.
If you try to backup the VM as “live backup” it can be interrupting your services as mentioned before.
And Murphy says, it will be happen.
The reason is the missing KVP daemon which isn’t installed by default on Ubuntu.
KVP is short for “Key Value Pair” and a synonym for different data exchange services between VM and Hyper-V host as Samuel/ralish describes in his blog:
“…to support the Hyper-V KVP (Key-Value Pair) protocol. As the name implies, this is used by the hypervisor to exchange simple information
with the VM, and is required for various features to work.”
Type ps -eaf|grep hv on Ubuntu and compare the output with Suse:
enrico@Ubuntu-LTS-2014-01:~$ ps -eaf|grep hv
root 258 2 0 16:56 ? 00:00:00 [hv_vmbus_ctl]
root 259 2 0 16:56 ? 00:00:00 [hv_vmbus_ctl]
root 260 2 0 16:56 ? 00:00:00 [hv_vmbus_ctl]
root 262 2 0 16:56 ? 00:00:00 [hv_vmbus_ctl]
root 263 2 0 16:56 ? 00:00:00 [hv_vmbus_ctl]
root 480 2 0 16:57 ? 00:00:00 [hv_balloon]
root 3667 2 0 16:58 ? 00:00:00 [hv_vmbus_ctl]
linux-dc6r:~ # ps -eaf|grep hv
root 313 2 0 11:13 ? 00:00:00 [hv_vmbus_con]
root 314 2 0 11:13 ? 00:00:00 [hv_vmbus_ctl]
root 315 2 0 11:13 ? 00:00:00 [hv_vmbus_ctl]
root 519 2 0 11:14 ? 00:00:00 [hv_balloon]
root 2081 1 0 11:14 ? 00:00:00 /usr/sbin/hv_vss_daemon
root 2082 1 0 11:14 ? 00:00:01 /usr/sbin/hv_kvp_daemon
The TechNet article of Ubuntu refers to a (meta) package called hv-kvp-daemon-init.
It includes a subset of tools (cloud-tools) to get the missing features running.
By now the “old way” getting KVP as decribed at the TechNet library is …
sudo apt-get update
sudo apt-get install hv-kvp-daemon-init
… but the upcoming preferred way is getting it via the new meta package linux-cloud-tools-virtual
Let’s get a look on that via aptitude:
The aptitude output above (sudo aptitude and search for hv-kvp-daemin-init) shows an interesting notice about the transitional state of that package.
The meta package hv-kvp-daemon-init will be deprecated and the mentioned linux-cloud-tools should be used.
Comparing the outputs shows clearly where we heading:
enrico@Ubuntu-LTS-2014-01:~$ sudo apt-get install linux-cloud-tools-virtual
The following NEW packages will be installed:
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
enrico@Ubuntu-LTS-2014-01:~$ sudo apt-get install hv-kvp-daemon-init
The following NEW packages will be installed:
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
We’re living the future now and try the modern way. 😉
sudo apt-get install linux-cloud-tools-virtual
Setting up linux-cloud-tools-common (3.13.0-36.63) …
hv-vss-daemon start/running, process 1590
Processing triggers for ureadahead (0.100.0-16) …
Setting up linux-cloud-tools-3.13.0-36 (3.13.0-36.63) …
Setting up linux-cloud-tools-3.13.0-36-generic (3.13.0-36.63) …
Setting up linux-cloud-tools-virtual (18.104.22.168.43) …
A reboot later the KVP daemon will be running. At the refreshed VMM console 3.1 additions showing up.
Let’s step over to the Data Protection Manager 2012 R2 and try to back up the machine… live.
The names aren’t consistent to the names I used above but you’ll see the difference. 😉
Ubuntu VM is now ready to backup live.
Still looking offline at the DPM console? Don’t panic.
Sometimes (but very rarely) the machines won’t be noticed as online backup capable via DPM console.
We can step down a bit deeper and take a look at the Hyper-V Machine itself.
Open a command prompt on the Hyper-V Host where the machines are running.
C:\Windows\system32>copy con script.txt
Type in “list writers” -> Ctrl + z + enter
1 file(s) copied.
C:\Windows\system32>diskshadow /s script.txt | find /i “caption: O”
– Caption: Offline\Ubuntu 01
– Caption: Offline\Collax SG
– Caption: Online\openSUSE 13.1 – Test 01
– Caption: Online\Ubuntu LTS 2014
You see the caption?
The Ubuntu machine is running, marked as online and can be backed up live and hopefully without any worries.
Note: DPM will backup machines online or offline whatever they capable of at the time where the snapshot will be taken.
It doesn’t matter what the initial backup was showing you.
If the situation changes after the first backup, DPM will notice that within the next backup run.
Update 08.10.2014 – CentOS 7.0
Like Ubuntu the CentOS standard installation has also a minimal Hyper-V Set but not the KVP Package.
But there is also a meta package available at the repository.
Before you start you may already wondering that ifconfig is not working.
For whatever reason the CentOS doesn’t have ifconfig installed.
It’s part of the basic networking tools and can be installed with yum install net-tools.
yum provides “ifconfig” give you an overview where to find a tools or programm if needed.
Hack into the terminal:
… getting the latest and greatest stuff from the repository and updates the system.
yum install hypervkvpd
A reboot later the Additions will be on 3.1 as Suse and Ubuntu. Check the status with the commands described above.
Any comments or suggestion welcome via commentary or send me an email at fax at virtual-ops de