Skip to main content
  1. Posts/

Updating Windows Server license version on GCE

·355 words·2 mins
Christoph Petersen
Author
Christoph Petersen

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.

While the cost for a Windows Server license is the same irrespective of the version, you may be inclined to want to update the associated license in order to reflect the correct version being billed.

Through recent upgrades, licenses are now mutable (within limits). This allows to upgrade licenses and ensure that the right version of the license is assigned to a particular VM.

Scenario
#

Imagine that you have a VM that is running Windows Server 2022 and you are upgrading to Windows Server 2025. You want the GCE license to reflect the same. There are a few steps that you need to go through.

Assigning a new license
#

The new license can either be appended or the existing license can be replaced.

When appending a license, make sure to remove the old license. You will be charged for each Windows Server license attached to the disk.

Appending the license
#

The following snippet will append the Windows Server 2025 license to an existing disk double-whammy:

DISK=double-whammy
ZONE=europe-west4-a

gcloud compute disks update $DISK \
    --zone $ZONE \
    --append-licenses https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2022-dc

This is what the disk looks like now:

License appended to the disk

When appending the license it is important to remove the old licese. As noted above if that is not done, all licenses will be charged leading to unecessary cost.

Removing the old license
#

The following command will remove the old license.

DISK=double-whammy
ZONE=europe-west4-a

gcloud compute disks update $DISK \
    --zone $ZONE \
    --remove-licenses https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2022-dc
While older licenses can be removed, the newest license assigned to the disk, for which no license that superseeds it is assigned to the disk can’t be removed.

Replacing the licese
#

Instead of appending the new and removing the old license. The license can also be straight up replaced in a single operation.

DISK=double-whammy
ZONE=europe-west4-a

gcloud compute disks update $DISK \
    --zone $ZONE \
    --replace-license https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2022-dc,https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-2025-dc

This will update the license with the new one in a single operation:

Replace license assigned to the disk

Related

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.

Running Proxmox PVE on Google Cloud using GCE (bare-metal) instances

·1565 words·8 mins
This article lays out the steps to prepare an image that can be used for GCE and GCE bare-metal instances to run Proxmox Virtual Environment (PVE). PVE is a solution similar to VMware and Nutanix that allows for management of fleet of VMs. Especially for scenarios like datacenter exits or migrations from on-premises customers look for solutions that allow them to easily transition to a virtualization solution if they are not ready for standard Google Compute Engine (GCE) VMs or if there are technical constraints that requires them to explore alternatives.

Changing Standard VMs to Spot provisioning model

·140 words·1 min
In a previous article I have explained how to change the provisioning of a VM from being preemtible to Standard. There are situations where you have a VM deployed with the Standard provisioning model but you want to reduce its cost and the workload is stateless or interruptible.