Fixing Linux-Cloud-Tools-Common in Ubuntu on Azure

    1 minute

As part as our our continual efforts to improve the services and products we offer at Code Clinic Web Design we recently undertook the process of moving from our current VPS provider to the Azure Cloud Network operated by Microsoft.

Read about the numerous benefits we witnessed from Azure Cloud Infrastructure.

As part of this process we set-up several Ubuntu Linux servers on Virtual Machines. On top of this we installed and configured the Webmin / Virtualmin / Usermin combination of server management tools, so as to simplify the process of adding new virtual server environments on which to host our clients websites and applications.

After a period of time we started running into errors such as this:

Setting up linux-cloud-tools-common (3.13.0-36.63) ...
start: Job failed to start
invoke-rc.d: initscript HV-kvp daemon, action "start" failed.
dpkg: error processing linux package cloud-tools-common (--configure): subprocess installed post-installation script Returned error exit status 1
dpkg: dependency problems preventinfo configuration or linux-cloud-tools-3.13.0-34: linux-cloud-tools-3.13.0-34 depends on linux-cloud tools-common; HOWEVER: Package linux-cloud-tools-common is not configured yet.

Unable to fix this issue, we sought help from the Linux and Server communities, but received either no response or a lack of any suggestions that helped. Whilst there wasn’t and still isn’t many examples of others experiencing this problem, we did notice that in all cases this was a problem with Ubuntu on the Azure Network.

Within a short period of time we were experiencing further issues when trying to update or install other packages. This compounding of issues meant we were unable to restart Apache on the most seriously affected machine, and thus we had an emergency situation.

Fortunately, the flexibility of the Azure network and our use of Virtualmin, meant we were able to quickly create a new Virtual Machine on Azure and then install Virtualmin. Next we created backups of the websites(Virtual Servers) in Virtualmin, and uploaded them to the new VM Server.

Finally it was simply a case of updating the DNS records in Cloudflare CDN to point to the new Web Server, and all the sites were back online within a matter of minutes rather than hours. However, this was far from ideal.

With the new server and our other VM’s we were careful to monitor all future updates and installations to ensure this didn’t happen again. However, despite our best efforts we eventually ran into the issue again. Fortunately we were now sure that the issue resided with the upgrade process of the linux-cloud-tools-common package upgrade process.

Again, further calls to the community failed to provide any significant developments. So, after much research we stumbled on a number of similar issues, all of which appeared to have been left unresolved. That was until we eventually stumbled upon a forum thread posted in Dutch.

With a little help from Google Translate and fair bit of trial and error, we were able to determine that the problem was with the attempts by the Server to start the ‘HV-kvp daemon’. It’s not immediately clear what this daemon does and why it fails, but it was suggested that removing the call to initalise this daemon during the upgrade process would be enough to allow it to complete.

To do this it is necessary to open a terminal directly on the server or via a remote tool such as Putty. Once you are connected move to the /etc/init directory with

cd /etc/init

Now open the hv-kvp-daemon.conf file with your editor of choice eg:

sudo nano hv-kvp-daemon.conf

Now scroll to the last line in the file and comment it out, which should look like this:

exec /usr/sbin/hv_kvp_daemon

Now add the following new line:

exec /bin/true

Now save and close the hv-kvp-daemon.conf file and you should now be able to perform the upgrade of your linux-cloud-tools-common package without issue. Just to be on the safe side we’d recommend re-diting your hv-kvp-daemon.conf to return it to its original state before performing any other upgrades or installations.

Phill Healey on BehancePhill Healey on EmailPhill Healey on FacebookPhill Healey on FlickrPhill Healey on InstagramPhill Healey on Linkedin
Phill Healey
[Technical Director]
Phill has been designing and developing websites since 1986 in the early days of the web. As a self taught teenager, he built one of the world’s first Internet radio stations. Since then, he's gained numerous qualifications and several awards for his work in the industry. As a result he has had the pleasure of working in agencies in Manchester & London UK, and now Bavaria, Germany.

5 comments

  1. Thanks much for this information.

    I ran into this problem several months ago and couldn’t find any useful information about it until I came across your article. With one small difference (/bin/true instead of /sbin/true) your solution worked for me. I couldn’t find any useful information about hv-kvp-daemon, so I don’t know if there are any side effects to the change you’ve described above.

    Also, I didn’t install cloud-tools packages, so I’m assuming they’re just part of the Azure Ubuntu base-image.

    Thanks again.

    1. Glad it helped!

      The cloud-tools packages are essentially what allow Ubuntu Server to operate in a cloud environment, so I don’t think they are specific to Azure. Although I could be wrong. Eitherway, they are needed. As for the hv-kvp-daemon, I beleive that is an Azure specific daemon that is responsible for firing up some of the Azure system integrations but again I’ve not found anything concrete. Thus it would seem that as long as you restore the call to the service after performing the cloud-tools-common upgrade you should be ok.

      P.s. Thanks for letting us know about the typo, I’ve corrected that now.

  2. It’s my experience that this process will allow one to install or update a package but the problem will return – not sure why. And re-doing this process will “fix” it again for a time…

    1. Hi Jerry,

      I think you may have misunderstood. You should only make the changes when performing an update to ‘Linux-Cloud-Tools-Common’ specifically. Afterwards you should re-edit the file to return it to it’s previous state so as to avoid any potential issues down the line. Additionally, -as you notice- hv-kvp-daemon.conf itself will be updated and ovewritten from time to time.

      All that the edit does is fools the system into thinking everything is ok, rather than being told that it can’t initialise the HV-KVP Daemon on line ‘/usr/sbin/hv_kvp_daemon’, instead we feed it ‘/bin/true’. No-one seems to know why the daemon doesn’t appear to initialise, but it doesn’t appear to be a problem either.

Leave a Reply

Your email address will not be published. Required fields are marked *