Inception: The Journey of Nested Virtualization
To get articles like this free in your inbox, subscribe to our newsletter.
If you’ve not been living on the moon, you’ve probably heard of the concept of “Nested Virtualization”.
This is a Method of running a Virtual Machine inside a Virtual Machine.
This concept is not limited to VMware, but since it’s the most popular Hypervisor, I’ll use it as my example. We will talk about the ‘Why’, use-cases, Performance, how-to, and a recent example.
Let’s start with some questions:
The first thing which popped into your mind when you were introduced to nested virtualization is probably:
– “Why would you ever want to do such a scary thing?”
– “Isn’t Normal Virtualization good enough anymore?”
– “It’s going to be extremely slow, isn’t it?!”
And I’ll answer:
– Great benefit in certain use cases!
– It’s great!! But not for all scenarios.
– Potentially it would be a little slower, but not much if you do it right, and I’ll explain more next.
But Why? What use cases am I talking about?
– Practice/Modeling Upgrade procedure of your VSphere infrastructure
o Upgrading you Entire Production VSphere infrastructure before you’ve done this before, could be very risky!
Especially with the new surprises every version!
o Trying the upgrade procedure on a nested environment could save you a bunch of troubles and downtime in production infrastructure, especially if you don’t have ‘spare’ ESX hosts to play with.
o Also, you can enjoy all the ‘fun stuff’ that comes with VMware: like Snapshot if you have an issue/ found a bug.
– Testing/ Lab environments.
o In cases when you need something to ‘mess around’ with.
o We are all aware of the situation when you just need a quick setup to try an idea you have, but can’t wait for IT to create that setup for you.
o Small, Non-Production, Temp, testing purposes.
– Demo/ Proof of concept
o If you’re Integrating with the VMware VSphere product family and want to do a Demo/POC without the costs of expensive hardware/datacenter cabling and gear.
– Education
o Teaching/ Learning VSphere Product Family without the time and high costs, while enjoying all the VMware Features (Students can Snapshot/ revert / clone ETC)
Let’s try it ourselves:
ESXi 5.x Virtual machine inside a psychical ESXi 5.x.
Two ways to enable nested virtualization support:
– Via the nested machine’s .vmx file:
o VSphere 5.0 = “vhv.allow = true” (or in /etc/vmware/config)
o VSphere 5.x = “vhv.enable = true”.
– Or the recommended way, Via VCenter Web Client:
Also, to enable Network Communication, Enable “promisc” on the nested machine’s nic.
This is in order to overcome VMware’s default behavior, which by default only forwarding packets from the v-switch to VM’s Mac address.
If you like, Optional VMware Tools for nested ESXi 5.x could be downloaded from VMware ‘flings’:
https://labs.vmware.com/flings/vmware-tools-for-nested-esxi
How about Performance?
When you run a ‘regular’ Virtual Machine, you are technically running a process in the hypervisor.
If you have 10 VMs in the hypervisor you have 10 processes, and so on.
The more processes you have, the more time you spend on context-switching.
Physical processor scheduling and ready time will increase, and potentially the less performance you’ll get.
Today’s Hypervisors handles these situations well.
Now, imagine one of those VMs processes, ‘hides’ inside 10 mores VMs (nested).
Will it be slower? Yes.
Much slower? Not necessarily. Depends on your devices and configurations.
For example: I did a small test, and the nested machine got 10-15% less ‘overall performance’ score, comparing to its parent machine.
Which is not a big price to pay, if you’re not doing production on those nested machine, and the benefit could be great!
A Recent use-case
Recently, I had to use this was in order to create a ‘blueprint’ in CloudShare’s TeamLabs, of our Entire integration lab.
Because CloudShare uses many advanced features like Hypervisor API/ Storage vendor API/ complex networking and Security; this hardcore blueprint includes a nested ESXi 5.x and VCenter, Storage communication, and a top of the line Linux box with all the fun stuff of ‘vconfig’ (vlan and trunk configuration in Linux) and brctl (bridge\switch configuration in Linux).
The bottom line is:
We’ve provided R&D and QA a blueprint they can now work, develop, and test on with CloudShare’s awesome features and capabilities!
So Nested virtualization? VERY COOL!
What you should do next…
1. Subscribe to our newsletter:
Subscribe to our newsletter below for the latest news, advice and thought-leadership for software professionals. Or visit our blog to browse our most recent articles.
2. Learn how virtual labs can grow your business:
To learn more about how CloudShare helps software organizations grow revenue, increase efficiency and improve quality, visit our resources page. You’ll be able to browser dozens of valuable white papers, eBooks, webinars, case studies, and brochures.
3. Get a FREE, no obligation demo:
Discover just how easy it is to create your cloud environment—in minutes! One of our friendly virtual labs experts will be happy to:
- Show you the platform in action
- Calculate pricing for your business
- Set you up with a 14-day free trial
- Answer any questions you have
- No pressure or obligation