Wednesday, December 17, 2008

You want to convert a machine to a vhd

So, for some reason you want to convert a machine to a vhd. Let me not limit your thinking by saying that this has to be a physcial machine, it could be a VM.

I am going to cover two items: XenConvert (free, converts running machine), and a Hyper-V feature (part of Hyper-V, converts any mountable disk).

Using Hyper-V:

With Hyper-V you can take a physical disk, attache it to a Hyper-V host and convert the disk (fully intact) to a VHD. A neat feature that no-one talks about.

This is great for a number of scenarios where you have a physical drive, a host, and the machine on the physical drive can be is is offline (we will assume that this is a disaster recovery exercise).

But those are the limitations. Still, a neat feature.

Here's how:
Mount the disk to a Hyper-V host. (SCSI, in an external enclosure, ATA, however)
Be sure that the disk is attached and recognized in Disk manager
Open Hyper-V manager
Select Actions -> New -> Hard Disk..
Step through the wizard to select your type of virtual disk, the location, then stop.
On the Configure Disk page, select the option "Copy the contents of the specific physical disk"
Then complete the wizard.

This then copies the contents of the desired physical disk (not just the files, but the actual blocks, formatting and all) to a VHD.

That is it.

Another option is to

Use XenConvert:
Download the XenConvert tool (You can download it from MyCitrix (@ where you download XenServer)
Install it within the Operating System that you want to convert (again, physical or VM).
Then begin the conversion process choosing VHD as your output.
You can just convert an existing installation to VHD (it can even route the VHD to a network share using a mapped drive).

the benefit of XenConvert: You machine is running the entire time.
I have converted SQL, Operations Manager, and SCVMM servers to VHDs (yes, they boot and everything) then moved them to either Hyper-V or XenServer.

I hope you get creative with your options.
You can convert physical to virtual, virtual to virtual, etc. No need for expensive conversion tools as long as you have the time and the knowledge.

Tuesday, December 16, 2008

Should I put all my VHDs on one volume?

I recently responded to someone who was considering placing all of their VHDs onto one huge storage volume.

This might be easy for storage management and for backup management. But you have to consider the ancillary impacts that this might have on the overall environment.
The greatest impact will be the impact that each VM has upon another VM.

This is where we need to h ave a full understanding of all of the components involved in our virtualization infrastructure and how all of those components interact and affect each other.

Here is the statement that began the idea for putting this to blog:

"We were hoping to create a "big" LUN, store all our Hyper-V Guests on that LUN, assign the LUN to several HOSTS, and access the Guests that way."

Now, the response:

That is all fine, good, and noble - but you may want to reconsider.

Even VMware has had the recommendation (for a great number of years now) of no more than 10 VMs per LUN (they consider this a 'rule of thumb' that is taught in class).

Why? Disk IO.

You have to balance the disk IO demands of the VMs stored on the LUNs.

If you have VMs with a bunch of disk IO all happening at the same time they end up impacting each other.

For example - you always split out your SQL databases from the temp log, from the OS - for the same reason.

In this case you have different considerations - VM1 will impact VM2.

An easy test you can do at home:

With many VMs on a single LUN, boot one and wait for Integration Services to report some data from within the VM (Integration Services loads late in the stack so it is a good measure that the VM is nearly done booting).

Be sure to time it.

Now, repeat the test, this time with 4 VMs all at once.

Don't stop timing until all four are up, then get your average time to boot.

All that disk reading and page file building created massive disk IO.

Just something to think about as you plan your infrastructure.

Thursday, December 4, 2008

Dedicating a physical NIC for Management with HyperV

Here is an item that comes up in enterprises. Dedicating Hyper-V management traffic to a single physical NIC. This generally also includes disabling the Host access to an External Network Switch.

BTW - the Microsoft recommended configuration is a dedicated Host management NIC that is not associated with a virtual switch.

I have pulled this from a real example that I helped some with and have tried to protect the innocent.

My assumptions in this example:

Two NICs – ‘HP NC373i Multifunction Gigabit Server Adapter’ and ‘HP NC373i Multifunction Gigabit Server Adapter #2’

You are not local to the servers

In Network Connections you should see the following Device Names:

  • HP NC373i Multifunction Gigabit Server Adapter
  • HP NC373i Multifunction Gigabit Server Adapter #2

Microsoft Virtual Network Switch Adapter

An External virtual network exists that is named "InternalEthernetPort" and it is using NIC 1

What we need to do is:

1) make sure that 'HP NC373i Multifunction Gigabit Server Adapter #2' is not bound to a virtual switch

a. In the Hyper-V Virtual Network Manager there should only be one Virtual Network

i. It should be named “InternalEthernetPort”

ii. It should be of type External

iii. It should be bound to physical NIC ‘HP NC373i Multifunction Gigabit Server Adapter’

2) make sure that 'HP NC373i Multifunction Gigabit Server Adapter #2' is enabled and on the network

a. This should show the Hyper-V host as multi-homed as it would have two NICs on the same network. And may produce an alert. It should have two IP addresses on the network.

3) Connect to the Hyper-V host on the second NIC - 'HP NC373i Multifunction Gigabit Server Adapter #2'

4) Disable the Hyper-V virtual NIC that is attached to “InternalEthernetPort”.

a. Do this through Network Connections - Control Panel -> Network and Sharing -> Manage Network Connections

b. Find the NIC whose Device Name begins with “Microsoft Virtual Network Switch Adapter”

c. Select -> Right click -> disable

i. I am sure that you can predict what would happen if the order was wrong, or the wrong NIC was selected.

The end result should be:

  • VM network traffic is using switch “InternalEthernetPort” which is using physical NIC ‘HP NC373i Multifunction Gigabit Server Adapter’
  • Host management network traffic is using physical NIC ‘HP NC373i Multifunction Gigabit Server Adapter #2’
  • This should maximize the host management throughput.

    Oh, as a side note - Server 2008 R2 with Hyper-V makes this a lot easier and less complicated…