Compute Engine lets you install SQL Server on Linux and Windows VMs and use pay-as-you-go (PAYG) licenses. This document describes how to add a SQL Server license to a boot disk.
Billing
After adding a license string to the Linux or Windows VM's boot disk, you are billed according to the pricing of SQL Server images.
Limitations
You can only install SQL Server on the following Linux distributions:
- Red Hat Enterprise Linux (RHEL)
- SUSE Linux Enterprise Server (SLES)
- Ubuntu
You can only append PAYG licenses for the following editions of SQL Server:
- SQL Server Web edition
- SQL Server Standard edition
- SQL Server Enterprise Core edition
VMs must be stopped before you can append licenses.
You cannot append licenses to regional boot disks.
Images and snapshots created from existing boot disks do not inherit any appended licenses.
Add a the SQL Server license
Add a SQL Server license to an existing boot disk using the following procedure:
Identify the license you want to add to a VM. For SQL Server, the license needs to match both the version and edition you want to run. For the list of valid SQL Server license strings, see the License strings tab in the operating system details for SQL Server document.
As an example, in this procedure, we'll add a SQL Server 2022 Enterprise license to an instance.Stop the VM:
gcloud compute instances stop VM_NAME
Replace
VM_NAME
with the name of the VM to stop.Identify the boot disk:
gcloud compute instances describe VM_NAME
Replace
VM_NAME
with the name of the VM.Verify that the output is similar to the following:
disks: - autoDelete: true boot: true deviceName: BOOT_DISK_NAME diskSizeGb: '20' guestOsFeatures: - type: UEFI_COMPATIBLE index: 0 interface: SCSI kind: compute#attachedDisk licenses: - BOOT_DISK_LICENSE_STRING mode: READ_WRITE source: https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/ZONE/disks/BOOT_DISK_NAME type: PERSISTENT
Detach the boot disk:
gcloud compute instances detach-disk VM_NAME --disk=BOOT_DISK_NAME
Replace the following:
VM_NAME
: the name of the VMBOOT_DISK_NAME
: the name of the boot disk
Clone the boot disk and add the additional license:
gcloud compute disks create CLONED_BOOT_DISK_NAME --licenses=https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2022-enterprise --source-disk=BOOT_DISK_NAME --source-disk-zone=BOOT_DISK_ZONE --zone=CLONED_BOOT_DISK_ZONE
Replace the following:
CLONED_BOOT_DISK_NAME
: the name you want to give the cloned book diskBOOT_DISK_NAME
: the name of the source boot disk that you want to cloneBOOT_DISK_ZONE
: the zone of the source boot diskCLONED_BOOT_DISK_ZONE
: the zone in which you want to create the cloned boot disk
Verify that the new disk has the correct license:
gcloud compute disks describe CLONED_BOOT_DISK_NAME --zone=CLONED_BOOT_DISK_ZONE
Replace the following:
CLONED_BOOT_DISK_NAME
: the name of the cloned book diskCLONED_BOOT_DISK_ZONE
: the zone of the cloned boot disk
Attach the new disk as the boot disk for the instance.
gcloud compute instances attach-disk VM_NAME --disk=CLONED_BOOT_DISK_NAME --boot
Replace the following:
VM_NAME
: the name of the VM to which you want to attach the cloned boot diskCLONED_BOOT_DISK_NAME
: the name of the cloned book disk
Verify that the VM's boot disk is the new cloned disk with SQL Server licensing.
gcloud compute instances describe VM_NAME
Replace
VM_NAME
with the name of the VM.Start the instance.
gcloud compute instances start VM_NAME
Replace
VM_NAME
with the name of the VM.(Optional) When you are sure that you might not want to revert back to the old boot disk, you can delete the disk.
gcloud compute disks delete BOOT_DISK_NAME --zone=BOOT_DISK_ZONE
Replace the following:
BOOT_DISK_NAME
: the name of the boot disk that you want to deleteBOOT_DISK_ZONE
: the zone of the boot disk