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.
Nithin says
Hi William,
Thanks for you post and sharing this information,
I got any other question in my mind, let say I want to extract the list of all RHEL VMs from the vCloud director.
Is there any specific variable can be used to filter the RHEL VMs ?
Many thanks
-Nithin