Merge pull request #681 from aledsage/vcloud-listimage-unsupported-exception

Issue 995: handle illegal argument in vcloud images
This commit is contained in:
Adrian Cole 2012-06-21 16:24:03 -07:00
commit f3510dc6c5
5 changed files with 444 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.domain.Location; import org.jclouds.domain.Location;
import org.jclouds.logging.Logger; import org.jclouds.logging.Logger;
import org.jclouds.ovf.Envelope; import org.jclouds.ovf.Envelope;
import org.jclouds.util.Throwables2;
import org.jclouds.vcloud.TaskInErrorStateException; import org.jclouds.vcloud.TaskInErrorStateException;
import org.jclouds.vcloud.TaskStillRunningException; import org.jclouds.vcloud.TaskStillRunningException;
import org.jclouds.vcloud.VCloudClient; import org.jclouds.vcloud.VCloudClient;
@ -109,6 +110,14 @@ public class VCloudComputeServiceAdapter implements ComputeServiceAdapter<VApp,
} catch (IllegalArgumentException e){ } catch (IllegalArgumentException e){
logger.warn("Unsupported: "+ e.getMessage()); logger.warn("Unsupported: "+ e.getMessage());
return false; return false;
} catch (RuntimeException e) {
IllegalArgumentException e2 = Throwables2.getFirstThrowableOfType(e, IllegalArgumentException.class);
if (e2 != null) {
logger.warn("Unsupported: "+ e2.getMessage());
return false;
} else {
throw e;
}
} }
return true; return true;
} }

View File

@ -131,6 +131,10 @@ public abstract class BaseVCloudComputeServiceExpectTest extends BaseRestClientE
.message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/template1.0-vcd15.xml", VCloudMediaType.VAPPTEMPLATE_XML +";version=1.0")) .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/template1.0-vcd15.xml", VCloudMediaType.VAPPTEMPLATE_XML +";version=1.0"))
.build(); .build();
protected HttpResponse successfulVersion1_0GetVAppTemplateResponseFromVCD1_5WithMultipleVMsAndVDCParent = HttpResponse.builder().statusCode(200)
.message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/template1.0-vcd15-multi-vm.xml", VCloudMediaType.VAPPTEMPLATE_XML +";version=1.0"))
.build();
protected HttpRequest version1_0GetOVFForVAppTemplateRequest = HttpRequest.builder().method("GET").endpoint( protected HttpRequest version1_0GetOVFForVAppTemplateRequest = HttpRequest.builder().method("GET").endpoint(
URI.create(ENDPOINT + "/v1.0/vAppTemplate/" + templateId + "/ovf")) URI.create(ENDPOINT + "/v1.0/vAppTemplate/" + templateId + "/ovf"))
.headers(ImmutableMultimap.<String, String> builder() .headers(ImmutableMultimap.<String, String> builder()
@ -141,6 +145,10 @@ public abstract class BaseVCloudComputeServiceExpectTest extends BaseRestClientE
.message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/ovf-ubuntu64.xml", MediaType.TEXT_XML +";version=1.0")) .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/ovf-ubuntu64.xml", MediaType.TEXT_XML +";version=1.0"))
.build(); .build();
protected HttpResponse successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithMultipleVMs = HttpResponse.builder().statusCode(200)
.message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/ovf-multi-vm.xml", MediaType.TEXT_XML +";version=1.0"))
.build();
public BaseVCloudComputeServiceExpectTest() { public BaseVCloudComputeServiceExpectTest() {
provider = "vcloud"; provider = "vcloud";
} }

View File

@ -0,0 +1,74 @@
package org.jclouds.vcloud.compute.strategy;
import static org.testng.Assert.assertEquals;
import java.net.URI;
import java.util.Collections;
import org.jclouds.compute.ComputeService;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse;
import org.jclouds.vcloud.compute.BaseVCloudComputeServiceExpectTest;
import org.jclouds.vcloud.domain.VAppTemplate;
import org.testng.annotations.Test;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
public class VCloudComputeServiceAdapterTest extends BaseVCloudComputeServiceExpectTest {
@Test
public void testListHardwareProfiles() throws Exception {
ComputeService compute = requestsSendResponses(ImmutableMap.<HttpRequest, HttpResponse> builder()
.put(versionsRequest, versionsResponseFromVCD1_5)
.put(version1_0LoginRequest, successfulVersion1_0LoginResponseFromVCD1_5WithSingleOrg)
.put(version1_0GetOrgRequest, successfulVersion1_0GetOrgResponseFromVCD1_5WithSingleTasksListVDCAndNetwork)
.put(version1_0GetCatalogRequest, successfulVersion1_0GetCatalogResponseFromVCD1_5WithSingleTemplate)
.put(version1_0GetCatalogItemRequest, successfulVersion1_0GetCatalogItemResponseFromVCD1_5ForTemplate)
.put(version1_0GetVDCRequest, successfulVersion1_0GetVDCResponseFromVCD1_5WithSingleTemplateAndNetwork)
.put(version1_0GetVAppTemplateRequest, successfulVersion1_0GetVAppTemplateResponseFromVCD1_5WithSingleVMAndVDCParent)
.put(version1_0GetOVFForVAppTemplateRequest, successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithSingleVM)
.build());
VCloudComputeServiceAdapter adapter = compute.getContext()
.utils().injector().getInstance(VCloudComputeServiceAdapter.class);
Iterable<VAppTemplate> hardwareProfiles = adapter.listHardwareProfiles();
Iterable<URI> hardwareProfileRefs = Iterables.transform(ImmutableList.copyOf(hardwareProfiles), new Function<VAppTemplate,URI>() {
@Override public URI apply(VAppTemplate input) {
return input.getHref();
}
});
assertEquals(ImmutableSet.copyOf(hardwareProfileRefs), ImmutableSet.of(URI.create("https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728")));
}
/**
* For issue 994. In BaseEnvelopeHandler when it encounters VirtualSystemCollection, it throws IllegalArgumentException
* (cannot currently create envelopes with multiple virtual systems).
* Thus we do not include the VM in the supported set, but we do return without propagating the exception.
*/
@Test
public void testListHardwareProfilesWithUnsupportedTemplate() throws Exception {
ComputeService compute = requestsSendResponses(ImmutableMap.<HttpRequest, HttpResponse> builder()
.put(versionsRequest, versionsResponseFromVCD1_5)
.put(version1_0LoginRequest, successfulVersion1_0LoginResponseFromVCD1_5WithSingleOrg)
.put(version1_0GetOrgRequest, successfulVersion1_0GetOrgResponseFromVCD1_5WithSingleTasksListVDCAndNetwork)
.put(version1_0GetCatalogRequest, successfulVersion1_0GetCatalogResponseFromVCD1_5WithSingleTemplate)
.put(version1_0GetCatalogItemRequest, successfulVersion1_0GetCatalogItemResponseFromVCD1_5ForTemplate)
.put(version1_0GetVDCRequest, successfulVersion1_0GetVDCResponseFromVCD1_5WithSingleTemplateAndNetwork)
.put(version1_0GetVAppTemplateRequest, successfulVersion1_0GetVAppTemplateResponseFromVCD1_5WithMultipleVMsAndVDCParent)
.put(version1_0GetOVFForVAppTemplateRequest, successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithMultipleVMs)
.build());
VCloudComputeServiceAdapter adapter = compute.getContext()
.utils().injector().getInstance(VCloudComputeServiceAdapter.class);
Iterable<VAppTemplate> hardwareProfiles = adapter.listHardwareProfiles();
assertEquals(ImmutableSet.copyOf(hardwareProfiles), Collections.emptySet());
}
}

View File

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="UTF-8"?>
<ovf:Envelope xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vcloud="http://www.vmware.com/vcloud/v1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd http://www.vmware.com/vcloud/v1 http://zone.myvcloud.com/api/v1.0/schema/master.xsd">
<ovf:References/>
<ovf:NetworkSection>
<ovf:Info>The list of logical networks</ovf:Info>
<ovf:Network ovf:name="vapp net">
<ovf:Description/>
</ovf:Network>
</ovf:NetworkSection>
<vcloud:NetworkConfigSection ovf:required="false">
<ovf:Info>The configuration parameters for logical networks</ovf:Info>
<vcloud:NetworkConfig networkName="vapp net">
<vcloud:Description/>
<vcloud:Configuration>
<vcloud:IpScope>
<vcloud:IsInherited>false</vcloud:IsInherited>
<vcloud:Gateway>192.168.2.1</vcloud:Gateway>
<vcloud:Netmask>255.255.255.0</vcloud:Netmask>
<vcloud:Dns1>195.225.219.131</vcloud:Dns1>
<vcloud:IpRanges>
<vcloud:IpRange>
<vcloud:StartAddress>192.168.2.100</vcloud:StartAddress>
<vcloud:EndAddress>192.168.2.199</vcloud:EndAddress>
</vcloud:IpRange>
</vcloud:IpRanges>
</vcloud:IpScope>
<vcloud:FenceMode>isolated</vcloud:FenceMode>
<vcloud:Features>
<vcloud:DhcpService>
<vcloud:IsEnabled>false</vcloud:IsEnabled>
<vcloud:DefaultLeaseTime>7200</vcloud:DefaultLeaseTime>
<vcloud:MaxLeaseTime>7200</vcloud:MaxLeaseTime>
<vcloud:IpRange/>
</vcloud:DhcpService>
</vcloud:Features>
</vcloud:Configuration>
<vcloud:IsDeployed>false</vcloud:IsDeployed>
</vcloud:NetworkConfig>
</vcloud:NetworkConfigSection>
<vcloud:LeaseSettingsSection ovf:required="false">
<ovf:Info>Lease settings section</ovf:Info>
<vcloud:DeploymentLeaseInSeconds>0</vcloud:DeploymentLeaseInSeconds>
<vcloud:StorageLeaseInSeconds>0</vcloud:StorageLeaseInSeconds>
</vcloud:LeaseSettingsSection>
<vcloud:CustomizationSection ovf:required="false">
<ovf:Info>VApp template customization section</ovf:Info>
<vcloud:CustomizeOnInstantiate>true</vcloud:CustomizeOnInstantiate>
</vcloud:CustomizationSection>
<ovf:VirtualSystemCollection ovf:id="centos-web/db-5.5">
<ovf:Info>A collection of virtual machines: </ovf:Info>
<ovf:Name>centos-web/db-5.5</ovf:Name>
<ovf:StartupSection>
<ovf:Info>VApp startup section</ovf:Info>
<ovf:Item ovf:stopDelay="0" ovf:stopAction="powerOff" ovf:startDelay="0" ovf:startAction="powerOn" ovf:order="0" ovf:id="centos-web"/>
<ovf:Item ovf:stopDelay="0" ovf:stopAction="powerOff" ovf:startDelay="0" ovf:startAction="powerOn" ovf:order="0" ovf:id="centos-db"/>
</ovf:StartupSection>
<ovf:VirtualSystem ovf:id="centos-db">
<ovf:Info>A virtual machine: </ovf:Info>
<ovf:Name>centos-db</ovf:Name>
<ovf:OperatingSystemSection xmlns:vmw="http://www.vmware.com/schema/ovf" ovf:id="100" vmw:osType="other26xLinux64Guest">
<ovf:Info>Specifies the operating system installed</ovf:Info>
<ovf:Description>Other 2.6x Linux (64-bit)</ovf:Description>
</ovf:OperatingSystemSection>
<ovf:VirtualHardwareSection>
<ovf:Info>Virtual hardware requirements</ovf:Info>
<ovf:System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>centos-db</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
</ovf:System>
<ovf:Item>
<rasd:Address>00:50:56:01:06:81</rasd:Address>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Connection vcloud:ipAddress="192.168.2.100" vcloud:primaryNetworkConnection="true" vcloud:ipAddressingMode="POOL">vapp net</rasd:Connection>
<rasd:Description>PCNet32 ethernet adapter</rasd:Description>
<rasd:ElementName>Network adapter 0</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceSubType>PCNet32</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSI Controller 0</rasd:ElementName>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Description>Hard disk</rasd:Description>
<rasd:ElementName>Hard disk 1</rasd:ElementName>
<rasd:HostResource vcloud:capacity="8192" vcloud:busType="6" vcloud:busSubType="lsilogic"/>
<rasd:InstanceID>2000</rasd:InstanceID>
<rasd:Parent>2</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>IDE Controller 0</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Description>CD/DVD Drive</rasd:Description>
<rasd:ElementName>CD/DVD Drive 1</rasd:ElementName>
<rasd:HostResource/>
<rasd:InstanceID>3000</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>15</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Description>Floppy Drive</rasd:Description>
<rasd:ElementName>Floppy Drive 1</rasd:ElementName>
<rasd:HostResource/>
<rasd:InstanceID>8000</rasd:InstanceID>
<rasd:ResourceType>14</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:Reservation>0</rasd:Reservation>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>1</rasd:VirtualQuantity>
<rasd:Weight>0</rasd:Weight>
</ovf:Item>
<ovf:Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Description>Memory Size</rasd:Description>
<rasd:ElementName>2048 MB of memory</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:Reservation>0</rasd:Reservation>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>2048</rasd:VirtualQuantity>
<rasd:Weight>0</rasd:Weight>
</ovf:Item>
</ovf:VirtualHardwareSection>
<vcloud:NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<vcloud:PrimaryNetworkConnectionIndex>0</vcloud:PrimaryNetworkConnectionIndex>
<vcloud:NetworkConnection network="vapp net">
<vcloud:NetworkConnectionIndex>0</vcloud:NetworkConnectionIndex>
<vcloud:IpAddress>192.168.2.100</vcloud:IpAddress>
<vcloud:IsConnected>true</vcloud:IsConnected>
<vcloud:MACAddress>00:50:56:01:06:81</vcloud:MACAddress>
<vcloud:IpAddressAllocationMode>POOL</vcloud:IpAddressAllocationMode>
</vcloud:NetworkConnection>
</vcloud:NetworkConnectionSection>
<vcloud:GuestCustomizationSection ovf:required="false">
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<vcloud:Enabled>true</vcloud:Enabled>
<vcloud:ChangeSid>false</vcloud:ChangeSid>
<vcloud:JoinDomainEnabled>false</vcloud:JoinDomainEnabled>
<vcloud:UseOrgSettings>false</vcloud:UseOrgSettings>
<vcloud:AdminPasswordEnabled>false</vcloud:AdminPasswordEnabled>
<vcloud:AdminPasswordAuto>true</vcloud:AdminPasswordAuto>
<vcloud:ResetPasswordRequired>false</vcloud:ResetPasswordRequired>
<vcloud:ComputerName>centos-db</vcloud:ComputerName>
</vcloud:GuestCustomizationSection>
</ovf:VirtualSystem>
<ovf:VirtualSystem ovf:id="centos-web">
<ovf:Info>A virtual machine: </ovf:Info>
<ovf:Name>centos-web</ovf:Name>
<ovf:OperatingSystemSection xmlns:vmw="http://www.vmware.com/schema/ovf" ovf:id="100" vmw:osType="other26xLinux64Guest">
<ovf:Info>Specifies the operating system installed</ovf:Info>
<ovf:Description>Other 2.6x Linux (64-bit)</ovf:Description>
</ovf:OperatingSystemSection>
<ovf:VirtualHardwareSection>
<ovf:Info>Virtual hardware requirements</ovf:Info>
<ovf:System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>centos-web</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
</ovf:System>
<ovf:Item>
<rasd:Address>00:50:56:01:06:82</rasd:Address> <rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Connection vcloud:ipAddress="192.168.2.101" vcloud:primaryNetworkConnection="true" vcloud:ipAddressingMode="POOL">vapp net</rasd:Connection>
<rasd:Description>PCNet32 ethernet adapter</rasd:Description>
<rasd:ElementName>Network adapter 0</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceSubType>PCNet32</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSI Controller 0</rasd:ElementName>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Description>Hard disk</rasd:Description>
<rasd:ElementName>Hard disk 1</rasd:ElementName>
<rasd:HostResource vcloud:capacity="8192" vcloud:busType="6" vcloud:busSubType="lsilogic"/>
<rasd:InstanceID>2000</rasd:InstanceID>
<rasd:Parent>2</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>IDE Controller 0</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Description>CD/DVD Drive</rasd:Description>
<rasd:ElementName>CD/DVD Drive 1</rasd:ElementName>
<rasd:HostResource/>
<rasd:InstanceID>3000</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>15</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Description>Floppy Drive</rasd:Description>
<rasd:ElementName>Floppy Drive 1</rasd:ElementName>
<rasd:HostResource/>
<rasd:InstanceID>8000</rasd:InstanceID>
<rasd:ResourceType>14</rasd:ResourceType>
</ovf:Item>
<ovf:Item>
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:Reservation>0</rasd:Reservation>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>1</rasd:VirtualQuantity>
<rasd:Weight>0</rasd:Weight>
</ovf:Item>
<ovf:Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Description>Memory Size</rasd:Description>
<rasd:ElementName>2048 MB of memory</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:Reservation>0</rasd:Reservation>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>2048</rasd:VirtualQuantity>
<rasd:Weight>0</rasd:Weight>
</ovf:Item>
</ovf:VirtualHardwareSection>
<vcloud:NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<vcloud:PrimaryNetworkConnectionIndex>0</vcloud:PrimaryNetworkConnectionIndex>
<vcloud:NetworkConnection network="vapp net">
<vcloud:NetworkConnectionIndex>0</vcloud:NetworkConnectionIndex>
<vcloud:IpAddress>192.168.2.101</vcloud:IpAddress>
<vcloud:IsConnected>true</vcloud:IsConnected>
<vcloud:MACAddress>00:50:56:01:06:82</vcloud:MACAddress>
<vcloud:IpAddressAllocationMode>POOL</vcloud:IpAddressAllocationMode>
</vcloud:NetworkConnection>
</vcloud:NetworkConnectionSection>
<vcloud:GuestCustomizationSection ovf:required="false">
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<vcloud:Enabled>true</vcloud:Enabled>
<vcloud:ChangeSid>false</vcloud:ChangeSid>
<vcloud:JoinDomainEnabled>false</vcloud:JoinDomainEnabled>
<vcloud:UseOrgSettings>false</vcloud:UseOrgSettings>
<vcloud:AdminPasswordEnabled>false</vcloud:AdminPasswordEnabled>
<vcloud:AdminPasswordAuto>true</vcloud:AdminPasswordAuto>
<vcloud:ResetPasswordRequired>false</vcloud:ResetPasswordRequired>
<vcloud:ComputerName>centos-web</vcloud:ComputerName>
</vcloud:GuestCustomizationSection>
</ovf:VirtualSystem>
</ovf:VirtualSystemCollection>
</ovf:Envelope>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<VAppTemplate xmlns="http://www.vmware.com/vcloud/v1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" ovfDescriptorUploaded="true" status="8" name="Windows Server 2008 R2" type="application/vnd.vmware.vcloud.vAppTemplate+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1 http://zone.myvcloud.com/api/v1.0/schema/master.xsd">
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml" href="https://zone.myvcloud.com/api/v1.0/vdc/cf6a0068-b7c4-425c-9e80-46ffef58782a"/>
<Link rel="catalogItem" type="application/vnd.vmware.vcloud.catalogItem+xml" href="https://zone.myvcloud.com/api/v1.0/catalogItem/9c45dbbd-910d-45c8-a811-d1e0b01e9e82"/>
<Link rel="remove" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728"/>
<Link rel="edit" type="application/vnd.vmware.vcloud.vAppTemplate+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728"/>
<Link rel="enable" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/action/enableDownload"/>
<Link rel="disable" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/action/disableDownload"/>
<Link rel="ovf" type="text/xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/ovf"/>
<Link rel="down" type="application/vnd.vmware.vcloud.owner+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/owner"/>
<Description/>
<Children>
<Vm name="Windows Server 2008 R2" type="application/vnd.vmware.vcloud.vm+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vm-24fc1b05-10f7-423e-a644-fd3368f9d0cd">
<Link rel="up" type="application/vnd.vmware.vcloud.vAppTemplate+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728"/>
<Description/>
<NetworkConnectionSection type="application/vnd.vmware.vcloud.networkConnectionSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vm-24fc1b05-10f7-423e-a644-fd3368f9d0cd/networkConnectionSection/" ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="none">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IsConnected>false</IsConnected>
<MACAddress>00:50:56:b5:09:dc</MACAddress>
<IpAddressAllocationMode>NONE</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
<GuestCustomizationSection type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vm-24fc1b05-10f7-423e-a644-fd3368f9d0cd/guestCustomizationSection/" ovf:required="false">
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<Enabled>true</Enabled>
<ChangeSid>false</ChangeSid>
<JoinDomainEnabled>false</JoinDomainEnabled>
<UseOrgSettings>false</UseOrgSettings>
<AdminPasswordEnabled>true</AdminPasswordEnabled>
<AdminPasswordAuto>true</AdminPasswordAuto>
<ResetPasswordRequired>true</ResetPasswordRequired> <ComputerName>WindowsServ-001</ComputerName>
</GuestCustomizationSection>
<VAppScopedLocalId>Windows Server 2008 R2</VAppScopedLocalId>
</Vm>
</Children>
<ovf:NetworkSection xmlns:vcloud="http://www.vmware.com/vcloud/v1" vcloud:href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/networkSection/" vcloud:type="application/vnd.vmware.vcloud.networkSection+xml"> <ovf:Info>The list of logical networks</ovf:Info>
<ovf:Network ovf:name="none">
<ovf:Description>This is a special place-holder used for disconnected network interfaces.</ovf:Description>
</ovf:Network> </ovf:NetworkSection>
<NetworkConfigSection type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/networkConfigSection/" ovf:required="false">
<ovf:Info>The configuration parameters for logical networks</ovf:Info>
<NetworkConfig networkName="none">
<Description>This is a special place-holder used for disconnected network interfaces.</Description>
<Configuration>
<IpScope>
<IsInherited>false</IsInherited>
<Gateway>196.254.254.254</Gateway>
<Netmask>255.255.0.0</Netmask>
<Dns1>196.254.254.254</Dns1>
</IpScope>
<FenceMode>isolated</FenceMode>
</Configuration>
<IsDeployed>false</IsDeployed>
</NetworkConfig>
</NetworkConfigSection>
<LeaseSettingsSection type="application/vnd.vmware.vcloud.leaseSettingsSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/leaseSettingsSection/" ovf:required="false">
<ovf:Info>Lease settings section</ovf:Info> <Link rel="edit" type="application/vnd.vmware.vcloud.leaseSettingsSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/leaseSettingsSection/"/>
<StorageLeaseInSeconds>0</StorageLeaseInSeconds>
</LeaseSettingsSection>
<CustomizationSection type="application/vnd.vmware.vcloud.customizationSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/customizationSection/" ovf:required="false">
<ovf:Info>VApp template customization section</ovf:Info>
<CustomizeOnInstantiate>true</CustomizeOnInstantiate>
<Link rel="edit" type="application/vnd.vmware.vcloud.customizationSection+xml" href="https://zone.myvcloud.com/api/v1.0/vAppTemplate/vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728/customizationSection/"/>
</CustomizationSection>
</VAppTemplate>