Hello,
I have been using the .Net libraries for interacting with the VCloud API and it has been working great. Recently, however, I've run into an issue where, if a vapp is deployed in a vdc, but is in the "Stopped" state, then I am unable to retrieve a reference to that vapp. Instead a "KeyNotFoundException" is thrown. I would expect that if a vapp is deployed in the vdc, it wouldn't matter what state it was in and I should be able to get a reference to it. Below is a code snippet of what I am doing. Any help would be appreciated, thanks.
vCloudClient client = new vCloudClient(url, com.vmware.vcloud.sdk.constants.Version.V1_5);
try
{
client.Login(username, password);
//Get organization
ReferenceType orgRef = client.GetOrgRefByName("OrgName");
Organization org = Organization.GetOrganizationByReference(client, orgRef);
//Get vdc
ReferenceType vdcRef = org.GetVdcRefByName("VdcName");
Vdc vdc = Vdc.GetVdcByReference(client, vdcRef);
//Get vapp reference
ReferenceType vappRef = vdc.GetVappRefByName("VappName"); <-- This is where the exception is thrown when a vapp exists in the vdc, but is in the "Stopped" state.
}
catch (KeyNotFoundException)
{
//Vapp does not exist in vdc
}