Accessing a VM

Assuming you have created a VM (and associated boot Disk, external gateway, and public IP, as well as desired storage Disks) you will likely want to access it.

Configuring a VM for SSH access

You can configure SSH access to a VM by adding SSH authorized keys (the public parts of SSH keys) to the VM specification.

Note: SSH authorized keys must be configured before the first boot, as such they can only be set on VM creation, and cannot be added later as part of an update.

These keys will be provisioned to the evroc-user account, with the public keys being added to the ~/.ssh/authorized_keys file on the VM for default evroc-user user.

You can use an existing public and private key pair, or you can create one from any linux terminal. For creating one, follow the instructions at generating a new SSH key. This will generate a private key (which will be used when you access the VM over SSH) and a public key beginning "ssh-rsa ...", This public key can then be used when constructing your resource definition below.

The supported public key types for the authorized keys are:

  • rsa
  • ecdsa
  • ed25519
  • ecdsa-sha2-nistp256-cert-v01@openssh.com
  • ecdsa-sha2-nistp256
  • ecdsa-sha2-nistp384-cert-v01@openssh.com
  • ecdsa-sha2-nistp384
  • ecdsa-sha2-nistp521-cert-v01@openssh.com
  • ecdsa-sha2-nistp521
  • sk-ecdsa-sha2-nistp256-cert-v01@openssh.com
  • sk-ecdsa-sha2-nistp256@openssh.com
  • sk-ssh-ed25519-cert-v01@openssh.com
  • sk-ssh-ed25519@openssh.com
  • ssh-ed25519-cert-v01@openssh.com
  • ssh-ed25519
  • ssh-rsa-cert-v01@openssh.com
  • ssh-rsa
  • ssh-xmss-cert-v01@openssh.com
  • ssh-xmss@openssh.com

Note: rsa, ecdsa and ed25519 are added for legacy, as they are valid public keys in some older distros.

Accessing VMs via SSH in evroc's Cloud

  1. Determine the public IP of the VM. You must determine that the VM is both running and has a public IP assigned. This can be accomplished using the console, API, or CLI:
$ kubectl get evvm -n customer-test
NAME   READY   REASON   VIRTUALMACHINESTATUS   IP          PUBLIC IP
myvm   True    Ready    Running                10.0.0.2    203.0.113.10

$ evroc compute vm list
 Name    Ready   Reason   VirtualMachineStatus   IP         Public IP
 ------- ------- -------- ---------------------- ---------- --------------
 my-vm   True    Ready    Running                10.0.0.2   203.0.113.10
  1. Access the VM using ssh. Using the private key corresponding to the public key added to the VM, execute the following command:
$ ssh -i /path/to/privatekey evroc-user@<Public IP>
###########################################
# This server is running on evroc's cloud #
###########################################
>

Note: If you did not specify custom cloud-init, then your user will be called "evroc-user"

You should see a prompt mentioning that the VM you have successfully connected to the VM via SSH saying it is on evroc's cloud.

If your SSH command fails for any reason, follow the SSH troubleshooting guide.

Next steps

VMs created in evroc's cloud are minimally configured and may require additional setup such as installing required packages before further provisioning. Users can utilise tools such as Ansible to automate this. Users can use custom cloud init to enable additional provisioning during boot. See the docs for more information.