Posts Tagged ‘vCloud Director’
Advanced Guide: VMware vCloud Director in a Box (works on 4GB Laptops)
I’ve been getting a good feedback since I published my first guide for running vCD on a Laptop. The only problem was the requirement for an 8GB to run these loads of VMs required by vCD. Since then, I’ve been asked by a lot of people (colleagues, readers and even a customer) if it’s possible to have the same setup on a 4GB laptop, and the answer is: Yes, absolutely.
I was actually spoiled with my 8GB Laptop from VMware when I published my first guide, and I didn’t realize that many of us still use 4GB or even 2GB memory on their machines. With that said, I rethought the whole thing and came up with a slim (yet very powerful) setup to do a vCD lab on your laptops/desktops. So, without further ado let’s get started!
Assumptions
I’m assuming here that you are comfortable dealing with Linux. This is not an expert guide, but it’s not a beginner one either. I assume that you know how to install Linux and work with it from an intermediate level. I won’t be as thorough as i was in the first guide, and i won’t be publishing Videos or Screenshots. I will try to keep the balance between having a simple/short post yet without compromising the overall understanding of how things are done. If for any reason I failed to do that in any part, you can always drop a comment or send me an email to expand on it.

CentOS For The Win!
So, the first thing you will need is to get the CentOS 64bit iso and burn it on a DVD. After that, and depending on the base OS on your machine, you will need to have a separate partition for running CentOS as a bare metal operating system.
In my case, i have a Windows 7 64bit running on an 80GB SSD drive, and a secondary 500GB one running in the CD-ROM bay. In W7 you can shrink your current partition on the fly without messing with your filesystem. You just need to right-click on it, and then press on shrink. It’s recommended to defrag your OS first before doing that to keep things at best performance and also to guarantee the maximum space you can achieve after shrinking.

As you see in the screenshot above, i’ve shrink the SSD drive to free up 12GB of space on it. I will use this for storing the VM files and consequently have the best performance for them. Depending on your setup, you can instead use this partition for your base Linux OS. For me I thought the VMs will need the performance rather than the base CentOS, especially that the latter is running natively on the laptop hardware.
Next, I freed up 30GB from the 500GB drive to use for the CentOS base OS. The boot partition will be created automatically for you during the CentOS installation.
When you reach the Boot part in Linux installation, make sure to choose the Windows 7 as your default boot rather than Linux to avoid the hassle of accidently booting into Linux when you power on the Laptop for normal day-to-day use.
Installing VMware Workstation 7.1 for Linux
Now that you’ve installed Linux on your laptop, we will need to first install VMware Workstation 7.1. Fairly easy step, download and run the package to get the GUI installation wizard. After finishing this step the WS will create two virtual interfaces, one of which is the “Host-only” interface in which we are interested in. We’ll come to that point in a bit.
Installing Oracle DB on CentOS
Thanks to Duncan Epping for the tip, installing Oracle on Linux has never been easier. You just need to download Oracle Express, install the RPM and you are done. It’s just as simple as this. Just make sure you follow the instructions on the screen as there is a command you need to run as root.
Preparing CentOS for running vCD
As you know, vCD requires two Ethernet interfaces in the installation. Since you are running this system on a Laptop, you are actually limited to only one LAN interface (and probably the wireless won’t work or need a hell of configuration). We have two cool options here:
- Create a sub-interface in Linux. This option makes sense if your Laptop/Desktop is hooked up to a network all the time.
- Use the Host-only virtual interface created by Workstation. I’m more in favor of this option as it allows me to run vCD while on the road. In fact, this is the whole idea of having this setup running on my laptop.
For option number two, we will use the physical Ethernet interface on the laptop for the HTTP Proxy, and the Host-only virtual interface for the Remote console proxy (connected back to vCenter).
Next, we need to have a working DNS on our Linux. Bind is the perfect solution here, just google something like “configuring bind on centos” for a detailed guide. After you have it up and running, make sure to put the DNS entries for vCD, vCenter, vSM and ESX. It’s very important to have a working DNS service in your environment to avoid a lot of problems later on. If you don’t feel comfortable with Bind on Linux, you can install a DNS service on the vCenter VM later on, but i recommend having all your services on your base CentOS operating system to save memory and keep things clean and simple.
Installing vCD on CentOS
Now it’s time to install vCD on our base Linux system. You can check out my video guide for that, but a couple of notes here:
- Make sure that you choose the Host-only virtual interface for the Console Proxy.
- In the DB configuration, put “xe” as the database name.
Creating a Workstation Team for Installing vCenter and ESX
Did you notice that up this point we have not created one single VM? Well, now its the time. You have to install here two VMs, the first for the vCenter Server on Windows 2003 64bit, and the second for ESXi 4.1. Make sure you configure the networking on both VMs on the Host-only network and to set static IPs from that subnet. Needless to say that they must match the DNS entries you created earlier. The last thing needed here is to import the vSM into your ESXi as a nested VM and you are done.
Alright, so now that we have everything in place (with only 2 VMs in Workstation and a nested VM in ESX) we will need to fire up our browser in CentOS and point it to the vCD portal. Once there, you will need to finish the initial configuration (licensing and system id name), and then attached the vCenter Server + vSM to your vCD. Once this is done, you can power off your vSM and leave it as it is until you come later on to the point where you need to do your cloud networking (e.g. create network pools).
Congrats! you now have a fully working vCD setup on your laptop with 4GB memory. In fact, you can theoretically have 2GB only and work fine if you keep all your VMs down just to show the vCD interface to your customers. That’s right, you don’t need vCenter or ESX in order to login to your vCD portal and browse through it. I found this very handy when sitting with a customer who just wanted to have the look and feel of this “vCloud thing” as per his words!
Do you have 8GB Laptop? GO WILD!
So now that we’ve seen how you can run all that on 4GB, what if you actually have 8GB memory? Here are some ideas:
- Configure NFS on your CentOS and use it as a shared storage!
- Create and install another ESX VM and use the NFS as a shared storage.
- Create and install a CentOS VM to run a second vCD Cell and test how a two-cell environment works!
- Create and install a second vCenter Server VM and attache it to your vCD.
Have fun!
Migrating your VMs from vSphere to vCloud Director and vice versa
There was an interesting question on the VMware community forums and I thought it would be good to blog about it – How can you move your VMs in and out of your cloud that is managed by vCloud Director?
I’m not talking here about vMotion, but rather the native place your VM is running in. You might think that everything at the end is running inside ESX (and you are right) but there is one thing you might know about. If you try to migrate a VM that was originally created by vCloud Director and place it in an ESX server that is not managed/prepared by vCD, you will simply not be able to. You will get an error similar to the following:

Shocking? Not really. This is something very important to always keep your cloud VMs within the boundaries of vCD.
Let’s take a closer look.
Migrating the VMs from vSphere to vCloud Director:
If you want to migrate a VM from your vSphere environment to vCD, you can simply go to your Organization -> My Cloud -> vApps -> and then choose the “Import from vSphere” icon in the tool bar.

You will then get a dialog box asking you which VM you want to migrate from the vSphere inventory, and whether you want to move or copy it.
So far it’s pretty straight forward. Now let’s see how to do that the other way around.
Migrating the VMs from vCloud Director to vSphere:
As I mentioned above, if you tried to migrate a VM that was originally created in vCD to a host that is not part of your cloud recourses (aka not prepared by vCD), you will get an error preventing you from doing that. The reason being is that all the cloud VMs are actually pinned by a custom vCenter fields in the database to differentiate them from the other native vSphere VMs. These custom fields start with: system.service.vmware.vsla and then followed by the vCD system ID (in my case its HyperCloud as you see in the first screenshot).
Now, how can you remove that field in order to migrate your VM outside of your cloud? there are two ways to do that:
1 – You can simply unregister your VM from vCenter Server (using your vSphere Client), and then browse to you datastore, write click on the VM’s VMX file and select “Add to inventory”. By doing that you will be able to automatically remove the custom field and add the VM as if it was never created in your cloud. Of course you may Storage-vMotion the VM later on to another datastore/location for easier management.
2 – The second way is to browse through your vCenter mob browser and remove that custom field manually as shown in the screenshot below.


Of course i’m more in favor of the first option. It’s easier and cleaner!
UPDATE: Duncan Epping over at Yellow-Bricks.com wrote another solid solution for this. Make sure to read his article at this link. Duncan and I don’t seem to be agree on some points, but that’s the beauty of blogging – different views and opinions is always important.
Enabling SSH access on your vShield Manager
I noticed something cool today while playing with the vShield Manager in my vCloud Director lab. You can actually enable the SSH on your vSM by issuing this command from the VM console:
ssh start
Note that you have to be in the privileged mode (by typing “enable”) in order to start the SSH daemon. This might be useful for large enterprises or service providers with lots of vCenter instances and vSM. You can have this easy SSH access or even integrate it in your management software instead of the manual and traditional process of opening the VM consoles.
UPDATE: Tool: CloudCleaner v2.5
UPDATE: [16-09-2010] Version 2.5 is released! Checkout the new features below! Please note that this is not an official VMware tool. Use it at your own risk!
My colleague, Luke Terheyden, coded a very useful tool to clean-up the vSphere environments prepared and managed by VMware vCloud Director. I was personally using it throughout the process of cleaning/reinstalling the different Redwood RTQA releases in my remote physical lab. You can imagine how much time and effort this tool saved me instead of going through the manual process.
I thought you also might be interested in the same since you will be probably in the phase of testing and evaluation of vCD at the time of writing these lines. I contacted Luke yesterday and he was very kind to approve sharing his tool with the public. To quote Luke’s own words: “I’m satisfied that it’s been used internally enough to be stable for a wider audience, so go ahead and post it on your blog! I would be thrilled if it could also help our customers.”
With that said, here is the download link.
The CloudCleaner removes the following (you have the choice to select whatever you want):
- Virtual machines
- Portgroups
- VM inventory folders
- Resource pools
- Datastores
- Networks
- Uninstalls host agents
Features:
- Written in java, so it’s cross-platform (It has been tested on Windows so far)
- Easy-to-use UI
- Intelligent authentication handling – if your login credentials fail, you’ll be given the chance to re-auth in realtime
- Fast! Uses up to 2000 simultaneous threads
- Single jar deployment – download and run
- Auto-detects developer settings – vCenter IP and credentials
- Safe – auto-detects inconsistencies and repairs them
New in release 2.5:
- more robust error handling for edge cases
- much smarter vCD item detection
- no longer cleans VC VMs not related to vCloud Director
- no longer wipes unrelated folders found in datastores
- new – advanced ‘clean all’ mode, in case you really want to clean unrelated items!
- fixed some thread lock issues
- VC crawl engine optimizations
- now supports command-line usage
- fixed some scan / rescan bugs
- now detects orphaned objects (e.g. removing a VM leaves a folder behind, etc.)
Screenshot:

Diagram: VMware vCloud Director Networking Architecture
If we are gonna perform Inception then we need imagination. An elegant solution for keeping track of reality – The “Inception” Movie.
Before I introduce this new diagram to you, I would like to make a bold statement: No matter how complex this diagram will look to you from the first glance, I can tell you that you’ve been practicing all its core technical concepts for a quite long time. You will just need a bit of imagination and I guarantee to you that everything will make a perfect sense faster than you can imagine. Read on…
Let’s go back to the very first VMware product that has changed the way we think in our IT industry – Workstation! When you create a new virtual machine in Workstation, you get four options for networking:
- Bridged connection – a pass-through network to the outside world.
- NAT’ed connection – a network translated connection.
- Host-only connection – a private network isolated from the outside world.
- None – no network at all.
Guess what? that’s the core technical concepts I’ve been talking about. Here are the new names that we will be using from now on when we refer to vCD (in the same order):
- Direct connection
- Routed connection.
- Isolated (private)
- None (no network)
Now, have you seen the “Inception” movie? (if you haven’t, you missed one of the greatest movies in this decade!) Do you remember the layer of dreams in that movie? Well, that is somehow what we have here. Imagine your virtual machines running in different layers of dreams networks, and depending on which layer you are looking at, it might be direct, routed or isolated. Let’s see that from a closer look:
- First Layer: the real world – this is the actual physical network which we are in most cases not concerned about.
- Second Layer: the vNetwork Standard Switch, Distributed Switch or even Cisco Nexus 1000V.
- Third Layer: the External network – this is sort of your gateway to the outer world.
- Forth Layer: the Organization network – this is sort of the gatekeeper for your VMs. It will always show you what is your logical boundaries.
- Fifth and last layer: the vApp Network – this is the ultimate end your VM can reach (think LIMBO!)
Now that you have these basic concepts in mind, let’s see what we have in this diagram:
- This is an A2 size diagram. I’ve really tried my best to keep it in the A3 scale but it’s just not possible with all this amount of information in one place.
- The diagram covers nearly all the networking options of the vCD but from a “Private Cloud” perspective. In the world of Public Clouds this might be a bit different to layout (which i will do in the future) but the core concepts remains exactly the same.
- The diagram comes with some text describing the various components and elements. I’m introducing this for the first time here to help you understand what you are looking at instantly without taking your focus away from the diagram.
- You will see a different PDF layers in the diagram, you can hide/show them as you need. Example: when you are having a closer look into a specific area in the diag, you might find the descriptions useful to have while they might be a bit distracting if you are zooming out to have a holistic view of the diagram.
- You will see the actual screens of the vCenter networking – the vSS, vDS and the different port groups. Not just that, you will actually see how the VMs in your cloud ultimately look like in vCenter. Add to that all the other components like the External/Organization networks as well as the vShield Edge devices. Of course i’m taking just examples of everything in most cases to avoid the complexity.
- I’ve included as well the screens of the vCloud Director to show you how the Network Pools looks like along with the other panels of the External and Organization networks.
- The IP addresses can play a very important role towards your understanding on how all these vApps communicate together. For example, when you see two vApps sharing the same OrgNetwork and still have the exact same IP addressing, it automatically means that they are routed through an edge device.
- I included three connectivity examples for the outside world of your private cloud. A production cloud, an Internet cloud and an MPLS cloud. Please note that these are just examples not the only options you can have. This is something that can be very specific from a customer use case to another.
- Last but not least, the vApp networks are laid out like that to fit the best view in the diagram. This is not an attempt to tell you how you should run your vApps but rather show you the different options you have. Again, this is something that is very specific to the customer use cases and requirements.
In the future networking posts on vCD i will start going deeper in the discussion and reference the examples shown in this diagram all the way through. I encourage you to print out this diagram and keep it somewhere near your home/office desk and have a glance through it from time to time. There is nothing better than visualizing something that is as complex rich as the vCD networking. I highly recommend also checking out Duncan Epping’s article on vCD networking, this is a must read for all the vCD newbies.
One more thing. I’d like to give some credit to my colleague at VMware, Massimo Re Ferre’, for showing me the way to understand this great networking topic. Massimo along with Eddie Dinel, Mike D and Vishal Kumar, presented together one of the most interesting presentations I’ve attended for vCD when it was still in Beta. I believe parts of this great presentation have been divided into more than one session in VMworld 2010, so I urge you to go and have a look into the recordings when the sessions are available online.
UPDATE: (14-09-2010): The networking part of the presentation I’ve mentioned above has been re-written by the master at this link. Another MUST-READ.

