}).getId();
String networkTierName = Iterables.get(
restContext.getApi().getBrowsingApi().getVDCInOrg(billingSiteId, vpdcId).getAvailableNetworks(), 0)
.getId();
Network networkTier = restContext.getApi().getBrowsingApi().getNetworkInVDC(billingSiteId, vpdcId,
networkTierName);
String name = prefix;
// delete any old VM
VDC vpdc = restContext.getApi().getBrowsingApi().getVDCInOrg(billingSiteId, vpdcId);
CIMOperatingSystem os = Iterables.find(restContext.getApi().listPredefinedOperatingSystems(),
new Predicate<CIMOperatingSystem>() {
@Override
public boolean apply(CIMOperatingSystem arg0) {
return arg0.getOsType() == OSType.RHEL_64;
}
});
// TODO: Savvis returns network names with a - instead of space on getNetworkInVDC call,
// fix this once savvis api starts returning correctly
System.out.printf("Creating vm's - vpdcId %s, vpdcName %s, networkName %s, name %s, os %s%n", vpdcId, vpdc.getName(), networkTier
.getName().replace("-", " "), name, os);
Builder<VMSpec> vmSpecs = ImmutableSet.builder();
int noOfVms = 2;
for (int i = 0; i < noOfVms; i++) {