Skip to main content
If you work with custom images, we recommend optimizing them so your boot disks and virtual machines (VMs) work with higher productivity and speed. When you create a VM based on a custom image, this VM doesn’t include some of the settings that a VM based on a public image includes. You can add these settings to your custom-image VM and optimize it. The additional settings aren’t required for every custom image, but we recommend them for at least production-oriented images unless you have workload-specific reasons for not using these settings.

Install the monitoring agent by Nebius AI Cloud

The monitoring agent is installed by default on VMs with public images. If you use a custom image, install the agent to collect and view metrics for the VM. To install the monitoring agent, connect to the VM and then run the following commands:

Collect serial logs

To collect and view serial logs of a VM on a custom image, configure the VM’s GRUB to initialize and use a serial port. GRUB is a boot loader package that boots an operating system and kernel configuration. To configure GRUB for Ubuntu-based disk images:
  1. Connect to the VM.
  2. In the /etc/default/grub file, add the following line:
  3. Update GRUB:
  4. Reboot the VM: disconnect from it, and stop and start it.

Change sysctl settings

Apply the recommended sysctl settings to improve the networking and kernel characteristics of the VM. To do so, connect to the VM and update the following settings in two files:
  • File /etc/sysctl.d/30-network.conf
  • File /etc/sysctl.d/90-kernel.conf

Adjust the virtiofs settings

To speed up reading from volumes and writing to them, adjust the virtiofs settings. Connect to the VM and run the Bash script below. The script increases the read_ahead_kb value to improve the performance of the VM volumes.

Enable failure reporting by using pvpanic

The pvpanic tool allows the guest OS kernel to report panic and crash events to the hypervisor. This helps with failure detection and troubleshooting. To start using pvpanic on Ubuntu, connect to the VM and install the package: