Skip to main content

Running Init Scripts on Launch

When launching a new virtual machine (VM) on our platform, users have the option to run initialization scripts that automate the installation of packages or custom configurations. This process ensures that the necessary environment is set up as soon as the VM is available for use.

Pre-defined Package Selection

At the time of VM creation, users can choose from a list of pre-defined packages that will be installed automatically. This is ideal for users who require commonly used packages and configurations. The common packages we offer are:

  • NVIDIA Cuda Toolkit
  • PyTorch
  • Tensorflow
  • JupyterLab
note

Some of our GPU inventory SKUs come with NVIDIA CUDA Toolkit 12.4 pre-installed, for GPU types such as A16, A40, select A100s, and L40S. If you are using one of these SKUs, you may not need to install the CUDA Toolkit manually, but you can still configure additional packages and settings through custom init scripts.

Custom Scripts

For advanced configurations, users can add their custom initialization scripts. These scripts are executed at the time of the VM launch, allowing for more flexible and personalized setups. Custom scripts can be used to install specific software, apply security settings, or configure network options.

Monitoring Init Script Execution

Even after the VM is marked as Available, the initialization scripts may continue to run in the background. You can monitor the progress of these scripts by running the following command in your terminal:

sudo tail -f /var/log/cloud-init-output.log

This command allows you to follow the logs of the ongoing installation and configuration processes in real-time. It helps ensure that your custom scripts or package installations are executed correctly.

Best Practices

  • Ensure that your custom scripts are well-tested to avoid issues during VM startup.
  • Scripts that include package installations may take time depending on their size, so check the logs to monitor their completion.

By using init scripts, you can automate the setup process, saving time and reducing errors in manual configuration.