Live backup of Ubuntu 14 under Hyper-V: how get it to work

I would like to share some experience with Ubuntu VM under Windows Server 2012 R2 Hyper-V. I have recently upgraded my Ubuntu 13 to 14.04 LTS. And the first surprise was system lockout while Windows Server Backup is trying to run VSS writer on this VM. At this moment the following messages are displayed on the screen:

INFO: task <xxx> blocked for more than 120 seconds
 Not tainted <kernel_version>

System is absolutely out of control, any command just freezes the shell. Only one possible option is to reset the VM.

There is a message from the Windows Server Backup:

Backup fails with «The component [servername] was skipped during the snapshot and will not be available for recovery. Error: The writer experienced a transient error.

Let’s read the Microsoft guide about running Linux VMs on Hyper-V:

https://technet.microsoft.com/ru-ru/library/dn531029.aspx

We have to double-check that all necessary modules are in place. For Ubuntu 14.04 we have to install the following:

# apt-get install hv-kvp-daemon-init linux-tools-virtual linux-cloud-tools-virtual

Then run:

# ps -eaf | grep hv

Three necessary modules must be loaded (hv_vss_daemon, hv_kvp_daemon, hv_fcopy_daemon):
root 251 2 0 17:57 ? 00:00:00 [hv_vmbus_con]
root 253 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 254 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 256 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 257 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 258 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 260 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 261 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 262 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 263 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 264 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 265 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 266 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 267 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 268 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 269 2 0 17:57 ? 00:00:00 [hv_vmbus_ctl]
root 1059 1 0 17:57 ? 00:00:00 /usr/lib/linux-tools/3.13.0-63-generic/hv_vss_daemon
root 1075 1 0 17:57 ? 00:00:01 /usr/lib/linux-tools/3.13.0-63-generic/hv_kvp_daemon
root 1083 1 0 17:57 ? 00:00:00 /usr/lib/linux-tools/3.13.0-63-generic/hv_fcopy_daemon

If you don’t see these three modules, check the log files and find the problem there.

But in my case all services worked without any problems. I have another Ubuntu 14 that was installed from scratch and was not upgraded from previous versions. I compared the settings of these two machines. Microsoft notes:

Live virtual machine backup will not work with ext2 file systems. The default layout created by the Ubuntu installer includes ext2 file systems, so you must customize the layout to not create this file system type.

Of course I knew about this limitation and I converted my /boot partition to the EXT4. But Microsoft does not say about one significant thing:

EXT4 partition MUST be JOURNALED!

I booted from Ubuntu Live CD, ran tune2fs and enabled journaling on my disk:

tune2fs -O has_journal /dev/sda1

Now live backup is working perfectly!

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>