Creating Windows Server Instances

This guide shows you how to create Windows Server instances on Google Compute Engine. For instructions on how to create an instance with SQL Server preinstalled, see Creating SQL Server Instances.

For more general information about Windows Server instances and Windows applications that you can run on Compute Engine, see Windows on Compute Engine.

Before you begin

Creating a Windows Server instance

To create an instance with Windows Server, specify the image family for the specific version of Windows or that you need. For a list of the available image families, see the list of public images.

Console


To create a basic Windows instance:

  1. In the Cloud Platform Console, go to the VM Instances page.

    Go to the VM Instances page

  2. Click the Create instance button.
  3. In the Boot disk section, click Change to begin configuring your boot disk.
  4. In the OS images tab, choose a Windows image.
  5. Click Select.
  6. Click the Create button to create the instance.

gcloud


Use the compute images list command to see a list of available Windows Server images:

gcloud compute images list --project windows-cloud --no-standard-images

Use the compute instances create command to create a new instance and specify the image family for one of the Windows Server public images.

gcloud compute instances create [INSTANCE_NAME] \
    --image-project windows-cloud \
    --image-family [IMAGE_FAMILY] \
    --machine-type MACHINE_TYPE] \
    --boot-disk-size [BOOT_DISK_SIZE] \
    --boot-disk-type [BOOT_DISK_TYPE]

where:

  • [INSTANCE_NAME] is the name for the new instance.
  • [IMAGE_FAMILY] is one of the public image families for Windows Server images.
  • [MACHINE_TYPE] is one of the available machine types.
  • [BOOT_DISK_SIZE] is the size of the boot disk in GB. Larger persistent disks have higher throughput.
  • [BOOT_DISK_TYPE] is the type of the boot disk for your instance. Specify pd-ssd to use a faster SSD persistent disk or pd-standard to use a standard HDD persistent disk.

API


To create an instance with the API, include the initializeParams property in your instance creation request and specify a Windows image. For example, your request body might look like the following:

 instance = {
   "name": "[INSTANCE_NAME]",
   "machineType": "zones/[ZONE]/machineTypes/[MACHINE_TYPE]",
   "disks": [{
       "boot": "true",
       "type": "PERSISTENT",
       "initializeParams": {
          "diskName": "[DISK_NAME]",
          "sourceImage": "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/images/family/[IMAGE_FAMILY]",
          "diskSizeGb": "[BOOT_DISK_SIZE]",
          "diskType": "[BOOT_DISK_TYPE]",
        }
     }],
   "networkInterfaces": [{
     "accessConfigs": [{
       "type": "ONE_TO_ONE_NAT",
       "name": "External NAT"
      }],
     "network": "global/networks/default"
   }],
   "serviceAccounts": [{
        "email": DEFAULT_SERVICE_EMAIL,
        "scopes": DEFAULT_SCOPES
   }]
 }

where:

  • [INSTANCE_NAME] is the name for the new instance.
  • [IMAGE_FAMILY] is one of the public image families for Windows Server or SQL Server images.
  • [ZONE] is the zone for this instance.
  • [MACHINE_TYPE] is one of the available machine types.
  • [BOOT_DISK_SIZE] is the size of the boot disk in GB. Larger persistent disks have higher throughput.
  • [BOOT_DISK_TYPE] is the type of the boot disk for your instance. Specify pd-ssd to use a faster SSD persistent disk or pd-standard to use a standard HDD persistent disk.

For more information on creating an instance, read the instances.insert() documentation.

After you create your Windows or SQL Server instance, set the initial password for the instance so that you can connect to the instance through RDP.

Verifying that an instance has successfully started

Windows instances experience a longer startup time because of the sysprep process. The Cloud Platform Console might show that the instance is running even if the sysprep process is not yet complete. To check if your instance has successfully started and is ready to be used, check the serial port output with the following command:

gcloud compute instances get-serial-port-output [INSTANCE_NAME]

where [INSTANCE_NAME] is the name of the instance you want to verify.

...[snip]...
Running schtasks with arguments /run /tn GCEStartup
-->  SUCCESS: Attempted to run the scheduled task "GCEStartup".
-------------------------------------------------------------
Instance setup finished. [INSTANCE_NAME] is ready to use.
-------------------------------------------------------------

What's next

Send feedback about...

Compute Engine Documentation