Friday, October 07, 2011

vFabric Data Director - All in a Box setup

vFabric Data Director 1.0 is available for download on the VMware download website. Generally the question we get a lot is on how to do a "small" setup for either a departmental setup or trial setup which is actually small enough to fit in a beefy workstation or a small server. Often time this helps people to evaluate the features of Data Director before doing the "standard" HA setup. Maybe it is only for tests/dev databases where one does not want to invest too much in the infrastructure setup itself..

So here is one such way of doing a "small" setup of vFabric Data Director for test/dev/qa databases.
(Note: This is going to be a long blog post)

What do you need?
  1. A beefy Workstation or departmental Server with lots of RAM and lots of Storage and atleast two network adapter (Even though only one need be connected to the departmental network)
  2. ESXi V5.0 installation CD (Software)
  3. vCenter  Virtual Appliance/Virtual Machine
  4. DHCP Server Virtual Machine
  5. vFabric Data Director Virtual Appliance Image
  6. Preferably atleast one static IP Address on your departmental network for DB Name Server or have Dynamic DNS on your departmental network
  7. License Keys - Use your VMware contacts.

Step I: Preparing the Workstation
On my test setup I had 12GB of RAM with 2x Quad Core x86_64 chips with 5 disks in it. Since this is my whole setup, the more memory I get, the merrier I am with the setup. It is recommended that you have some sort of Raid controller on the setup and have ability to create multiple LUN devices that will be exposed to the ESXi server. On my setup I had about one disk dedicated to ESXi and for other disks I created a RAID-5 LUN (RAID-10 is preferred but I did not have enough space on my demo setup).  If I had more Storage available I would do two setups with RAID-10 setup and a RAID-0 setup which can be used as backup datastore. The RAID preferences depends on individual needs on what to trade off (performance , availability, capacity).

Step II: Installing ESXi 5.0 
Using the ESXi V5.0 installation CD, I installed ESXi  on the first logical device and eventually setup the RAID protected device as a datastore that ESXi can use.

Step III: Install vCenter Virtual Machine
Here one can use the vCenter Virtual Appliance available also. On my demo setup I had used a vCenter Server based on Windows Server 2003 since that was available. Installation of vCenter Server itself can be its own blog entry and I will leave that to experts. For my purpose I had setup vCenter Server setup done in a virtual machine.

Step IV: Setting up vCenter Server for our task
This is where things are bit different for this special all in a box setup. The idea of setting up is to do vFabric Data Director Appliance which includes the hardware. Hence the idea is only the management console and the databases that it deploys are exposed outside (of course the ESXi also has to be visible outside to set this up)  and all other infrastructure related things are hidden within this appliance. This is where two network adapters will come in play. Lets go first with the steps and then a bit of explanation on why do it this way.
I am assuming that the ESXi Server and  vCenter VM has network connected to the live network adapter.
  • Connect to the vCenter through vSphere GUI or through the webclient.
  • Create a new DataCenter. 
  • Create a new Cluster
  • Add the ESXi Host to this cluster
  • Edit Settings for the Cluster to Enable
    • vSphere HA (even though we cannot do it on a single Host)
    • vSphere DRS
    • "VM and Application Monitoring" in VM Monitoring
  • Create a Distributed vSwitch as follows:
    • Go to networking in Inventory you will see your corporate network called probably "VM Network"
    • Add a new distributed vSwitch in the section where you have to add a physical Network Adapter, select the Network Adapter which is not plugged into the departmental network (Skip creating an automatic port group for the switch)
    • Now for the dvSwitch created, create two port Groups "vCenter Network" and "Internal Network"
  • For the ESXi host create a vmKernel port in "vCenter Network" portgroup with a static IP address 192.168.2.2
  • For the vCenter VM, create a new network adapter in the "vCenter Network" port group with a static IP of 192.168.2.1
  • Change the Managed IP of vCenter Server (Administration->vCenter Server Settings->Runtime Settings)  to 192.169.2.1
  • Make sure vCenter server can still access the ESXi server through the new "vCenter Network" portgroup
  • Setup DHCP Server Appliance such that its LAN network is on "Internal Network"
    • I had setup DHCP  Server such that its own IP is 192.168.1.1 and it does DHCP on the network from range 192.168.1.5 to 192.168.1.250 (for my demo setup)

Step V: Deploy vFabric Data Director OVA Template
  • Using the vSphere Client (connected to our vCenter Server) deploy the vFabric Data Director OVA template. 
  • The setup wizard will ask you to select the network for vCenter and the Management console. For the vCenter Network select the "vCenter Network" portgroup and for the Management Console, select the "VM Network" which is the live departmental network
  • If your setup is like mine, I do not have access to static IP adddress in the deparmental network so I just leave the next screen at its defaults to use DHCP and finish the deployment. 
Once the deployment finishes  there will be a new vApp called VMware Data Director.
  • Start the vAPP.  Once the vAPP starts, expand the "+" sign and select to the Management Server VM. 
  • Select the "Summary" tab of Management Server and wait till it shows an IP address.
  • Enter  that IP address in a browser and you should see message "This connection is untrusted" depending on your browse type, add it to your exceptions and then it should take you to License agreement screen. 

Step VI: Setup vFabric Data Director
  • Read and accept the License agreement to proceed. 
  • Next create an administrator account.
  • On the next screen since this is a small setup, I selected the Global User Management Mode
  • Setup the Branding as required on the next screen
  • Setup the SMTP server information if available (needed for user password resets) (You also need outgoing email id for a successful setup of SMTP )
  • On the next screen you have to setup vCenter Network Information. Since we dont have any DHCP on our "vCenter Network" portgroup, edit Network adapter settings and select "Static" with netmask information 255.255.255.0
  • Set static IP addresses 192.168.2.3 for Management server and 192.168.2.4 for DB Name Server
  • On the next screen change Internal Network to select "Internal Network" portgroup and leave DB Name Server Network as the "VM Network" which is the departmental network.
  • On the following screen, select the network settings of "Internal Network"  DHCP should be already selected. Also check Static and add the network mask as 255.255.255.0
  • For Management Server - Internal Network adapter, select static IP address and set it to 192.168.1.3
  • For DB Name Server - Internal Network adapter, select static IP address and set it to 192.168.1.4
  • Warning: This next bit is where you use your one static IP address or Dynamic DNS based FQDN requirement. We still have to provide DB Name Server - DB Name Service Network Adapter. If you have any influence on your IT, get a static IP address for this one. If you get the static IP, then click the Departmental "VM Network" setup and select static IP address with the associate Gateway, netmask and DNS Server setup. Then  set the static IP address for DB Name Server - DB Name Service Network Adapter with the static IP address that you get from your IT..
  • Next enter your Evaluation License keys for vFabric Data Director and vFabric Postgres
  • Finally verify information on the summary page and then click Finish
  • You should get a login screen if it sets up successfully
Note: The most tricky bit is getting the IP address from IT. If for some reasons you do not have a static IP address, fake a  fully qualified domain name for DHCP. Once setup and you get a login screen. Figure out the DHCP IP allocated to DB Name Server using vSphere Client (It is first IP address that shows in the Summary tab of DB Name Server VM). Enter using your administrator account credentials, go to "Administration" tab. Select Settings-> Networking setup. Select Edit Network Setup and step through the setup again and change your fakeFQDN with the DHCP IP address and press finish. Of course this is a hack and not recommended since DHCP IP addresses can change anytime if the lease is up or the system is rebooted and other network policies.

Step VII: Setting Up  an Resource Bundle in vFabric Data Director
For this we need a special Resource Pool in our Virtual Data Center
  • Using vSphere Client we create a resource Pool "Resource Bundle1" in the data center
  • Edit its settings such that it has reservations and limits matching for both CPU and memory
  • Also "Unlimited" should not be checked for both CPU and Memory. 
  • In my demo setup I set CPU reservations and limits to 4096MB and Memory reservations and limits to 4096 MB.
Enter the vFabric Management Console using your administrator credentials and go to "Manage & Monitor" tab.
  • Select "Resource Bundle" and create a new resource Bundle "ResourceBundle1".
  • If the setup is right the next screen should show you the CPU/Memory Resource Pool that we created "Resource Bundle1"  
  • Next select the RAID protected datastore and a size chunk off it for Database Storage. Select any alternative or the same datastore for "Backup Storage" with a sizeable chunk. In my demo I selected my Raid5 based datastore and 100GB sizes for both.
  • Next select the "VM Network" which is my departmental network through which uses will access the database. 
  • Click Finish to setup the Resource Bundle.


Step VII: Setup an Organization in vFabric Data Director
In "Manage&Monitor" select Organizations and create "+" a new organization called "DataDirectorOrg".
  • On the next screen you could select an new user or in my case I used "Choose an existing user" and used my administrator account to manage the Organization also.
  • Next I selected the resource Bundle I just created (need to select "Choose an existing Resource Bundle" to see the resource bundle) 
  • click Finish.
Once created there will be the new Org displayed. If you select it once, the link becomes active. If you then select the active link again it will open a New tab for the Organization for our next step.


Step VIII: Setup a Database Group
Next we have to setup a database group.
  • In the org tab select "Manage&Monitor" tab to see the list of databases (which is empty). 
  • Select the second tab "Database Groups"  to see the empty group list
  • Create ("+" ) a new database group "DBGroup1" where I selected half of my datastore resources assigned for this group leaving the rest of the entries at default.


Step IX: Create a database
  • Select and enter the database group we just created.
  • Create ("+") a new database "dbtest" with owner credentials "dba" and password.
  • Wait till deployment of the database succeeds and "dbtest" is running. 
  • Once running highlight it , right click to see the properties and get the UUID and Name. The client also needs the IP address of the DB Name server.
Here is an image of the distributed vSwitch from vSphere client on my demo box.





Step X: Connect to the database from a client
Download vPostgres Clients for your platform. Then using psql from the client connect to the database similar to the following example
psql -h {dd9fce1e-db46-4a08-99a1-e9023b8239fe}.129.55.555.55 -d dbtest1 -U dba

It should prompt for the dba password and now you are connected to the database and the setup is working. Check out my previous blog entry on how to use vPostgres Clients.

Finally now the setup of vFabric Data Director all in a box setup is working and tested.

2 comments:

GeraldWC said...

I tried to configure with 6GB with ESXi and 2GB with VC, and set the vc as the DHCP & DNS server of the internal network. it works. just shrink the memory of the two vms(ldap&mgmt server) to half.

GeraldWC said...

Also, I think the CPU should be VT enabled.