Skip to content

Instantly share code, notes, and snippets.

@nvazquez
Created February 17, 2022 11:07
Show Gist options
  • Save nvazquez/c1b1de2a2766a24feed4169b14269cb7 to your computer and use it in GitHub Desktop.
Save nvazquez/c1b1de2a2766a24feed4169b14269cb7 to your computer and use it in GitHub Desktop.
Deploy as is investigation
// AVOIDING CONNECTION TO VSPHERE FOR SIMPLICITY
// vCenter Server OVA related - not OVF
InstallStub installStub = new InstallStub();
InstallTypes.InstallSpec installSpec = installStub.get();
installSpec.getVcsaEmbedded().getStandalone().get
// Check documentation: https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/api/vcenter/deployment/install/get/
OvfInfo ovfInfo;
List<LocalizableMessage> messages = ovfInfo.getMessages();
for (LocalizableMessage message : messages) {
String defaultMessage = message.getDefaultMessage();
List<String> args = message.getArgs();
String id = message.getId();
Map<String, LocalizationParam> params = message.getParams();
}
OvfTemplate ovfTemplate;
boolean isVappTemplate = ovfTemplate.getIsVappTemplate();
VmTemplate vmTemplate = ovfTemplate.getVmTemplate();
VAppTemplate vappTemplate = ovfTemplate.getVappTemplate();
// https://vmware.github.io/vsphere-automation-sdk-java/vsphere/7.0.2.0/vsphereautomation-client-sdk/
// NICE - CAN EASILY BE RETRIEVED
List<Nic> nics = vmTemplate.getNics();
String osDescription = vmTemplate.getOsDescription();
String osType = vmTemplate.getOsType();
// HOW TO DEPLOY OVF?
OvfFactory factory;
LibraryItem libraryItem = factory.libraryItemService();
libraryItem.create();
libraryItem.deploy()
//https://vmware.github.io/vsphere-automation-sdk-java/vsphere/7.0.2.0/vsphereautomation-client-sdk/com/vmware/vcenter/ovf/LibraryItem.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment