Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The design is similar to the reset password feature, things change in terms of the SSH keypair.
  • User is able to use an existing keypair or a new keypair to reset ssh key
    • Prior to use reset ssh key api, user can create a new keypair or register a keypair by providing publickey.
    • To create a new keypair there is an api createSSHKeyForVirtualMachine=com.cloud.api.commands.CreateSSHKeyPairCmd 
    • To register a new keypair there is an api registerSSHKeyForVirtualMachine=com.cloud.api.commands.ResetSSHKeyPairCmd 
  • User provides the keypair name in reset ssh api
  • During resetting, if the template used by VM is password enabled then Encrypted.Password entry needs to be updated in the DB
    • Since the password is not saved anywhere, a new password is to be generated for the VM, encrypt it with the new public key and update the entry Encrypted.Password.
    • There is no provision to get the password of a VM to encrypt it with new ssh public key. (Since password is transient)
  • Send user data to virtual router for updating the new public key and password as plain text (if password enabled template).
  • If the User VM is in running state, it is rebooted as part of the ssh key reset to update the new ssh public key in VM (cloud-set-guest-sshkey script runs as a init service in VM to get the new ssh public key from virtual router). If the VM is in stopped state, then reset SSH api action won't reboot the VM.

web services APIs

  • resetSSHKeyForVirtualMachine=com.cloud.api.commands.ResetSSHKeyCmd
    • o   Parameters
      • id : The ID of the virtual machine
      • name: name of the ssh keypair
      • account: Account name of owner
      • domainid: Domain ID of owner
    • Response
      • Uservm details (UserVmResponse)
      • name: name of the ssh keypair
      • password: the password (if exists) of the virtual machine

...