Skip to content

Instances

An instance is a virtual machine (VM) that runs inside ScienceCloud.

When you start a new instance, it is never automatically deleted. We kindly ask you to delete the instance when it is no longer needed to free up system resources for other users.

Instance creation and setup

To start an instance, you have to choose:

  • a VM name
  • an image
  • a flavor
  • (optional) a key pair (if you have only one it will be preselected by the system)
  • (optional) a network

We define quotas on a per-project basis, and you check whether you are under quota on the web interface when you try to start a new instance. However, being within your quota does not guarantee access, as it might be possible that during peak periods ScienceCloud will not have enough resources to start your instance even though you are well under your quota. Contact Science IT to request an increase in your quota.

Upload ssh keys

Like most Infrastructure-as-a-Service (IaaS) platforms, ScienceCloud users are required to upload their ssh public key before creating an instance. This key is injected into instances at launch, enabling secure access via ssh.

You can upload the ssh public key to the ScienceCloud by using the following steps:

  1. Log in to ScienceCloud Web Interface: https://cloud.science-it.uzh.ch
  2. Go to Compute → Key Pairs, which shows the key pairs that are available for this project.
  3. Select Import Public Key and choose a Key Pair Name to identify what public key you will import.
  4. Select SSH key as Key Type.
  5. Paste the content of your ssh public key in the Public Key text section.

When creating an instance, you must select a key pair - either by uploading an existing ssh public key or generating a new one. Instructions for creating a new ssh key are available here.

Launch / Create instance

Hint

Before starting, check that your desired image and flavor are available.
- See the supported images list.
- Check the flavor availability report.

  • In the ScienceCloud web interface, go to Project → Compute → Instances.
  • At the top of the instance list, click Launch Instance.
  • In the Launch Instance dialog, fill in the following, clicking Next to continue through the configuration settings:
    • Details: Assign an instance name to your virtual machine. You may optionally also give an Instance Description. Under most circumstances, leave Instance Count at 1, unless you need multiple instances.
    • Source: Select Image for a public or private image. To create an instance from a snapshot, select Instance Snapshot. Leave Create New Volume as No under most circumstances.
      • From the list of Available images, choose one by clicking on the arrow. See here for a list of available public images.
    • Flavor: Choose the CPU, RAM and optional GPU from the Flavor list. Please note that all possible flavors are shown here, and if that hardware configuration is at capacity, the instance will show an Error state.
    • Networks: Add at least the uzh-only network by clicking the arrow button to the right. For more info, see Networks.
    • Security Groups: For ssh and ping access, projects are pre-configured with default security group, which should be added here under normal circumstances. You can add other security groups that modify firewall rules to your instance either now or later.
    • Key Pair: Ensure your ssh key pair is selected so you can log in.
  • Click Launch Instance.
  • Wait for the task to complete. Your instance will appear in the list with status Active.

Instance launch error: unavailable flavor

If your instance enters an "error" state during launch - such as with the message "No valid host was found" - it may be due to the selected flavor being unavailable in ScienceCloud. Please consult the near-real-time ScienceCloud Flavor Availability Report (internal network or VPN required). If the flavor is unavailable, delete the failed instance and retry with an available flavor. For persistent issues, contact us.

Create Windows VMs

For detailed instructions, please refer to the article How to create Windows VMs.

Access and connectivity

Access an instance

Instances, also called virtual machines, are normally installed with pre-built images running Linux, and generally accessed with ssh from the command line. ssh keys allow passwordless login and may be added to the instance when it is created, or at a later date by another user who has access.

For detailed instructions on how to connect to an instance, please refer to our ssh guide, or to the relevant Training Handout section.

Instance management

Lock instance to protect against accidental deletion

You can prevent accidental deletion by locking your instance. To do this from the ScienceCloud Web Interface, use the drop-down menu on the right side of your instance's information panel and select Lock Instance. Locking an instance restricts not only deletion but also actions such as rebooting, attaching or detaching volumes, resizing, and changing the instance state.

Hint

If you try an action that is not allowed on a locked instance, the error message is generic, for example unable to delete. If your instance is locked, you'll see a 🔒 in the web interface. To modify your instance, select Unlock before proceeding with care.

Resize instance

Resizing an instance allows you to change the hardware flavor of an existing instance, while preserving the instance's content.

Important

A resize will reboot the instance to complete. Make sure any changes to files on your instance are saved before doing a resize.

Resizing may be helpful in several cases, for example:

  • You realize that the number of vCPUs and RAM of your instance is not sufficient
  • You have launched an instance using a flavor with a high number of vCPUs and RAM, but your code can't use all the hardware resources
  • You want to change the vCPU type of your instance

Step-by-step guide

Hint

Before starting, ensure your desired flavor is available by viewing the flavor availability report.

  • In the ScienceCloud Web Interface, go to Project → Compute → Instances.
  • Find your instance in the list.
  • In the Actions column, click the dropdown menu (next to Create Snapshot).
  • Select Resize Instance.
  • In the resize dialog:
    • Choose a new Flavor (CPU/RAM/disk configuration). If you've chosen a flavor that is not available, the process will exit without any changes.
    • Click Resize.
  • Wait for the resize task to complete (instance status changes).
  • Once done, you’ll need to Confirm Resize:
    • If the new flavor works as expected, click Confirm Resize.
    • If there’s an issue, click Revert Resize to return to the original size.

Hint

If you haven't set up an automount of a volume, you will need to mount it again manually after resizing an instance, due to the reboot.

Soft reboot vs. hard reboot

You can perform a soft or hard reboot on a running instance.

A soft reboot attempts a graceful shutdown and restart by signaling the operating system to reboot cleanly. It is equivalent to pressing Ctrl+Alt+Del on a physical machine or running the command shutdown -r now. However, if the system is unresponsive, a soft reboot may fail.

A hard reboot forcibly powers down the instance, effectively resetting the server’s power. Hard reboots may cause issues such as filesystem corruption and should be used only as a last resort when a soft reboot is unsuccessful.

For more details, refer to the official documentation:

📘 Reboot an Instance - OpenStack documentation

Shut off instance

This action powers off the instance. While the instance is shut off, it is not running but still incurs costs as the hardware is reserved. To stop charges completely, the instance must be deleted.

Additional instance states

OpenStack provides additional functionality for managing instances, including options such as pause, suspend, and shelve.

Warning

We advise against using these actions due to potential issues when bringing the instance back online.

  • Pause Instance: Temporarily pauses the instance and saves its state in memory. This action preserves resource allocation (vCPUs and memory). It is generally fast but is not persistent across hypervisor reboots. A paused instance still incurs costs as the hardware is reserved.

  • Suspend Instance: Saves the instance state to disk on the current hypervisor and stops the instance. Resources (vCPUs and memory) remain allocated and therefore the instance still incurs costs. This action is prone to failure, especially for instances with large memory footprints, as the hypervisor’s local disk often lacks sufficient space to store the suspended state.

  • Shelve Instance: Stops the instance and deallocates compute resources (vCPUs and memory). The instance is removed from the hypervisor and its disk image is stored as an image. Shelved instances can be unshelved later and may come back on a different hypervisor.

Instance lifecycle management

Create snapshot

Snapshots are a saved instance state. These snapshots are disk-only snapshots and are suggested for regular backups of instances.

To create a snapshot:

  1. Click Shut Off Instance (recommended).
  2. Click Create Snapshot.

The new snapshot is displayed in the Images.

For further actions with snapshots - such as sharing, downloading, or troubleshooting common issues - refer to the section Snapshots and Images.

Rebuild an instance

Danger

When you rebuild an instance, its root disk and all software and data are permanently deleted.

The Rebuild action in OpenStack reinstalls the operating system on an existing instance using the original or a new image. It preserves the instance’s metadata (such as name, IP address, and attached volumes) but wipes the root disk. This is useful for recovering from system corruption while keeping the same instance configuration.

Delete an instance

Danger

When you delete an instance, its root disk and all software and data are permanently deleted.

To avoid data loss, please consider the following:

  • Save important data elsewhere (e.g., on your laptop, on an external hard drive, or on a NAS).
  • Use a storage volume to store persistent data. A storage volume can be exchanged between instances and data recovered if the instance operating system becomes corrupt.
  • Create an instance snapshot before deleting.

Customization and configuration

Share access to instance

Other uses can access the same instance if you add their public ssh key to the ~/.ssh/authorized_keys file. For detailed instructions, please see here.

Update and upgrade

Below are the steps to install a new software package or upgrade existing software packages on a Debian/Ubuntu system.

  • To update the list of packages known to your system, run:

    sudo apt update
    
  • To upgrade all currently installed packages (without adding or removing packages), run:

    sudo apt upgrade
    

    Hint

    During the upgrade process, you may be prompted to make decisions — such as whether to keep or replace locally modified configuration files. In most cases, it is safe to choose the default option, typically to keep the local file.

    To automatically accept default choices and avoid interruptions, add the -y flag:

    sudo apt upgrade -y
    
  • If you're unsure of the exact package name or version, search the repository first:

    apt-cache search <package_name>
    
  • To install a package (e.g., r-base) and all its dependencies on Ubuntu, use:

    sudo apt install r-base
    
  • To remove the package from your system, run:

    sudo apt remove r-base
    

Set CET/Zurich local time on an instance

Most Ubuntu and Debian servers use UTC as default. You can check your system clock by running the date command and checking if UTC is printed.

On Ubuntu or Debian servers, you can change the timezone to Europe/Zurich by running:

sudo dpkg-reconfigure tzdata

A dialog window will appear, allowing you to select your preferred timezone. A system restart is recommended after setting the local timezone.

To verify that the change was successful, re-run the date command.

Custom software installation

For more information, see the related articles covering R, MATLAB, Gaussian, Apache Hadoop/Spark with Swift, and Docker Compose.