}
public static boolean isFeatureLicensed(VmwareHypervisorHost hyperHost, String featureKey) throws Exception {
boolean hotplugSupportedByLicense = false;
String licenseName;
LicenseAssignmentManagerMO licenseAssignmentMgrMo;
licenseAssignmentMgrMo = hyperHost.getLicenseAssignmentManager();
// Check if license supports the feature
hotplugSupportedByLicense = licenseAssignmentMgrMo.isFeatureSupported(featureKey, hyperHost.getMor());
// Fetch license name
licenseName = licenseAssignmentMgrMo.getHostLicenseName(hyperHost.getMor());
if (!hotplugSupportedByLicense) {
throw new Exception("hotplug feature is not supported by license : [" + licenseName + "] assigned to host : " + hyperHost.getHyperHostName());
}