// copy hardware version
configSpec.setVersion(template.getConfig().getVersion());
// copy vApp config info
VmConfigInfo configInfo = template.getConfig().getVAppConfig();
// the parent vm might not have vApp option enabled. This is possible when user
// used customized template.
if (configInfo != null) {
VmConfigSpec vAppSpec = new VmConfigSpecImpl();
vAppSpec.setOvfEnvironmentTransport(configInfo
.getOvfEnvironmentTransport());
// product info
List<ProductSpec> productSpecs = new ArrayList<ProductSpec>();
for (ProductInfo info : configInfo.getProduct()) {
ProductSpec spec = new ProductSpecImpl();
spec.setInfo(info);
spec.setOperation(Operation.add);
productSpecs.add(spec);
}