Posts

How to connect to vCloud director using REST API clients ?

We all have had the use case to connect to vCloud director via API to pull some details. Below is the detailed process on how to connect using REST client.

I am using the Postman windows client. The procedure will remain the same for the other REST client applications too.

Step 1 :

Download the postman client
https://www.getpostman.com/downloads/

Step 2 (Optional) : 

You may have to disable the SSL certificate verification if you are trying this on a test environment and do not have trusted certificates


Step 3:


Enter the credentials under the Authorization tab You must append either @system to the username or @orgname. This depends on the role you have. As a system administrator, you must use @system because your admin user is not bound to a special organization. As org admin or org user, you must append your organization name.

For example: administrator@system or orgadmin@wecloud


Enter the Accept header under the Headers tabsKey : Accept  Value : application/*+xml;version=32.0
The version …

vCD HTML5 UI - Editing rights bundle fails with " Unexpected token < in JSON at position 0 "

Image
If you have come across an error message similar to the below in the vCD HTML5 UI, the issue is due to the large payload on the load balancer

Unexpected token < in JSON at position 0



Browser console has the below error :

Failed to load resource: the server responded with a status of 502 (Bad Gateway)
service-provider.bundle.js:1 Unsupported REST exception RightsComponent#rights SyntaxError: Unexpected token < in JSON at position 0
  at JSON.parse (<anonymous>)
  at CatchSubscriber.selector (service-provider.bundle.js:1)
  at CatchSubscriber.error (vendor.bundle.js:991)
  at XMLHttpRequest.s (vendor.bundle.js:830)
  at ZoneDelegate.invokeTask (vendor.bundle.js:1040)
  at Object.onInvokeTask (vendor.bundle.js:457)
  at ZoneDelegate.invokeTask (vendor.bundle.js:1040)
  at Zone.runTask (vendor.bundle.js:1040)
  at ZoneTask.invokeTask [as invoke] (vendor.bundle.js:1040)
  at p (vendor.bundle.js:1012)


Action Plan:

In my case, I am using NSX Edge Load balancer

PUT https://<NSX-IP>/api/4.0…

vApp missing from vCloud director HTML5 UI

Image
Symptoms :

Unable to see the vApp on the HTML5 UI The vApp is seen on vCloud director Flex UI 
Cause
-  This happens if the VM was created as a standalone VM from the HTML5 UI.   - Since there has been no improvement done recently on the Flex UI, the old UI does not have a view  to display standalone VMs seperately. Hence the standalone VMs are displayed in the vApp




Fix:
Run the below statements for the list the
vcloud=# select vapp_id from vapp_vm where name like '%stdalone%';
-[ RECORD 1 ]--------------------------------- vapp_id | b1c58135-7c93-43ac-a7d2-c8412fc74c98

vcloud=# select * from vm_container where sg_id = 'b1c58135-7c93-43ac-a7d2-c8412fc74c98'; -[ RECORD 1 ]-------------+----------------------------------------------------------------------------------- sg_id                     | b1c58135-7c93-43ac-a7d2-c8412fc74c98 name                      | stdalone-04ad56d5-2a60-4a06-a750-f3e371d3284b descr                     | This vApp is created automatically on behalf o…

How to collect logs from vCloud director ?

Image
vCloud director does not have an GUI way of exporting the support bundle as of now

To collect the vCloud Director support bundle, establish an SSH connection to one of the vCloud Director VMs and run the following command:

/opt/vmware/vcloud-director/bin/vmware-vcd-support

Above command collects only log bundle for single cell by default)

Usage: vmware-vcd-support [OPTIONS]

  -d,       --dbdump           Collects DataBase dump.

  -l,       --log              Collects logs on single cell (default)
                               or multiple cells (with --multicell)

  -a,       --all              Collects all data bundles for single cell.
                               If used with --multicell option then it collects
                               all data bundles from multiple distributed cells.

  -m,       --multicell        If used with --all option, collects all data bundles
                               from multiple cells. If used with --log then
                               collects only lo…

vCloud director 10 - Prerequisites & Deployment

Image
This blog is talks about the way to deploy vCloud director 10.x appliance without zero errors in first attempt. 

There are just 3 requirements which is mandatory for error free deployment. 

Only prerequisites


1. Dedicate 2 IP addresses (eth0 & eth1) - Eth0 is for the HTTPS and Console proxy. Yes, both HTTPS & Console Proxy uses same interface. The console proxy uses a custom port 8443. - Eth1 is dedicated for postgres database connection only
2. Add DNS entries for the IP addresses (Forward and Reverse DNS lookup) - Reverse DNS lookup entry is a must - If you have noticed vCD appliance taking PhotosOS as the hostname, it is because the reverse DNS entry does not exist.
3. Prepare the NFS server i.Create a NFS folder with full read & write permissions. ii.The format to use isNFS_Server_name:/Directory_name (ex : nfs.wecloud.lab:/vCD97rpr )  iii.Make sure the directory contains no old deployment entries. Its better clean up the directory before using it.


Deployment :






Adding vCenter instance to vRO looks unhealthy - (unusable: java.lang.ClassCastException: com.vmware.vcac.authentication.http.spring.oauth2.OAuthToken cannot be cast to com.vmware.vim.sso.client.SamlToken)

Image
Issue : 

Adding vCenter instance to vRO completes but the inventory has below messages.

https://vcenter.wecloud.lab:443/sdk (unusable: java.lang.ClassCastException: com.vmware.vcac.authentication.http.spring.oauth2.OAuthToken cannot be cast to com.vmware.vim.sso.client.SamlToken)




Storage Policies (unusable: PBM error: java.lang.RuntimeException: java.lang.ClassCastException: com.vmware.vcac.authentication.http.spring.oauth2.OAuthToken cannot be cast to com.vmware.vim.sso.client.SamlToken)



Storage Policy Components (unusable: PBM error: java.lang.RuntimeException: java.lang.ClassCastException: com.vmware.vcac.authentication.http.spring.oauth2.OAuthToken cannot be cast to com.vmware.vim.sso.client.SamlToken)

Resolution : 

Add the vCenter instance as Share a unique session



Hope it helps :)

PostgreSQL bloat (full) on vCloud director 9.7.x

Since the last few weeks, I have noticed couple of vCloud director 9.7 facing disk usage full issue on the appliance. It is mostly due to the PostgreSQL using up most of the space.

Running the below command on the appliance console gives you the output of disk usage per partition

df -h

Output : 
root@vcd [ ~ ]# df -h Filesystem                                                 Size  Used Avail Use% Mounted on devtmpfs                                                    5.9G     0  5.9G   0% /dev tmpfs                                                          5.9G   28K  5.9G   1% /dev/shm tmpfs                                                          5.9G  748K  5.9G   1% /run tmpfs                                                          5.9G     0  5.9G   0% /sys/fs/cgroup /dev/sda3                                                    28G  2.6G   24G  10% / tmpfs                                                          5.9G   36K  5.9G   1% /tmp /dev/sda2                                              …