CentOS 5.5 Installing Hyper-V Linux Integration Components v2.1

The first thing I recommend doing on your Linux VM server is running yum update. If you run ‘yum update’ after the installation you could see:
Kernel Panic after Yum Update – CentOS with Hyper-V Linux Integration Components, which would probably just add a few extra headaches.

Next, go to Microsoft, download and extract the Linux Integration Services package.

Next, install the Linux Integration Components:
Load the Linux Integration Components v2.1 iso into your VM.
When logged in as root, run:

Continue reading CentOS 5.5 Installing Hyper-V Linux Integration Components v2.1

Kernel Panic after Yum Update – CentOS with Hyper-V Linux Integration Components

I am runnning CentOS 5.5 in a VM on Hyper-V. I created a fresh installation. I then installed Hyper-V Linux Integration Components. After Installing them I ran yum update.

After running a “yum update”, and rebooting I received this error.

Unable to access resume device (/dev/VolGroup00/LogVol01)
mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

During the yum update process, it updated my kernel. Kernels that are installed after Hyper-V Linux Integration Components don’t always mesh well together. Here is how I fixed my issue.

Continue reading Kernel Panic after Yum Update – CentOS with Hyper-V Linux Integration Components

Run Rackspace Cloud Server locally on Hyper-V

Here is how I ran a copy of my Rackspace cloud server locally on my Hyper-V 2008 R2 Server. Why would you want to do that you ask? Well, there are many reasons. For example, I want to run all my applications in a test/staging environment before I push them live. I want to test all updates to my servers before I push them out live, testing large processes out without wasting money on CPU/bandwidth before running them live, etc. It is very nice to have a near exact copy of what you are running on rackspace cloud servers locally.

Part of the problem was I didn’t have any spare servers laying around that I could install linux and Xen on but I already had a Hyper-V server. This would allow me to run a linux VM, but how do you get a Rackspace cloud server backup running in Hyper-V.

Continue reading Run Rackspace Cloud Server locally on Hyper-V

Suspend Hyper-V VMs with PowerShell

I have one Hyper-V R2 server that fights with me on occasion. The VMs are responsive and I can RDP into them. The server itself is sometimes responsive, and I can RDP into it, but it fails to connect to Hyper-V manager. A reboot usually clears up the problem, but I hate to reboot the host machine with VMs still running.

I have noticed, however, that I can still access Hyper-V through the PowerShell API. As the VMs on this machine aren’t critical, I can suspend the VMs using the API. Then I can reboot the host machine, and start the VMs back up again using Hyper-V manager.

Continue reading Suspend Hyper-V VMs with PowerShell

ClamAV Update Breaks Mail Delivery

Postfix + ClamAV + SpamAssassin + Amavisd-New

As we all know, ClamAV versions older than 0.95 stopped working yesterday. This was announced some time ago by ClamAV, but caught most people by surprise when mail flow stopped cold on our email servers. ClamAV pushed down an update that broke older versions, forcing sysadmins to either disable Antivirus, or update ClamAV to a more recent version.

We were running a very old version of ClamAV, 0.91.2-1~volatile1, from 2007. An upgrade was long overdue anyway. Here are 2 ways to fix it.

Continue reading ClamAV Update Breaks Mail Delivery

Hyper-V Double Import Error

The type of work I do relies heavily on passing Hyper-V VMs around. When I send a VM to someone, I usually export a copy onto an external Hard Drive. In a perfect world, the VM would get copied off of the external drive to the local machine before being imported, but that sometimes doesn’t always happen. One user imported the VM while it was still on the external drive. Granted the VM would still work, it would probably be considerably slower due to running off of USB. They ran into problems on their host machine, so they decided to swap it out for another host machine. They shutdown the VM, and deleted it from Hyper-V. Then they plugged in the external drive into a new machine, and tried to import the VM again. This time they received an error:

Hyper-V Import Error Message
Hyper-V Import Error Message

Hyper-V Manager

A server error occurred while attempting to import the virtual machine.

Import failed.

Import failed. Unable to find virtual machine import files under location ‘D:\vm-export\test-import\’. You can import a virtual machine only if you used Hyper-V to create and export it.

Hyper-V doesn’t allow you to import VMs multiple times. In order to import the VM again, they would have needed to export the VM beforehand in order to prepare it for being imported on the second machine. The export process basically, cleans up the file structure of the VM and creates a config.xml file similar to the following:


  
  
  
    D:\VMs\test-import\test-import.vhd
    
  
  true

Upon importing the VM, Hyper-V looks for and then removes the config.xml file. If it can’t find that file, you will get an error message.

Now, if you have received this message, there is no need to panic. There are still ways to recover your VHD files. If your VM had 0 snapshots it is actually very easy to bring the VM back online. Dig around through the VM’s folder structure and locate its VHD file. That is the virtual hard disk that your VM uses to store all of its information.

If you have a VM with snapshots, the process will be a little different. Essentially, you will need to use the “Edit Disk” feature in Hyper-V to merge the AVHD disks into 1 VHD file, and then create a new Virtual Machine using that VHD file. There is a good guide located http://www.networkfoo.org/server-infrastructure/recovering-your-virtual-machine-how-manually-merge-hyper-v-snapshots-back-one- that can help you merge your AVHDs back into a single VHD file.

Once you have a single VHD file, in Hyper-V, create a new Virtual Machine. Give it a name and location, and fill out all the other important information it asks. Then once you get to the “Connect Virtual Hard Disk” screen, select “Use an existing virtual hard disk” and then browse and select the VHD file you found from above. Finish creating the VM and turn it on. The VM should work just as it did before.

Server 2008 R2 Hyper-V / Intel I7 – Blue Screen of Death

I was building out a new demonstration laptop. The laptop would be running VMs on Server 2008 R2 Hyper-V. Since the VMs we needed to run were rather large, we picked up a rather powerful laptop to support them.

  • Server 2008 R2 Enterprise
  • Intel i7-720 QM
  • 8GB RAM
  • 640 GB HD

The build went fine. It was simple, enabling Virtualization in the BIOS, installing the OS, adding Hyper-V role, importing a few VMs. Everything went smoothly.

I started a Virtual Machine to make a few tweaks before going home for the weekend. When I came in on Monday morning. I found a wonderful screen telling me there was an unexpected shutdown. Awesome. Thanks Monday…

I checked the Event Viewer and found out that it had been restarting every few hours all weekend.

Continue reading Server 2008 R2 Hyper-V / Intel I7 – Blue Screen of Death