Adicionar uma licença do SQL Server a um Windows Server que já existe
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Linux
O Compute Engine permite instalar o SQL Server em instâncias de máquinas virtuais (VM) do Linux e usar licenças de pagamento por utilização (PAYG, na sigla em inglês). Neste documento, descrevemos como usar o SQL Server em uma VM do
Linux da seguinte maneira:
Depois de adicionar uma string de licença ao disco de inicialização da VM do Windows, a cobrança será feita conforme o preço das imagens do SQL Server.
Limitações
Só é possível instalar o SQL Server nas seguintes distribuições do Linux:
Red Hat Enterprise Linux (RHEL)
SUSE Linux Enterprise Server (SLES)
Ubuntu
Adicionar uma licença do SQL Server a um servidor Linux
Os metadados de licença do SQL Server em um disco de inicialização permitem que o Google Cloud acompanhe, cobre e gere relatórios com precisão sobre o uso de licenças do SQL Server. Esses metadados são necessários ao usar licenças PAYG do SQL Server. Adicione uma licença do SQL Server a um disco de inicialização que já existe usando o seguinte procedimento:
Identifique a licença que você quer adicionar a uma VM. Para o SQL Server, a licença precisa corresponder à versão e à edição que você quer executar. Para ver a lista de strings de licenças válidas do SQL Server, consulte a guia
Strings de licença no documento Detalhes do sistema operacional para SQL
Server.
Pare a VM:
gcloud compute instances stop VM_NAME
Substitua VM_NAME pelo nome da instância de VM a ser interrompida.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-19 UTC."],[[["\u003cp\u003eCompute Engine allows you to install SQL Server on Linux virtual machines (VMs) with pay-as-you-go (PAYG) licensing.\u003c/p\u003e\n"],["\u003cp\u003eAdding SQL Server license metadata to a Linux VM's boot disk is necessary for accurate billing and license usage tracking.\u003c/p\u003e\n"],["\u003cp\u003eYou can only install SQL Server on Linux distributions such as Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise Server (SLES), and Ubuntu.\u003c/p\u003e\n"],["\u003cp\u003eThe process to add a SQL Server license involves stopping the VM, detaching the boot disk, cloning it with the license, attaching the new disk as the boot disk, and restarting the VM.\u003c/p\u003e\n"],["\u003cp\u003eOnce a license is added to a VM, it cannot be removed, and billing for SQL Server images is based on the set pricing structure.\u003c/p\u003e\n"]]],[],null,["Linux\n\n*** ** * ** ***\n\nCompute Engine lets you install SQL Server on Linux virtual machines (VM)\ninstances and use pay-as-you-go (PAYG) licenses. This document describes how to\nuse SQL Server on a Linux VM by doing the following:\n\n1. [Add SQL Server license metadata to a boot disk](#add-sql-server-license)\n2. [Install SQL Server on Linux](#install-sql-server-on-linux)\n\nBilling\n\nAfter adding a license string to the Linux VM's boot disk, you are billed\naccording to the pricing of [SQL Server images](/compute/disks-image-pricing#sql_server_pricing).\n\nLimitations\n\n- You can only install SQL Server on the following Linux distributions:\n\n - Red Hat Enterprise Linux (RHEL)\n - SUSE Linux Enterprise Server (SLES)\n - Ubuntu\n\nAdd a SQL Server license to a Linux Server\n\nSQL Server license metadata on a boot disk allows Google Cloud to accurately\ntrack, bill, and report on SQL Server license usage. This metadata is required\nwhen using PAYG SQL Server licenses. Add a SQL Server license to an existing boot\ndisk using the following procedure:\n| **Caution:** After you add a license to a VM, you cannot remove the license from the VM.\n\n1. Identify the license you want to add to a VM. For SQL Server, the\n license needs to match both the version and edition you want to run. For the\n list of valid SQL Server license strings, see the **License strings** tab in\n the [operating system details for SQL Server](/compute/docs/images/os-details#sql_server)\n document.\n\n2. Stop the VM:\n\n ```\n gcloud compute instances stop VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM instance to\n stop.\n3. Identify the boot disk:\n\n ```\n gcloud compute instances describe VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n4. Verify that the output is similar to the following:\n\n disks:\n - autoDelete: true\n boot: true\n deviceName: \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e\n diskSizeGb: '20'\n guestOsFeatures:\n - type: UEFI_COMPATIBLE\n index: 0\n interface: SCSI\n kind: compute#attachedDisk\n licenses:\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_LICENSE_STRING\u003c/var\u003e\n mode: READ_WRITE\n source: https://www.googleapis.com/compute/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e/zones/\u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e/disks/\u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e\n type: PERSISTENT\n\n5. Detach the boot disk:\n\n ```\n gcloud compute instances detach-disk VM_NAME --disk=BOOT_DISK_NAME\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e: the name of the boot disk\n6. Clone the boot disk and add the additional license:\n\n ```\n gcloud compute disks create CLONED_BOOT_DISK_NAME \\\n --licenses=SQL_SERVER_LICENSE \\\n --source-disk=BOOT_DISK_NAME \\\n --source-disk-zone=BOOT_DISK_ZONE \\\n --zone=CLONED_BOOT_DISK_ZONE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_NAME\u003c/var\u003e: the name you want to give the cloned book disk\n - \u003cvar translate=\"no\"\u003eSQL_SERVER_LICENSE\u003c/var\u003e: the SQL Server license you want to add to the boot disk\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e: the name of the source boot disk that you want to clone\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_ZONE\u003c/var\u003e: the zone of the source boot disk\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_ZONE\u003c/var\u003e: the zone in which you want to create the cloned boot disk\n7. Verify that the new disk has the correct license:\n\n ```\n gcloud compute disks describe CLONED_BOOT_DISK_NAME \\\n --zone=CLONED_BOOT_DISK_ZONE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_NAME\u003c/var\u003e: the name of the cloned book disk\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_ZONE\u003c/var\u003e: the zone of the cloned boot disk\n8. Attach the new disk as the boot disk for the VM instance:\n\n ```\n gcloud compute instances attach-disk VM_NAME \\\n --disk=CLONED_BOOT_DISK_NAME\n --boot\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM instance to which you want to attach the cloned boot disk\n - \u003cvar translate=\"no\"\u003eCLONED_BOOT_DISK_NAME\u003c/var\u003e: the name of the cloned book disk\n9. Verify that the VM's boot disk is the new cloned disk with SQL Server\n licensing.\n\n ```\n gcloud compute instances describe VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n10. Start the VM instance.\n\n ```\n gcloud compute instances start VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n11. (Optional) When you are sure that you don't want to revert back to the earlier\n boot disk, you can delete the disk.\n\n ```\n gcloud compute disks delete BOOT_DISK_NAME \\\n --zone=BOOT_DISK_ZONE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_NAME\u003c/var\u003e: the name of the boot disk that you want to delete\n - \u003cvar translate=\"no\"\u003eBOOT_DISK_ZONE\u003c/var\u003e: the zone of the boot disk\n\nInstall SQL Server on Linux\n\nFor guidance on installing, updating, and uninstalling SQL Server on Linux, see [Installation guidance for SQL Server on Linux](https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-setup?view=sql-server-ver16).\n\nWhat's next\n\n- [Learn about licenses](/compute/docs/licenses/about)\n\n- [View the SQL Server tutorials](/compute/docs/tutorials#sql-server)\n\n- [View the supported editions of SQL Server](/compute/docs/images/os-details#sql_server)"]]