} else {
hardwareVersion = VcContext.inVcSessionDo(new VcSession<Integer>() {
@Override
protected Integer body() throws Exception {
VirtualMachine vimVm = vcVm.getManagedObject();
EnvironmentBrowser envBrowser =
MoUtil.getManagedObject(vimVm.getEnvironmentBrowser());
ConfigOption configOption =
envBrowser.queryConfigOption(null, null);
int hardwareVersion =
configOption.getHardwareOptions().getHwVersion();
logger.info("hardware version is: " + hardwareVersion);
return hardwareVersion;
}