Tag Archives: Vcloud Director

VMWARE VCLOUD DIRECTOR CONFIGURATION AUTOMATION SCRIPT

Its been a busy busy month for me. We just launched out Dedicated vCloud Product at Rackspace which was fun to work with. I am part of a team of three Product Engineers who led and are primarily responsible for this massive undertaking and it has been fun.

Anyways, here what I have for you is the configuration automation script for VMware vCloud Director.

The script was fun to write and like my other scripts runs off of PowerShell and VMware vCloud Director RestAPI. Now I did want to write this in Java using the Java SDK for vCloud Director however that may happen in some time. No promises though.

You can pull my script and tweak it for your environment. The idea here is to identify the Restful payloads that you will need to finish parts of the configuration and then integrating the same in your environment.

You can find the script at my Github repo.

Do not forget to update the VCD-CONFIG.XML file and appropriately add the number of hosts and its credentials to the XML payload. Also make sure you comment out what you don’t need.

Let me know what you think 🙂

HOW TO CLEAN UP VCD QRTZ TABLES AND WHY?

Why? – QRTZ tables hold the process states and file triggers in vcloud director. QRTZ tables live in the vcloud director database.  During issues of non-responsiveness from VCD cells or CPU spikes, QRTZ tables will need to be cleaned up in order to clear out the issue. This however is a rare event when this happens and if it indeed does, below is the procedure to clear out your QRTZ tables.

How? – Below are the steps to clear up QRTZ tables.

Note – Ensure the core devices for vcloud director cells are marked to proper support maintenance status to avoid alerts.

Note – This is a complete VCD down time event resulting in services being stopped. A maintenance window needs to be scheduled to halt the VCD services.

  1. Stop VCD services on both cells by following steps listed here. Process – Stopping and Rebooting a vCloud Director Instance
  2. Once services are halted login to the SQL Server which has the vCloud director Database.
  3. Backup the database.
    1. Right Click on the vCloud director database and hit on new query. Enter the below below script.

Delete from task;

update jobs set status = 3 where status = 1;

update last_jobs set status = 3 where status = 1;

delete from busy_object;

delete from QRTZ_SCHEDULER_STATE;

delete from QRTZ_FIRED_TRIGGERS;

delete from QRTZ_PAUSED_TRIGGER_GRPS;

delete from QRTZ_CALENDARS;

delete from QRTZ_TRIGGER_LISTENERS;

delete from QRTZ_BLOB_TRIGGERS;

delete from QRTZ_CRON_TRIGGERS;

delete from QRTZ_SIMPLE_TRIGGERS;

delete from QRTZ_TRIGGERS;

delete from QRTZ_JOB_LISTENERS;

delete from QRTZ_JOB_DETAILS;

delete from compute_resource_inv;

delete from custom_field_manager_inv;

delete from cluster_compute_resource_inv;

delete from datacenter_inv;

delete from datacenter_network_inv;

delete from datastore_inv;

delete from dv_portgroup_inv;

delete from dv_switch_inv;

delete from folder_inv;

delete from managed_server_inv;

delete from managed_server_datastore_inv;

delete from managed_server_network_inv;

delete from network_inv;

delete from resource_pool_inv;

delete from storage_pod_inv;

delete from task_inv;

delete from vm_inv;

delete from property_map;

b. Execute the script.

c. Start the vCloud Director cells

Start the vCloud Director services:

# service vmware-vcd start

Starting vmware-vcd-watchdog:                              [  OK  ]

Starting vmware-vcd-cell:                                  [  OK  ]

d. vCloud director now should be accessible without issues

This should clean up your QRTZ tables and your VCD cell should now be responsive.

INTERESTING PAPER ABOUT DISASTER RECOVERY ON VCLOUD DIRECTOR

I ran into this paper which explains how to have DR setup for your vCloud director foot print using SRM.

This is for vCloud Director 5.1 but most of the concepts are still the same and apply for vCloud Director 5.5.

Let me know what you think 🙂 and here’s the link!