WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Hardware Options
    • Hardware Reviews
    • Lab Deployment Scripts
    • Nested Virtualization
    • Homelab Podcasts
  • VMware Nostalgia
  • Apple

Automating vCenter Server Advanced Settings

02.06.2012 by William Lam // 1 Comment

This weekend I needed to make a change to one of the advanced settings in my vCenter Server. This can be done using the vSphere Client, but it is also possible to use the vSphere API, (although it is not well-known). This can come in handy especially when you need to make a change across several dozen vCenter Servers and not have to manually login to each one. In the vSphere API, there is a property under the service content called setting which contains an array of advanced settings that can be modified.

I wrote a quick vSphere SDK for Perl script called vCenterAdvSettingMgmt.pl which allows for two type of operations "list" and "update". When you use the update operation, you will be required to pass in both the key and value that you would like to change.

Here is an example of the "list" operation:

Here is an example of the "update" operation where I am updating the "VirtualCenter.ManagedIP" setting:

You can verify the change by re-running the "list" operation:

This script came in very handy when deploying the new vCenter Infrastructure Navigator which requires "VirtualCenter.ManagedIP" to be configured prior to deploying.

Categories // Uncategorized Tags // vsphere sdk for perl

How to Change the IP Address for vCenter Operations 5 vApp

02.04.2012 by William Lam // 11 Comments

There was an interesting question on twitter from Matt Cowger yesterday asking how to modify the IP Address of the Analytics VM in the new vCenter Operations 5 vApp after it has been deployed. The new VC Ops 5 is actually composed of two virtual machines: UI and Analytics VM. As part of the initial deployment, they're is an exchange of information between the two VMs to properly get setup which includes the IP Addresses of each other. Simply modifying the IP Address of either VM will result in VC Ops not functioning correctly.

I personally have not had to re-IP my home deployment of VC Ops, but I did have some experience with CapacityIQ before it was combined into the VC Ops product and there was a nifty CLI tool called ciq-admin that was not very well known. I thought I check to see if the new VC Ops had something similar and to my surprise, an updated version of the tool exists and has been renamed to vcops-admin.

After a few minutes of looking around, it was clear that one could modify the IP Address of the Analytics VM and here are three simple steps.

Disclaimer: This is for educational purposes only, this is not officially supported by VMware. Please ensure you test and backup your system before making any changes in a real production system. Data that was previously collected will still be available after the change of an IP Address.

Modifying IP Address for Analytics VM:

Step 1 - First we need to shutdown VC Ops, you can do this from the administrator page by going to https://[vcops-ip]/admin and stopping the service under the Status tab. In this example, I will be showing you how to so using the CLI on the UI VM (this is primary system you use to access VC Ops)

You will need to sudo to "admin" user to run the command "vcops-admin stop". If you accidentally logged into the analytics VM and try to run the command, you will receive an error as the CLI is only available on the UI VM.

Step 2 - Log into the remote console of the analytics VM, this is required as you will be changing the IP Address and may possible impact network traffic. You will need to edit /etc/sysconfig/network/ifcfg-eth0 using an editor such as "vi" and specify the IP Address you wish to change to. Once you are done, you will need to restart the network interface for the changes to take effect. To so so, run the following command "service network restart".

Step 3 - Go back to the UI VM (you will need to sudo over to "admin" account if you are not already) and you will now need to "repair" the connection between the UI and Analytics VM to ensure they can communicate with each other. To do so, you will run the following command "vcops-admin repair --ipaddress [new-analytics-ip]". If the UI VM is able to successfully connect to the new IP Address of the Analytics VM, it will automatically start up the VC Ops service. Once the service has been started, VC Ops is now running and operational.

Now what if you want to change the UI VM's IP Address? I thought this should be pretty straight forward right? Well, it took me a bit longer than I was expecting but the process is just four easy steps.

Modifying IP Address for UI VM:

Step 1 - Stop VC Ops service, you can do this using the admin portal or via SSH as shown in Step 1 of Analytics VM

Step 2 - Login to the remote console of the UI VM this is required as you will be changing the IP Address and may possible impact network traffic. You will need to edit /etc/sysconfig/network/ifcfg-eth0 using an editor such as "vi" and specify the IP Address you wish to change to. Once you are done, you will need to restart the network interface for the changes to take effect. To so so, run the following command "service network restart".

Step 3 - Login via SSH to UI VM using the new IP Address (you will need to sudo over to "admin" account if you are not already) and you will now need to "repair" the connection between the UI and Analytics VM to ensure they can communicate with each other. To do so, you will run the following command "vcops-admin repair --ipaddress [new-analytics-ip]". If the UI VM is able to successfully connect to the Analytics VM, it will automatically start up the VC Ops service.

Step 4 - The last step is to update the vCenter VC Ops plugin information so when you navigate to the VC Ops extension, it knows the new IP Address. This step can be done by logging into the admin portal and under "Registration" tab, you will need to click on the "update" button for each and every vCenter that is attached to the VC Ops. In this example, I will show how to do so using the "vcops-admin" CLI. You will need to run the following command:

vcops-admin register update --vc-name [vc-name] --vc-server [https://vc-server/sdk] --username [vc-username] --password [vc-password] --force

Note: This process may take a few minutes for each vCenter that you need to update, also if you  have a dedicated service account for the collector, you can specify --collection-user and --collection-password agruments.

Though the process of modifying the IP Address is not available through the UI today, it is a feature that I will be requesting as this should be a trivial task for users.

Categories // Uncategorized Tags // vCenter Operations, vcops, vcops-admin

Extracting GuestOS IDs From vCloud Director

01.19.2012 by William Lam // 1 Comment

There was an interesting question on the VMTN forums last week on capturing the list of supported guest operating systems using the vCloud APIs. This feature is currently not available today using the vCloud API, as it there is no way to extract the list of supported guestOS identifiers. If you take a look at the vCloud Director User Guide, you can get a list of supported guestOSes, but it does not translate to the API identifiers that is needed when provisioning a VM in vCloud Director.

The list of supported guestOS types are stored in the vCloud Director database and you can extract the guestOS IDs if you have access to the database or a DBA that manages the database. Using the following SQL query, you can get the list of supported guestOSes that includes the API ID and description. Since the list of guestOSes are inserted upon installation, I have already captured the output for a default vCloud Director 1.5 instance for your reference.

Disclaimer: This SQL query is not supported by VMware nor should you directly access the vCloud Database as a best practice without the consent of VMware Support.

In this example, I am querying the list of default guestOSes from a vCloud Director 1.5 instance that was installed on Oracle XE database.

First you need to set several environmental variables for your respective ORACLE_HOME, ORACLE_SID and update your PATH variable (your paths will vary based on your installation + OS):

[root@vcd ~]# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
[root@vcd ~]# export ORACLE_SID=XE
[root@vcd ~]# export PATH=$ORACLE_HOME/bin

Next we will login using sqlplus and you will need to know the username and password of the vCloud Director database that was configured during installation:

[root@vcd ~]# sqlplus "vcloud/vcloud"
SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 1 19:30:24 2011
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Before we execute the query, we need to set a few parameters to help with the readability of the output:

SET ECHO OFF
SET WRAP OFF
SET FEEDBACK OFF
SET PAGESIZE 0
SET HEADING OFF

Now we are ready to execute the SQL statement:

SQL> select internal_name||' == '||display_name from guest_os_type order by display_name;

Note: I am not a SQL expert nor DBA, I am sure there are other variations of formatting.

Here is a screenshot of the execution above:

The list of supported default guestOS types in vCloud Director 1.5 is 80:

guestOS Identifier guestOS Descriptioin
asianux3Guest Asianux 3 (32-bit)
asianux3_64Guest Asianux 3 (64-bit)
asianux4Guest Asianux 4 (32 bit)
asianux4_64Guest Asianux 4 (64 bit)
centosGuest CentOS 4/5/6 (32-bit)
centos64Guest CentOS 4/5/6 (64-bit)
dosGuest DOS
debian4Guest Debian GNU/Linux 4 (32-bit)
debian4_64Guest Debian GNU/Linux 4 (64-bit)
debian5Guest Debian GNU/Linux 5 (32-bit)
debian5_64Guest Debian GNU/Linux 5 (64-bit)
debian6Guest Debian GNU/Linux 6 (32 bit)
debian6_64Guest Debian GNU/Linux 6 (64 bit)
freebsdGuest FreeBSD (32-bit)
freebsd64Guest FreeBSD (64-bit)
win2000AdvServGuest Microsoft Windows 2000 Advanced Server
win2000ProGuest Microsoft Windows 2000 Professional
win2000ServGuest Microsoft Windows 2000 Server
win31Guest Microsoft Windows 3.1
windows7Guest Microsoft Windows 7 (32-bit)
windows7_64Guest Microsoft Windows 7 (64-bit)
win95Guest Microsoft Windows 95
win98Guest Microsoft Windows 98
winNTGuest Microsoft Windows NT 4
winNetDatacenterGuest Microsoft Windows Server 2003, Datacenter Edition (32-bit)
winNetDatacenter64Guest Microsoft Windows Server 2003, Datacenter Edition (64-bit)
winNetEnterpriseGuest Microsoft Windows Server 2003, Enterprise Edition (32-bit)
winNetEnterprise64Guest Microsoft Windows Server 2003, Enterprise Edition (64-bit)
winNetStandardGuest Microsoft Windows Server 2003, Standard Edition (32-bit)
winNetStandard64Guest Microsoft Windows Server 2003, Standard Edition (64-bit)
winNetWebGuest Microsoft Windows Server 2003, Web Edition
winLonghornGuest Microsoft Windows Server 2008 (32-bit)
winLonghorn64Guest Microsoft Windows Server 2008 (64-bit)
windows7Server64Guest Microsoft Windows Server 2008 R2 (64-bit)
winNetBusinessGuest Microsoft Windows Small Business Server 2003
winVistaGuest Microsoft Windows Vista (32-bit)
winVista64Guest Microsoft Windows Vista (64-bit)
winXPProGuest Microsoft Windows XP Professional (32-bit)
winXPPro64Guest Microsoft Windows XP Professional (64-bit)
netware5Guest Novell NetWare 5.1
netware6Guest Novell NetWare 6.x
os2Guest OS/2
oesGuest Open Enterprise Server
oracleLinuxGuest Oracle Linux 4/5/6 (32 bit)
oracleLinux64Guest Oracle Linux 4/5/6 (64 bit)
otherGuest Other (32-bit)
otherGuest64 Other (64-bit)
other24xLinuxGuest Other 2.4x Linux (32-bit)
other24xLinux64Guest Other 2.4x Linux (64-bit)
other26xLinuxGuest Other 2.6x Linux (32-bit)
other26xLinux64Guest Other 2.6x Linux (64-bit)
otherLinuxGuest Other Linux (32-bit)
otherLinux64Guest Other Linux (64-bit)
rhel2Guest Red Hat Enterprise Linux 2
rhel3Guest Red Hat Enterprise Linux 3 (32-bit)
rhel3_64Guest Red Hat Enterprise Linux 3 (64-bit)
rhel4Guest Red Hat Enterprise Linux 4 (32-bit)
rhel4_64Guest Red Hat Enterprise Linux 4 (64-bit)
rhel5Guest Red Hat Enterprise Linux 5 (32-bit)
rhel5_64Guest Red Hat Enterprise Linux 5 (64-bit)
rhel6Guest Red Hat Enterprise Linux 6 (32-bit)
rhel6_64Guest Red Hat Enterprise Linux 6 (64-bit)
openServer5Guest SCO OpenServer 5
openServer6Guest SCO OpenServer 6
unixWare7Guest SCO UnixWare 7
eComStationGuest Serenity eComStation 1
eComStation2Guest Serenity eComStation 2
solaris10Guest Sun Solaris 10 (32-bit)
solaris10_64Guest Sun Solaris 10 (64-bit)
solaris11_64Guest Sun Solaris 11 (64 bit)
solaris8Guest Sun Solaris 8 (experimental)
solaris9Guest Sun Solaris 9 (experimental)
sles10Guest Suse Linux Enterprise 10 (32-bit)
sles10_64Guest Suse Linux Enterprise 10 (64-bit)
sles11Guest Suse Linux Enterprise 11 (32-bit)
sles11_64Guest Suse Linux Enterprise 11 (64-bit)
slesGuest Suse Linux Enterprise 8/9 (32-bit)
sles64Guest Suse Linux Enterprise 8/9 (64-bit)
ubuntuGuest Ubuntu Linux (32-bit)
ubuntu64Guest Ubuntu Linux (64-bit)

If you have ever worked with the vSphere API, you will notice the guestOS API IDs are exactly the same as the guestOS Identifiers found in the vSphere API. vSphere 5 supports a total of 105 guestOSes and 80 of those are supported in vCloud Director.

A feature request has already been submitted to be able to query for the list of supported guestOSes using the vCloud API. For now, this is another way of retrieving API guestOS identifier without having to manually create each guestOS type through the web interface and query for the identifier.

Categories // Uncategorized Tags // guest os, vcd, vcloud director

  • « Previous Page
  • 1
  • …
  • 46
  • 47
  • 48
  • 49
  • 50
  • …
  • 74
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Automating the vSAN Data Migration Pre-check using vSAN API 06/04/2025
  • VCF 9.0 Hardware Considerations 05/30/2025
  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025