Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article explores the pros and cons of using custom images versus formulas as bases for creating new lab virtual machines (VMs) in Azure DevTest Labs. The key distinction between a custom image and a formula is that a custom image is simply an image based on a virtual hard drive (VHD), whereas a formula also includes preconfigured settings.
Preconfigured settings can include VM size, virtual network, subnet, and artifacts. These settings are created with default values that you can override when you create the VM.
Custom images
Custom images are a static, immutable way to create VMs. All VMs created from a single custom image are identical.
VM provisioning from a custom image is fast. The custom image is just an image without settings, so there are no settings to apply.
A drawback of custom images is that to update an aspect of the custom image, you must recreate the image.
Formulas
Formulas provide a dynamic way to create VMs with the configuration and settings you want. Formulas can capture environment changes on the fly by using artifacts.
For example, you can use a formula to create a VM that has the latest bits from your release pipeline, or that enlists the VM with the latest code from your repository. Along with the target base image, the formula specifies an artifact that deploys the bits or enlists the code repository.
When you use the formula to create VMs, the latest bits or code are deployed or enlisted to the VM. For more information about using artifacts for VMs, see Create custom artifacts for DevTest Labs.
Formulas can also define default settings that custom images can't specify, such as VM sizes and virtual network settings. The settings are saved in the formula as default values, which you can change when you create the VM. Because of the added configuration, creating a VM from a formula can take longer than creating a VM from a custom image.