Skip to content

Commit 11ba8da

Browse files
authored
Merge pull request #95922 from MashaMSFT/20191113_sqlvm
Updated PS commands, reformatted RP doc
2 parents a6ce79d + 527d322 commit 11ba8da

12 files changed

+213
-222
lines changed

articles/virtual-machines/windows/sql/quickstart-sql-vm-create-powershell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
147147
To get portal integration and SQL VM features, you must install the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). To install the agent on the new VM, run the following command after the VM is created.
148148

149149
```powershell
150-
Set-AzVMSqlServerExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -name "SQLIaasExtension" -version "1.2" -Location $Location
150+
Set-AzVMSqlServerExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -name "SQLIaasExtension" -version "2.0" -Location $Location
151151
```
152152

153153
## Remote desktop into the VM

articles/virtual-machines/windows/sql/virtual-machines-windows-portal-sql-create-failover-cluster-premium-file-share.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ You should also have a general understanding of these technologies:
4040
- [Azure resource groups](../../../azure-resource-manager/manage-resource-groups-portal.md)
4141

4242
> [!IMPORTANT]
43-
> At this time, SQL Server failover cluster instances on Azure virtual machines are supported only with the [lightweight](virtual-machines-windows-sql-register-with-resource-provider.md#register-with-sql-vm-resource-provider) management mode of the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). To change from full extension mode to lightweight mode, delete the **SQL Virtual Machine** resource for the corresponding VMs and then register them with the SQL VM resource provider in [lightweight](virtual-machines-windows-sql-register-with-resource-provider.md#register-with-sql-vm-resource-provider) mode. When you delete the **SQL Virtual Machine** resource by using the Azure portal, clear the check box next to the correct virtual machine.
44-
>
45-
> The full extension supports features like automated backup, patching, and advanced portal management. These features won't work for SQL Server VMs after the agent is reinstalled in [lightweight](virtual-machines-windows-sql-register-with-resource-provider.md#register-with-sql-vm-resource-provider) management mode.
43+
> At this time, SQL Server failover cluster instances on Azure virtual machines are only supported with the [lightweight management mode](virtual-machines-windows-sql-register-with-resource-provider.md#management-modes) of the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). To change from full extension mode to lightweight, delete the **SQL Virtual Machine** resource for the corresponding VMs and then register them with the SQL VM resource provider in lightweight mode. When deleting the **SQL Virtual Machine** resource using the Azure portal, **clear the checkbox next to the correct Virtual Machine**. The full extension supports features such as automated backup, patching, and advanced portal management. These features will not work for SQL VMs after the agent is reinstalled in lightweight management mode.
4644
4745
Premium file shares provide IOPS and throughout capacities that will meet the needs of many workloads. For IO-intensive workloads, consider [SQL Server Failover Cluster Instances with Storage Spaces Direct](virtual-machines-windows-portal-sql-create-failover-cluster.md), based on managed premium disks or ultra disks.
4846

articles/virtual-machines/windows/sql/virtual-machines-windows-portal-sql-create-failover-cluster.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ You should also have a general understanding of these technologies:
7878
- [Azure resource groups](../../../azure-resource-manager/manage-resource-groups-portal.md)
7979

8080
> [!IMPORTANT]
81-
> At this time, SQL Server failover cluster instances on Azure virtual machines are supported only with the [lightweight](virtual-machines-windows-sql-register-with-resource-provider.md#register-with-sql-vm-resource-provider) management mode of the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). Uninstall the full extension from the VMs that participate in the failover cluster and then register them with the SQL VM resource provider in lightweight mode.
82-
>
83-
> The full extension supports features like automated backup, patching, and advanced portal management. These features won't work for SQL Server VMs after the agent is reinstalled in lightweight management mode.
81+
> At this time, SQL Server failover cluster instances on Azure virtual machines are only supported with the [lightweight management mode](virtual-machines-windows-sql-register-with-resource-provider.md#management-modes) of the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). To change from full extension mode to lightweight, delete the **SQL Virtual Machine** resource for the corresponding VMs and then register them with the SQL VM resource provider in lightweight mode. When deleting the **SQL Virtual Machine** resource using the Azure portal, **clear the checkbox next to the correct Virtual Machine**. The full extension supports features such as automated backup, patching, and advanced portal management. These features will not work for SQL VMs after the agent is reinstalled in lightweight management mode.
8482
8583
### What to have
8684

articles/virtual-machines/windows/sql/virtual-machines-windows-ps-sql-create.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,14 @@ The virtual machine is created.
332332
> If you get an error about boot diagnostics, you can ignore it. A standard storage account is created for boot diagnostics because the specified storage account for the virtual machine's disk is a premium storage account.
333333
334334
## Install the SQL Iaas Agent
335-
SQL Server virtual machines support automated management features with the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). To install the agent on the new VM, run the following command after it's created.
335+
SQL Server virtual machines support automated management features with the [SQL Server IaaS Agent Extension](virtual-machines-windows-sql-server-agent-extension.md). To install the agent on the new VM, and register it with the resource provider, run the [New-AzSqlVM](/powershell/module/az.sqlvirtualmachine/new-azsqlvm) command after the virtual machine is created. Specify the license type for your SQL Server VM, choosing between either pay-as-you-go or bring-your-own-license via the [Azure Hybrid Benefit](https://azure.microsoft.com/pricing/hybrid-benefit/). For more information about licensing, see [licensing model](virtual-machines-windows-sql-ahb.md).
336336

337337

338338
```powershell
339-
Set-AzVMSqlServerExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -name "SQLIaasExtension" -version "1.2" -Location $Location
339+
New-AzSqlVM -ResourceGroupName $ResourceGroupName -Name $VMName -Location $Location -LicenseType <PAYG/AHUB>
340340
```
341341

342+
342343
## Stop or remove a VM
343344

344345
If you don't need the VM to run continuously, you can avoid unnecessary charges by stopping it when not in use. The following command stops the VM but leaves it available for future use.
@@ -414,8 +415,8 @@ $VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName $Publis
414415
# Create the VM in Azure
415416
New-AzVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $VirtualMachine
416417
417-
# Add the SQL IaaS Extension
418-
Set-AzVMSqlServerExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -name "SQLIaasExtension" -version "1.2" -Location $Location
418+
# Add the SQL IaaS Extension, and choose the license type
419+
New-AzSqlVM -ResourceGroupName $ResourceGroupName -Name $VMName -Location $Location -LicenseType <PAYG/AHUB>
419420
```
420421

421422
## Next steps

articles/virtual-machines/windows/sql/virtual-machines-windows-sql-ahb.md

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.devlang: na
1111
ms.topic: conceptual
1212
ms.tgt_pltfrm: vm-windows-sql-server
1313
ms.workload: iaas-sql-server
14-
ms.date: 08/05/2019
14+
ms.date: 11/13/2019
1515
ms.author: mathoma
1616
ms.reviewer: jroth
1717

@@ -90,29 +90,16 @@ The following code snippet switches your pay-as-you-go license model to bring-yo
9090

9191
```powershell-interactive
9292
# Switch your SQL Server VM license from pay-as-you-go to bring-your-own
93-
#example: $SqlVm = Get-AzResource -ResourceType Microsoft.SqlVirtualMachine/SqlVirtualMachines -ResourceGroupName AHBTest -ResourceName AHBTest
94-
$SqlVm = Get-AzResource -ResourceType Microsoft.SqlVirtualMachine/SqlVirtualMachines -ResourceGroupName <resource_group_name> -ResourceName <VM_name>
95-
$SqlVm.Properties.sqlServerLicenseType="AHUB"
96-
<# the following code snippet is only necessary if using Azure Powershell version > 4
97-
$SqlVm.Kind= "LicenseChange"
98-
$SqlVm.Plan= [Microsoft.Azure.Management.ResourceManager.Models.Plan]::new()
99-
$SqlVm.Sku= [Microsoft.Azure.Management.ResourceManager.Models.Sku]::new() #>
100-
$SqlVm | Set-AzResource -Force
93+
Update-AzSqlVM -ResourceGroupName <resource_group_name> -Name <VM_name> -LicenseType AHUB
10194
```
10295

10396
The following code snippet switches your bring-your-own-license model to pay-as-you-go:
10497

10598
```powershell-interactive
10699
# Switch your SQL Server VM license from bring-your-own to pay-as-you-go
107-
#example: $SqlVm = Get-AzResource -ResourceType Microsoft.SqlVirtualMachine/SqlVirtualMachines -ResourceGroupName AHBTest -ResourceName AHBTest
108-
$SqlVm = Get-AzResource -ResourceType Microsoft.SqlVirtualMachine/SqlVirtualMachines -ResourceGroupName <resource_group_name> -ResourceName <VM_name>
109-
$SqlVm.Properties.sqlServerLicenseType="PAYG"
110-
<# the following code snippet is only necessary if using Azure Powershell version > 4
111-
$SqlVm.Kind= "LicenseChange"
112-
$SqlVm.Plan= [Microsoft.Azure.Management.ResourceManager.Models.Plan]::new()
113-
$SqlVm.Sku= [Microsoft.Azure.Management.ResourceManager.Models.Sku]::new() #>
114-
$SqlVm | Set-AzResource -Force
100+
Update-AzSqlVM -ResourceGroupName <resource_group_name> -Name <VM_name> -LicenseType PAYG
115101
```
102+
116103
---
117104

118105
## Change the license for VMs not registered with the resource provider
@@ -133,44 +120,29 @@ You can change the license type of a SQL Server VM as pay-as-you-go or Azure Hyb
133120

134121
## Limitations
135122

136-
- Changing the license model is available only to customers who have Software Assurance.
137-
- Changing the license model is supported only for the Standard and Enterprise editions of SQL Server. License changes for Express, Web, and Developer are unsupported.
138-
- Changing the license model is supported only for virtual machines deployed through the Azure Resource Manager model. VMs deployed through the classic model are not supported. You can migrate your VM from classic to the Resource Manager model and register it with the SQL VM resource provider. After the VM is registered with the SQL VM resource provider, license model changes will be available on the VM.
139-
- Changing the license model is enabled only for public cloud installations.
140-
- Changing the license model is supported only on virtual machines that have a single NIC (network interface). On virtual machines that have more than one NIC, you should first remove one of the NICs (by using the Azure portal) before you attempt the procedure. Otherwise, you'll get an error similar to the following:
141-
142-
`The virtual machine '\<vmname\>' has more than one NIC associated.`
143-
144-
Although you might be able to add the NIC back to the VM after you change the license model, operations done through the SQL Server configuration page in the Azure portal, like automatic patching and backup, will no longer be considered supported.
123+
Changing the license model is:
124+
- Only available to customers with [Software Assurance](https://www.microsoft.com/en-us/licensing/licensing-programs/software-assurance-overview).
125+
- Only supported for the Standard and Enterprise editions of SQL Server. License changes for Express, Web, and Developer are not supported.
126+
- Only supported for virtual machines deployed through the Azure Resource Manager model. Virtual machines deployed through the classic model are not supported.
127+
- Available only for public cloud installations.
128+
- Only supported on virtual machines that have a single network interface (NIC).
129+
145130

146131
## Known errors
147132

148133
### The Resource 'Microsoft.SqlVirtualMachine/SqlVirtualMachines/\<resource-group>' under resource group '\<resource-group>' was not found.
134+
149135
This error occurs when you try to change the license model on a SQL Server VM that has not been registered with the SQL VM resource provider:
150136

151137
`The Resource 'Microsoft.SqlVirtualMachine/SqlVirtualMachines/\<resource-group>' under resource group '\<resource-group>' was not found. The property 'sqlServerLicenseType' cannot be found on this object. Verify that the property exists and can be set.`
152138

153139
You'll need to register your subscription with the resource provider, and then [register your SQL Server VM with the resource provider](virtual-machines-windows-sql-register-with-resource-provider.md).
154140

155-
### Cannot validate argument on parameter 'Sku'
156-
You might encounter this error when trying to change your SQL Server VM license model by using Azure PowerShell versions later than 4.0:
157-
158-
`Set-AzResource: Cannot validate argument on parameter 'Sku'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.`
159-
160-
To resolve this error, uncomment these lines in the previously mentioned PowerShell code snippet when switching your license model:
161-
162-
```powershell-interactive
163-
# the following code snippet is necessary if using Azure Powershell version > 4
164-
$SqlVm.Kind= "LicenseChange"
165-
$SqlVm.Plan= [Microsoft.Azure.Management.ResourceManager.Models.Plan]::new()
166-
$SqlVm.Sku= [Microsoft.Azure.Management.ResourceManager.Models.Sku]::new()
167-
```
168-
169-
Use the following code to verify your Azure PowerShell version:
170-
171-
```powershell-interactive
172-
Get-Module -ListAvailable -Name Azure -Refresh
173-
```
141+
142+
## The virtual machine '\<vmname\>' has more than one NIC associated
143+
144+
This error occurs on virtual machines that have more than one NIC. Remove one of the NICs before you change the licensing model. Although you can add the NIC back to the VM after you change the license model, operations in the Azure portal such as automatic backup and patching will no longer be supported.
145+
174146

175147
## Next steps
176148

articles/virtual-machines/windows/sql/virtual-machines-windows-sql-automated-backup-v2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ If it is not installed or failed to be provisioned, you can install it with the
169169
$region = "EASTUS2"
170170
Set-AzVMSqlServerExtension -VMName $vmname `
171171
-ResourceGroupName $resourcegroupname -Name "SQLIaasExtension" `
172-
-Version "1.2" -Location $region
172+
-Version "2.0" -Location $region
173173
```
174174

175175
### <a id="verifysettings"></a> Verify current settings
@@ -286,7 +286,7 @@ $logbackupfrequency = "30"
286286
287287
Set-AzVMSqlServerExtension -VMName $vmname `
288288
-ResourceGroupName $resourcegroupname -Name "SQLIaasExtension" `
289-
-Version "1.2" -Location $region
289+
-Version "2.0" -Location $region
290290
291291
# Creates/use a storage account to store the backups
292292

articles/virtual-machines/windows/sql/virtual-machines-windows-sql-automated-backup.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,12 @@ $resourcegroupname = "resourcegroupname"
113113

114114
If the SQL Server IaaS Agent extension is installed, you should see it listed as “SqlIaaSAgent” or “SQLIaaSExtension”. **ProvisioningState** for the extension should also show “Succeeded”.
115115

116-
If it is not installed or failed to be provisioned, you can install it with the following command. In addition to the VM name and resource group, you must also specify the region (**$region**) that your VM is located in.
116+
If it is not installed or failed to be provisioned, you can install it with the following command. In addition to the VM name and resource group, you must also specify the region (**$region**) that your VM is located in. Specify the license type for your SQL Server VM, choosing between either pay-as-you-go or bring-your-own-license via the [Azure Hybrid Benefit](https://azure.microsoft.com/pricing/hybrid-benefit/). For more information about licensing, see [licensing model](virtual-machines-windows-sql-ahb.md).
117117

118118
```powershell
119-
$region = "EASTUS2"
120-
Set-AzVMSqlServerExtension -VMName $vmname `
121-
-ResourceGroupName $resourcegroupname -Name "SQLIaasExtension" `
122-
-Version "1.2" -Location $region
119+
New-AzSqlVM -Name $vmname `
120+
-ResourceGroupName $resourcegroupname `
121+
-Location $region -LicenseType <PAYG/AHUB>
123122
```
124123

125124
> [!IMPORTANT]
@@ -234,7 +233,7 @@ $retentionperiod = 10
234233
235234
Set-AzVMSqlServerExtension -VMName $vmname `
236235
-ResourceGroupName $resourcegroupname -Name "SQLIaasExtension" `
237-
-Version "1.2" -Location $region
236+
-Version "2.0" -Location $region
238237
239238
# Creates/use a storage account to store the backups
240239

articles/virtual-machines/windows/sql/virtual-machines-windows-sql-bulk-register-with-resource-provider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Errors are logged in the log file named `VMsNotRegisteredDueToError<Timestamp>.l
217217

218218
When you register SQL Server VMs with the resource provider using the provided script, consider the following:
219219

220-
- Registration with the resource provider requires a guest agent running on the SQL Server VM. Windows Server 2008 images do not have a guest agent, so these virtual machines will fail and must be registered manually using the [NoAgent management mode](virtual-machines-windows-sql-register-with-resource-provider.md#register-sql-server-2008-or-2008-r2-on-windows-server-2008-vms).
220+
- Registration with the resource provider requires a guest agent running on the SQL Server VM. Windows Server 2008 images do not have a guest agent, so these virtual machines will fail and must be registered manually using the [NoAgent management mode](virtual-machines-windows-sql-register-with-resource-provider.md#management-modes).
221221
- There is retry logic built-in to overcome transparent errors. If the virtual machine is successfully registered, then it is a rapid operation. However, if the registration fails, then each virtual machine will be retried. As such, you should allow significant time to complete the registration process - though actual time requirement is dependent on the type and number of errors.
222222

223223
## Full script

0 commit comments

Comments
 (0)