Tabnine Logo
ManagementService.generateRandomPassword
Code IndexAdd Tabnine to your IDE (free)

How to use
generateRandomPassword
method
in
com.cloud.server.ManagementService

Best Java code snippets using com.cloud.server.ManagementService.generateRandomPassword (Showing top 9 results out of 315)

origin: apache/cloudstack

public String getPassword() {
  if (Strings.isNullOrEmpty(password)) {
    password = _mgr.generateRandomPassword();
  }
  return password;
}
origin: apache/cloudstack

@DB
protected void updateSystemvmPassword() {
  String userid = System.getProperty("user.name");
  if (!userid.startsWith("cloud")) {
    return;
  }
  if (!Boolean.valueOf(_configDao.getValue("system.vm.random.password"))) {
    return;
  }
  String already = _configDao.getValue("system.vm.password");
  if (already == null) {
    TransactionLegacy txn = TransactionLegacy.currentTxn();
    try {
      String rpassword = _mgrService.generateRandomPassword();
      String wSql = "INSERT INTO `cloud`.`configuration` (category, instance, component, name, value, description) "
      + "VALUES ('Secure','DEFAULT', 'management-server','system.vm.password', ?,'randmon password generated each management server starts for system vm')";
      PreparedStatement stmt = txn.prepareAutoCloseStatement(wSql);
      stmt.setString(1, DBEncryptionUtil.encrypt(rpassword));
      stmt.executeUpdate();
      s_logger.info("Updated systemvm password in database");
    } catch (SQLException e) {
      s_logger.error("Cannot retrieve systemvm password", e);
    }
  }
}
origin: apache/cloudstack

  @Override
  public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
    password = _mgr.generateRandomPassword();
    CallContext.current().setEventDetails("Vm Id: "+getId());
    UserVm result = _userVmService.resetVMPassword(this, password);
    if (result != null){
      UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Full, "virtualmachine", result).get(0);
      response.setResponseName(getCommandName());
      setResponseObject(response);
    } else {
      throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reset vm password");
    }
  }
}
origin: apache/cloudstack

  @Override
  public void execute() throws ResourceUnavailableException, InsufficientCapacityException {
    password = _mgr.generateRandomPassword();
    CallContext.current().setEventDetails("Vm Id: " + getId());
    UserVm result = _userVmService.resetVMPassword(this, password);
    if (result != null){
      UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Restricted, "virtualmachine", result).get(0);
      response.setResponseName(getCommandName());
      setResponseObject(response);
    } else {
      throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reset vm password");
    }
  }
}
origin: apache/cloudstack

  password = DBEncryptionUtil.decrypt(vm.getDetail("password"));
} else {
  password = _mgr.generateRandomPassword();
  vm.setPassword(password);
origin: apache/cloudstack

String sshPublicKey = s.getPublicKey();
if (template != null && template.isEnablePassword()) {
  password = _mgr.generateRandomPassword();
origin: apache/cloudstack

password = _mgr.generateRandomPassword();
boolean result = resetVMPasswordInternal(vmId, password);
if (!result) {
origin: MissionCriticalCloud/cosmic

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException {
  password = _mgr.generateRandomPassword();
  CallContext.current().setEventDetails("Vm Id: " + getId());
  final UserVm result = _userVmService.resetVMPassword(this, password);
  if (result != null) {
    final UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Restricted, "virtualmachine", result).get(0);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reset vm password");
  }
}
origin: MissionCriticalCloud/cosmic

  @Override
  public void execute() throws ResourceUnavailableException, InsufficientCapacityException {
    password = _mgr.generateRandomPassword();
    CallContext.current().setEventDetails("Vm Id: " + getId());
    final UserVm result = _userVmService.resetVMPassword(this, password);
    if (result != null) {
      final UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Full, "virtualmachine", result).get(0);
      response.setResponseName(getCommandName());
      setResponseObject(response);
    } else {
      throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reset vm password");
    }
  }
}
com.cloud.serverManagementServicegenerateRandomPassword

Javadoc

Generates a random password that will be used (initially) by newly created and started virtual machines

Popular methods of ManagementService

  • searchForClusters
    Searches for Clusters by the specified search criteria
  • searchForConfigurations
    returns the a map of the names/values in the configuraton table
  • updateHostPassword
  • listDeploymentPlanners
  • searchForVlans
    Searches for vlan by the specified search criteria Can search by: "id", "vlan", "name", "zoneID"
  • addGuestOs
    Adds a new guest OS
  • addGuestOsMapping
    Adds a new guest OS mapping
  • archiveAlerts
    Archive alerts
  • archiveEvents
    Archive events
  • cleanupVMReservations
  • createSSHKeyPair
    Creates a new
  • deleteAlerts
    Delete alerts
  • createSSHKeyPair,
  • deleteAlerts,
  • deleteEvents,
  • deleteSSHKeyPair,
  • destroySystemVM,
  • findSystemVMTypeById,
  • getAddedGuestOs,
  • getAddedGuestOsMapping,
  • getCloudIdentifierResponse

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now