↓ Skip to main content
  1. Posts/

Adding SQL Server PAYG licenses to VMs running in Compute Engine

·235 words·2 mins
Christoph Petersen
Author
Christoph Petersen

When migrating server instances to Google Cloud or installing SQL Server on an existing instance in Google Compute Engine (GCE), you may want to use PAYG licensing. To ensure compliant billing for PAYG, the corresponding SQL Server license string must be attached to the VM’s boot disk.

Compute Engine allows you to append licenses directly to an existing disk without recreating the disk or redeploying the instance.

In the examples below, we will use the sql-server-2025-standard license (https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2025-standard). For a full reference on finding the right licensing strings for your SQL Server version and edition, see Retrieving licensing strings for use with Google Compute Engine.

Before appending a license to a boot disk, the VM instance must be stopped (or the disk must be detached from the running instance). Also note that SQL Server PAYG licenses are not removable from a disk once appended (removableFromDisk: false).

Appending the license using gcloud
#

After stopping the VM, use gcloud compute disks update with the --append-licenses flag to attach the sql-server-2025-standard license to the boot disk:

disk="sql-vm-boot-disk"
zone="europe-west4-a"

gcloud compute disks update ${disk} \
  --zone ${zone} \
  --append-licenses "https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2025-standard"

Verifying the attached licenses
#

Once the update operation completes, you can inspect the licenses attached to the disk using gcloud compute disks describe:

disk="sql-vm-boot-disk"
zone="europe-west4-a"

gcloud compute disks describe ${disk} \
  --zone ${zone} \
  --format "json" | jq -r '.licenses[]'

Resulting in the following output:

https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2025-dc
https://www.googleapis.com/compute/v1/projects/windows-sql-cloud/global/licenses/sql-server-2025-standard

Related

Retrieving licensing strings for use with Google Compute Engine

·581 words·3 mins
When migrating server instances to Google Cloud it can be required to change licensing for the sofware that is running within the instance. This can be to use pay-as-you-go (PAYG) licensing for products such as SQL Server or adding additional support packages for Linux derivatives.

Updating Windows Server license version on GCE

·366 words·2 mins
When deploying a VM running certain operating systems such as Windows Server, a license is added to the boot disk of that instance. This license is used for billing PAYG licensing.

Moving VMs between sole-tenant node groups

·324 words·2 mins
Sole-tenant nodes are being used by customers for workload isolation and also for licensing compliance (e.g. bringing Window Server licenses). Throughout the life cycle of a sole-tenant node there might be the necessity of moving virtual machines to another node group or even to another machine family (e.g. moving to N2 from N1). Refer to the documentation, to learn more about Node affinity and anti-affinity options.