Posts Tagged ‘vCloud Director’
How to remote access a Linux GUI from a vCloud environment using a PC or an iPad?
I’ve received this question from one of my readers where he wanted an RDP-like mechanism to access the Linux GUI from a PC or a mobile device (e.g. iPad or iPhone). In his environment he plans to provide some GUI-based applications to his end-users and it must be accessible remotely using Windows and iOS. The vCD portal, for some reason, is not a preferred method in his use-case.
I’ve tried to simulate this in one of my public vCloud accounts and I wanted to share with you these two methods in case they are of any interest to others.
Remote access from Windows machines:
I’ve used here two free tools in order to access the Linux GUI remotely. The first one is my favorite SSH client, Putty. This is to initiate the ssh connection to your VM in the cloud. The second tool is called Xming and we will use it here to forward the X-Window traffic. You need to download and install both the Xming and Xming-fonts utilities.
After the installation is done, all what you need is to fire-up your putty client, and set your SSH connection as follows:

in the Connection -> SSH -> X11 panel click on the “Enable X11 forwarding” check box and put “localhost:0″ in your X display location. Now start the SSH connection and when you are there in the Linux shell you can either launch the GUI application directly (e.g. firefox as shown in the screen shot below) or launch a complete Gnome / KDE session by issuing the commands gnome-session / kdestart respectively.

Remote access from an iOS device (iPhone or iPad):
In this method i used a paid App called “iSSH” since i already have it installed in my iPhone/iPad. You simple need to download the App to your iOS device and setup your SSH connection. once you are at the Linux shell, you also need to run your GUI app and then click to the “X” icon to see the display. Make sure to enable the X-Window in the App after you install it since it is switched off my default.
The iPhone Screenshots:


The iPad Screenshots:


So what is the catch here?
As you may have already noticed, you can only use these two methods if your VMs are connected to an external network (direct or routed). If your VMs are isolated, there is no way to access them remotely. Your only option will be the native VMRC through the vCloud portal.
Publishing the vCloud Director portal on the Internet
One of the very frequent questions I see internally on the VMware mailing lists is how to publish a vCloud Director portal on the Internet. I’ve personally went through the dilemma of searching for such information and had no luck to find something documented in a clear way with configuration examples.
In this post I will cover both the architecture considerations as well as the technical configuration from my experience in a real-world implementation. You have to keep in mind though that there is no one solution that fits all requirements, however, there are always some common guidelines and that’s what I will try to cover here.
Quick introduction
As you already know, a vCloud Director cell provides two services for end users to self-provision and access VMs in a cloud. We will refer to the first service here as “HTTP” and the second one as “VMRC”. The former is obviously responsible for providing the web portal and the latter for accessing the remote console of the VM running on the ESX host even if it doesn’t have any networking set for it.
Architecting your solution
There are two approaches here for publishing the vCD portal on the internet. The first one by connecting your HTTP and Console Proxy interfaces to the DMZ, and the second one by putting a reverse proxy in front of the Cells to handle the https requests back and forth (but not the VMRC). I intend to blog about the reverse proxy solution in a future post so we will focus here only on the first approach.
First thing first, you need to have at least three network interfaces on the vCloud Director cells:
- the first one for the HTTP service
- the second one for the Console Proxy service.
- the third one for the back end communications with the management network e.g. vCenter Server, ESX hosts, NFS shared mount and so forth.
This is a diagram showing you in details the complete architecture that we will talk about throughout this article.

As you see, we have the first and second network adapters connected to the DMZ network which is typically a port-group set on your Management Pod ESX hosts and either segmented with a VLAN or dedicated network cards depending of course on your network and security infrastructure.
As we mentioned above, the third network card on the vCD cell will be communicating with the management network. You have another two options here:
- The first option is to connect this to the same management network port-group in your ESX host, the one that is also serving the vCenter Server, database, NFS ..etc.
- The second option is to connect this interface to a new port-group/VLAN that is being routed through a Firewall to your management network.
The reason being for the second option is that if your vCD cell is compromised on the Internet, the intruder will be still facing another firewall to access your internal management network. In my article here I will adopt the second option since it is the most secured architecture.
Here are an examples on how the networking would look like on a Management Pod ESX host.


The Linux Routing
As illustrated in the diagram (and the vSS/vDS screenshots), we have three different networks for routing the traffic. The first one is the external perimeter network (typically the DMZ), the second network is the internal perimeter network, and the third one is the management network for the vSphere substrate. The common question or confusion here is around the routing. How would the Linux OS decide on the routing paths to the upstream DMZ and the downstream management traffic? And the answer to that is just some basic static routing. Let’s have a closer look.
Firstly, you need to set the IP addresses facing the DMZ with a default gateway. In our case here the IPs for the two cells are (192.168.25.11 / 12 / 21 /22). The default gateway for them is (192.168.25.1). Secondly, for the management network, you need to set the IP address without a default gateway and then set a static route for that network. You have to note here that we will need to have a persistent entry for that route in order to retain the configuration should the cell be rebooted or shutdown for any reason. To do that, you need to add the following entry to the /etc/sysconfig/networking-scripts/route-eth2 file:
GATEWAY0=192.168.20.1
NETMASK0=255.255.255.0
ADDRESS0=198.18.5.0
Let’s quickly explain that. First of all, the file name mentioned above may be different in your case if you are using another order for the vNIC assignment (also note that we are using here a RHEL distribution). In my case, the eth0 and eth1 are assigned to the HTTP and Console Proxy services respectively. The third vNIC, eth2, is set for the management network which we are setting the static route for here. The other entries are self explanatory. The Gateway0 is the firewall IP address that will route our traffic from the Internal perimeter network to the management network. The Address0 and Netmask0 are for the destination management network we are routing the traffic to.
After setting these entries, you will need to restart the networking service and then test the connectivity like pinging the vCenter Server IP address from the Cell shell (sounds like a biology lesson!). After that I recommend to reboot the cell and see if your configuration is still persistent to avoid any issues in the future.
Okay, so now that we have the network all set for our traffic flow, you will need to install the vCloud Director software. When you run the configuration script, you will be asked which NICs you would like to assign to which service (HTTP and VMRC). Just make sure you set that properly.
The SSL Certificates
Depending on your case, you might be using a signed or self-signed certificates for your vCD portal. Each has a slightly different configuration approach the I intend to blog about in details in the future. Meanwhile, I’d highly recommend that you checkout this excellent blog post by Chris Colotti for the high level considerations on the Certificates as well as some great tips on the cell Load balancing.
The Load balancer
First of all, you will need to have two public IPs assigned to you and set on your public DNS servers to resolve to the relevant host names. For example, I’m using these two entries in my diagram:
- vcloud.provider.com -> 11.11.11.11
- vmrc.provider.com -> 22.22.22.22
Of course these are fictitious IP addresses just to show a real-world configuration example end to end. Now it’s time to set your load balancer to point each IP address to distribute the load across the cells as illustrated in the diagram. If we look at a simple traffic flow for the HTTP service it would be as follows:
- The end-user fires-up his browser and point the URL to vcloud.provider.com
- The hostname gets resolved into the public IP 11.11.11.11 and hits the Load balancer external interface.
- The LB then distribute the traffic through its internal interface to the cells IPs (192.168.25.11 and 192.168.25.21).
Note that in our example here we are using a path-through SSL traffic example for the LB.
If you are wondering about the VMRC traffic flow and how it is different from the HTTP service, you can have a look into this great two-part blog post by Michael Hines.
Setting the public address fields in the vCD admin panel
Now to the important part that most of us forget to set. You will have to configure the relevant host names in your “Public Addresses” section in your vCloud Director Administration panel.

As shown in the above screenshot, there are three URLs:
- The vCD Public URL: this will be reflected in the Organization URLs set for your customers access to your cloud.
- vCD public console proxy address: this will be used when the customer clicks on the VM console to access his VM on the web. If this is not set, the cell will use the private IP address which will obviously fail for the user accessing the portal on the Internet.
- vCD public REST API base URL: this will be used for all the functions depending on the APIs. One of which is the end-user uploads of ISOs/templates to the cloud. This one gave me a bit of a grief where I didn’t set that entry properly and had all my uploads failing (again because the cell will use the private IP if this field is empty).
The Network Ports
Last but not least, you have to understand the right network ports that is used in your entire vCloud environment. I have published a detailed KB Diagram earlier that you can grab from here: http://kb.vmware.com/kb/1030816/
You will need to work with your network/security team to open the ports between your different zones. Please note that (at the time of writing this post) there is a small mistake in the ports listed in the diagram. The vCD and ESX hosts do not communicate on port 22 and port 80. Also vCD talks to vSM on port 443 and vSM talks to ESX on port 443. This will be updated very soon on the KB.
I hope you found this article useful in planning and publishing your portals. Happy vCloud’ing!
Integrating VMware vCloud Director with vShield Edge and vShield App
Until a very recent date, I was not quite sure whether this is possible or not. In fact, whenever I was asked if vCloud Director can work with the fully licensed vShield Edge/App or not, I thought the safest answer would be No! After doing some research internally at VMware, I found a great presentation talking about this specific subject. And after viewing this preso for at least two times, I was still not quite sure how it can be set up or configured for that matter. At least I was sure that it can be achieved!
I did some trial and error experiments in my lab until I reached some good results that I thought I’d share with you through this blog post. So, with all that being said, I’d highly recommend trying this in your lab thoroughly before applying in production. To the best of my knowledge, everything you will see here is supported, however, you have to use with caution.
A high level overview.
I won’t go into the detailed benefits of vShield Edge/App and how they are two solid networking and security solutions. I just want to give you a glimpse on what you can achieve/expect from integrating them with vCloud Director:
- By adding the Load Balancing functionality of Edge, you can have simple (yet very powerful) load balancing for web applications in your cloud. The LB is currently limited to http but you can expect more protocols to show up in future releases (Hey, don’t qoute me on that
. I will show you in details how to configure this in vCD/vSE later in the post. - By adding the VPN functionality of Edge, you can do things like site-to-site VPN tunneling using IPsec. I will have a detailed blog post on this interesting subject soon.
- Adding the vShield App functionalities will give you another great tools like traffic visibility that you won’t normally have in these sophisticated inter-VM-networking. Think of it like NetFlow but with new ways to reach very deep levels of Org/vApp networks. You can also do some application level firewalling or even apply them on the vCD External Networks level to enforce some global security policies across all of your tenants. (I will talk about that as well in details in future posts).
First thing first. Licensing.
Before you can test anything here, you must have the appropriate licenses for vShield Manager. Remember, I’m referring here explicitly to the Edge and App (Endpoint is out of my scope here). You will need to get your licenses and apply them first in vCenter Server. This can be done like any other vSphere licenses. You have to note though that these licenses can be applied only after you associate your vCenter Server with the vCloud Director.
Preparing vShield Manager.
After applying the required licenses, you need to go to your vSM web portal and login with your user/pass (admin/default). Once you are there, click on Setting & Reports on the left panel, and then press on the Register button on the right side to register your vSM as an extension in vCenter Server. (Screenshot below)

After registering the vSM extension in vCenter, you will find a new icon in the “Solutions and Applications” tab. In addition to that, and in fact what interest us here, you will find two new tabs called “vShield Edge” and “vShield App” as shown in the screenshot below.

Installing and configuring vShield App
Although you can see the “vShield App” tab present in vCenter, you won’t be able to use anything there until you install the vShield Zones component in vSM. You do that but returning back to the vSM web portal (or now in the vCenter Solutions and Applications section), and selecting your ESX hosts that are present in the “Datacenter” list. On the right side, you will find the link to install the vShield App on the designated host. The setup is pretty straight forward, you just need to enter the IP settings and choose the appropriate datastore and network for storing/managing the appliance. (screenshot below).

Now to the real fun!
Okay, so now that we’ve taken care of all these pre-requisites to license and install the Edge/App components, it’s time to put them in action. I’ve tried to continue using screenshots for the procedures, but I found that really hard. I compiled instead this video (kind of quick and dirty) to make it easier and better to follow.

You can right-click on the image to save the high-resolution video. You can also view the video on You Tube or Vimeo.
And this is a quick illustration showing the setup in the video. We have an Organization called “ITDev” with an organization network which we created under the name “OrgNet-ITDev-Routed_LB”. This OrgNet is routed to an external network with the subnet 172.30.0.0/23.

Important notes
These are some of the notes that I’ve taken throughout the process of testing this integration:
- It is very important to note that you should *NOT* mess with the Firewall and NAT tabs of the vSphere/vShield Edge panels. Anything you can do inside vCloud Director, keep it there. The moment you start to mix things with each others, you will end up with a huge mess, and probably a broken configuration. Remember, the only objective of this post is to empower your cloud with added features that are not currently there in the vCD GUI. We are not trying here to replace the vCD portal with the vSphere Client!
- Make sure you have Abobe Flash Player installed and configured properly with your IE browser. I used here a remote lab to test and configure all that, and while in my initial phase, i had a quite hard time working with the vShield Edge screens. Nothing seemed to work and things used to freeze. After a lot of looking here and there i figured that Adobe was not installed on IE (i use Firefox to access the vCD). Once the Flash Player was installed and configured with IE, everything worked just fine.
- I mentioned earlier that you need to associate you vCenter Server first with vCloud Director in order to be able to apply the vShield Licenses. Make sure also after that to apply the full licenses of Edge in vCenter as it might be still using the basic vSE licensed features.
- DNS, DNS, DNS and D.N.S.
That’s all folks. I will come back with more posts on this subject when I have the time to touch on the vShield App use cases, as well as the VPN features inside vCD.
Changing/Renewing your SSL certificates on vCloud Director Cells
I was working on my vCloud Director lab the other day when I noticed that my SSL certificates expired. I was actually using the same certificates that i generated back in the old beta days.
Although there is no way to renew this SSL certificates from the vCD GUI, the process is fairly easy using the command line. Here is the steps I’ve taken to renew the certs on my lab:

1) First thing you need to stop the vCD cell service. The command for that, using root account, is “service vmware-vcd stop”.
2) Next, you need to run the configuration script once again. The command is “/opt/vmware/cloud-director/bin/configure”
3) Once the script starts, it will ask you for the SSL certificate. You have to identify the name of the file and then enter the required passwords.
4) You accept the question asking you if you want to start the vCD service again and you are done.
The easiest way to check on you new certificate renewal is to fire up your web browser and go to the vCD portal. Once there, you should have the security warning asking you to accept the new cert. In my case this is how the new cert looked like:

It’s important to note here that you need to apply the same changes on all your cells if you are running a multi-cell vCD setup. You may have noticed also that this certificate changes will require a minor downtime, so you have to plan for that as well.
The mysterious required DNS field in the vCloud Director OrgNet
What a title!
While playing with VMware vCloud Director during the beta phase, I came across some interesting points that I documented in my OneNote. One of these points that always confused me is the required DNS field when you create a new Organization Network. Have a look on the screenshot below.

If you look at it from a “Private Cloud” perspective, it makes perfect sense to have this field as a requirement. Why? because your cloud admin will be more or less involved in the infrastructure services. As I always like to say, the cloud admin doesn’t live in his own island isolated from anything else in the enterprise.
Now, if you look at the same thing but from a “Public Cloud” perspective, this can make you scratch your head. Why would the service provider be involved in the internal services of an organization like DNS? How can a SP even know the IP address of the DNS for an Org that is just getting it’s cloud up and running? Furthermore, what if the Organization want to change this IP for any reason in the future?
I researched our internal mailing lists on this point, and I did find that one of my colleagues brought this topic up. The response was simple, this is a small bug that will be fixed in a future update of vCD.