Skip to content

Commit a48f6da

Browse files
committed
Merge branch 'linux-ext' of https://github.com/adbadram/azure-docs-pr into sqlvmlinux-extension
2 parents 374243e + cb757dd commit a48f6da

File tree

3 files changed

+29
-297
lines changed

3 files changed

+29
-297
lines changed

articles/azure-sql/virtual-machines/linux/sql-agent-extension-register-vm-linux.md

Lines changed: 3 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: virtual-machines-sql
99
ms.subservice: management
1010
ms.devlang: na
1111
ms.topic: how-to
12-
ms.tgt_pltfrm: vm-windows-sql-server
12+
ms.tgt_pltfrm: vm-Linux-sql-server
1313
ms.workload: iaas-sql-server
1414
ms.date: 09/01/2021
1515
ms.author: adbadram
@@ -27,8 +27,6 @@ Register your SQL Server VM with the [SQL IaaS Agent extension](sql-server-iaas-
2727

2828
Registering with the [SQL Server IaaS Agent extension](sql-server-iaas-agent-extension-automate-management.md) creates the [**SQL virtual machine** _resource_](manage-sql-vm-portal.md) within your subscription, which is a _separate_ resource from the virtual machine resource. Unregistering your SQL Server VM from the extension will remove the **SQL virtual machine** _resource_ but will not drop the actual virtual machine.
2929

30-
Deploying a SQL Server VM Azure Marketplace image through the Azure portal automatically registers the SQL Server VM with the extension. However, if you choose to self-install SQL Server on an Azure virtual machine, or provision an Azure virtual machine from a custom VHD, then you must register your SQL Server VM with the SQL IaaS Agent extension to to unlock full feature benefits and manageability.
31-
3230
To utilize the SQL IaaS Agent extension, you must first [register your subscription with the **Microsoft.SqlVirtualMachine** provider](#register-subscription-with-rp), which gives the SQL IaaS extension the ability to create resources within that specific subscription.
3331

3432
> [!IMPORTANT]
@@ -41,7 +39,7 @@ To register your SQL Server VM with the extension, you'll need:
4139
- An [Azure subscription](https://azure.microsoft.com/free/).
4240
- An Azure Resource Model [Windows Server 2008 (or greater) virtual machine](../../../virtual-machines/windows/quick-create-portal.md) with [SQL Server 2008 (or greater)](https://www.microsoft.com/sql-server/sql-server-downloads) deployed to the public or Azure Government cloud.
4341
- The latest version of [Azure CLI](/cli/azure/install-azure-cli) or [Azure PowerShell (5.0 minimum)](/powershell/azure/install-az-ps).
44-
- A minimum of .NET Framework 4.5.1 or later.
42+
- Azure Virtual Machine running Ubuntu Linux.
4543

4644
## Register subscription with RP
4745

@@ -75,77 +73,13 @@ az provider register --namespace Microsoft.SqlVirtualMachine
7573
Register-AzResourceProvider -ProviderNamespace Microsoft.SqlVirtualMachine
7674
```
7775

78-
---
79-
80-
## Full mode
81-
82-
To register your SQL Server VM directly in full mode, use the following Azure PowerShell command:
83-
84-
```powershell-interactive
85-
# Get the existing Compute VM
86-
$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name>
87-
88-
# Register with SQL IaaS Agent extension in full mode
89-
New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -SqlManagementType Full
90-
91-
```
92-
93-
To learn more about full mode, see [management modes](sql-server-iaas-agent-extension-automate-management.md#management-modes).
94-
95-
### Upgrade to full
96-
97-
SQL Server VMs that have registered the extension in *lightweight* mode can upgrade to _full_ using the Azure portal, the Azure CLI, or Azure PowerShell. SQL Server VMs in _NoAgent_ mode can upgrade to _full_ after the OS is upgraded to Windows 2008 R2 and above. It is not possible to downgrade - to do so, you will need to [unregister](#unregister-from-extension) the SQL Server VM from the SQL IaaS Agent extension. Doing so will remove the **SQL virtual machine** _resource_, but will not delete the actual virtual machine.
98-
99-
#### Azure portal
100-
101-
To upgrade the extension to full mode using the Azure portal, follow these steps:
102-
103-
1. Sign in to the [Azure portal](https://portal.azure.com).
104-
1. Go to your [SQL virtual machines](manage-sql-vm-portal.md#access-the-resource) resource.
105-
1. Select your SQL Server VM, and navigate to the **Overview** page.
106-
1. For SQL Server VMs with the NoAgent or lightweight IaaS extension mode, select the **Only license type and edition updates are available with the current SQL IaaS extension mode...** message.
107-
108-
![Selections for changing the mode from the portal](./media/sql-agent-extension-manually-register-single-vm/change-sql-iaas-mode-portal.png)
109-
110-
1. Select **Confirm** to upgrade your SQL Server IaaS extension mode to full.
111-
112-
![Select **Confirm** to upgrade your SQL Server IaaS extension mode to full.](./media/sql-agent-extension-manually-register-single-vm/enable-full-mode-iaas.png)
113-
114-
#### Command line
115-
116-
# [Azure CLI](#tab/bash)
117-
118-
To upgrade the extension to full mode, run the following Azure CLI code snippet:
119-
120-
```azurecli-interactive
121-
# Update to full mode
122-
az sql vm update --name <vm_name> --resource-group <resource_group_name> --sql-mgmt-type full
123-
```
124-
125-
# [Azure PowerShell](#tab/powershell)
126-
127-
To upgrade the extension to full mode, run the following Azure PowerShell code snippet:
128-
129-
```powershell-interactive
130-
# Get the existing Compute VM
131-
$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name>
132-
133-
# Register with SQL IaaS Agent extension in full mode
134-
Update-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -SqlManagementType Full -Location $vm.Location
135-
```
136-
137-
---
13876

13977
## Lightweight mode
14078

141-
Use the Azure CLI or Azure PowerShell to register your SQL Server VM with the extension in lightweight mode for limited functionality.
79+
SQL IaaS Agent extension on Linux comes only with Lightweight mode where changing the license type and edition of SQL Server is supported. Use the Azure CLI or Azure PowerShell to register your SQL Server VM with the extension in lightweight mode for limited functionality.
14280

14381
Provide the SQL Server license type as either pay-as-you-go (`PAYG`) to pay per usage, Azure Hybrid Benefit (`AHUB`) to use your own license, or disaster recovery (`DR`) to activate the [free DR replica license](business-continuity-high-availability-disaster-recovery-hadr-overview.md#free-dr-replica-in-azure).
14482

145-
Failover cluster instances and multi-instance deployments can only be registered with the SQL IaaS Agent extension in lightweight mode.
146-
147-
To learn more about lightweight mode, see [management modes](sql-server-iaas-agent-extension-automate-management.md#management-modes).
148-
14983
# [Azure CLI](#tab/bash)
15084

15185
Register a SQL Server VM in lightweight mode with the Azure CLI:
@@ -168,97 +102,6 @@ Register a SQL Server VM in lightweight mode with Azure PowerShell:
168102
-LicenseType <license_type> -SqlManagementType LightWeight
169103
```
170104
---
171-
172-
## NoAgent management mode
173-
174-
SQL Server 2008 and 2008 R2 installed on Windows Server 2008 (_not R2_) can only be registered with the SQL IaaS Agent extension in the [NoAgent mode](sql-server-iaas-agent-extension-automate-management.md#management-modes). This option assures compliance and allows the SQL Server VM to be monitored in the Azure portal with limited functionality.
175-
176-
For the **license type**, specify either: `AHUB`, `PAYG`, or `DR`.
177-
For the **image offer**, specify either `SQL2008-WS2008` or `SQL2008R2-WS2008`
178-
179-
To register your SQL Server 2008 (`SQL2008-WS2008`) or 2008 R2 (`SQL2008R2-WS2008`) on Windows Server 2008 instance, use the following Azure CLI or Azure PowerShell code snippet:
180-
181-
# [Azure CLI](#tab/bash)
182-
183-
Register your SQL Server virtual machine in NoAgent mode with the Azure CLI:
184-
185-
```azurecli-interactive
186-
az sql vm create -n sqlvm -g myresourcegroup -l eastus |
187-
--license-type <license type> --sql-mgmt-type NoAgent
188-
--image-sku Enterprise --image-offer <image offer>
189-
```
190-
191-
# [Azure PowerShell](#tab/powershell)
192-
193-
Register your SQL Server virtual machine in NoAgent mode with Azure PowerShell:
194-
195-
```powershell-interactive
196-
# Get the existing compute VM
197-
$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name>
198-
199-
New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Location $vm.Location `
200-
-LicenseType <license type> -SqlManagementType NoAgent -Sku Standard -Offer <image offer>
201-
```
202-
203-
---
204-
205-
206-
## Check extension mode
207-
208-
Use Azure PowerShell to check what management mode your SQL Server IaaS agent extension is in.
209-
210-
To check the mode of the extension, use this Azure PowerShell cmdlet:
211-
212-
```powershell-interactive
213-
# Get the SqlVirtualMachine
214-
$sqlvm = Get-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName
215-
$sqlvm.SqlManagementType
216-
```
217-
218-
## Upgrade to full
219-
220-
SQL Server VMs that have registered the extension in *lightweight* mode can upgrade to _full_ using the Azure portal, the Azure CLI, or Azure PowerShell. SQL Server VMs in _NoAgent_ mode can upgrade to _full_ after the OS is upgraded to Windows 2008 R2 and above. It is not possible to downgrade - to do so, you will need to [unregister](#unregister-from-extension) the SQL Server VM from the SQL IaaS Agent extension. Doing so will remove the **SQL virtual machine** _resource_, but will not delete the actual virtual machine.
221-
222-
### Azure portal
223-
224-
To upgrade the extension to full mode using the Azure portal, follow these steps:
225-
226-
1. Sign in to the [Azure portal](https://portal.azure.com).
227-
1. Go to your [SQL virtual machines](manage-sql-vm-portal.md#access-the-resource) resource.
228-
1. Select your SQL Server VM, and select **Overview**.
229-
1. For SQL Server VMs with the NoAgent or lightweight IaaS mode, select the **Only license type and edition updates are available with the current SQL IaaS extension...** message.
230-
231-
![Selections for changing the mode from the portal](./media/sql-agent-extension-manually-register-single-vm/change-sql-iaas-mode-portal.png)
232-
233-
1. Select **Confirm** to upgrade your SQL Server extension IaaS mode to full.
234-
235-
![Select **Confirm** to upgrade your SQL Server extension IaaS mode to full](./media/sql-agent-extension-manually-register-single-vm/enable-full-mode-iaas.png)
236-
237-
### Command line
238-
239-
# [Azure CLI](#tab/bash)
240-
241-
To upgrade the extension to full mode, run the following Azure CLI code snippet:
242-
243-
```azurecli-interactive
244-
# Update to full mode
245-
az sql vm update --name <vm_name> --resource-group <resource_group_name> --sql-mgmt-type full
246-
```
247-
248-
# [Azure PowerShell](#tab/powershell)
249-
250-
To upgrade the extension to full mode, run the following Azure PowerShell code snippet:
251-
252-
```powershell-interactive
253-
# Get the existing Compute VM
254-
$vm = Get-AzVM -Name <vm_name> -ResourceGroupName <resource_group_name>
255-
256-
# Register with SQL IaaS Agent extension in full mode
257-
Update-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -SqlManagementType Full -Location $vm.Location
258-
```
259-
260-
---
261-
262105
## Verify registration status
263106

264107
You can verify if your SQL Server VM has already been registered with the SQL IaaS Agent extension by using the Azure portal, the Azure CLI, or Azure PowerShell.
@@ -270,11 +113,6 @@ To verify the registration status using the Azure portal, follow these steps:
270113
1. Sign in to the [Azure portal](https://portal.azure.com).
271114
1. Go to your [SQL Server VMs](manage-sql-vm-portal.md).
272115
1. Select your SQL Server VM from the list. If your SQL Server VM is not listed here, it likely hasn't been registered with the SQL IaaS Agent extension.
273-
1. View the value under **Status**. If **Status** is **Succeeded**, then the SQL Server VM has been registered with the SQL IaaS Agent extension successfully.
274-
275-
![Verify status with SQL RP registration](./media/sql-agent-extension-manually-register-single-vm/verify-registration-status.png)
276-
277-
Alternatively, you can check the status by choosing **Repair** under the **Support + troubleshooting** pane in the **SQL virtual machine** resource. The provisioning state for the SQL IaaS agent extension can be **Succeeded** or **Failed**.
278116

279117
### Command line
280118

@@ -300,72 +138,6 @@ To verify the registration status using the Azure PowerShell, run the following
300138

301139
An error indicates that the SQL Server VM has not been registered with the extension.
302140

303-
## Repair extension
304-
305-
It's possible for your SQL IaaS agent extension to be in a failed state. Use the Azure portal to repair the SQL IaaS agent extension. To do so, follow these steps:
306-
307-
1. Sign in to the [Azure portal](https://portal.azure.com).
308-
1. Go to your [SQL Server VMs](manage-sql-vm-portal.md).
309-
1. Select your SQL Server VM from the list. If your SQL Server VM is not listed here, it likely hasn't been registered with the SQL IaaS Agent extension.
310-
1. Select **Repair** under **Support + Troubleshooting** in the **SQL virtual machine** resource page.
311-
312-
:::image type="content" source="media/sql-agent-extension-manually-register-single-vm/repair-extension.png" alt-text="Select **Repair** under **Support + Troubleshooting** in the **SQL virtual machine** resource page":::
313-
314-
1. If your provisioning state shows as **Failed**, choose **Repair** to repair the extension. If your state is **Succeeded** you can check the box next to **Force repair** to repair the extension regardless of state.
315-
316-
![If your provisioning state shows as **Failed**, choose **Repair** to repair the extension. If your state is **Succeeded** you can check the box next to **Force repair** to repair the extension regardless of state.](./media/sql-agent-extension-manually-register-single-vm/force-repair-extension.png)
317-
318-
319-
## Unregister from extension
320-
321-
To unregister your SQL Server VM with the SQL IaaS Agent extension, delete the SQL virtual machine *resource* using the Azure portal or Azure CLI. Deleting the SQL virtual machine *resource* does not delete the SQL Server VM. However, use caution and follow the steps carefully because it is possible to inadvertently delete the virtual machine when attempting to remove the *resource*.
322-
323-
Unregistering the SQL virtual machine with the SQL IaaS Agent extension is necessary to downgrade the management mode from full.
324-
325-
### Azure portal
326-
327-
To unregister your SQL Server VM from the extension using the Azure portal, follow these steps:
328-
329-
1. Sign into the [Azure portal](https://portal.azure.com).
330-
1. Navigate to the SQL VM resource.
331-
332-
![SQL virtual machines resource](./media/sql-agent-extension-manually-register-single-vm/sql-vm-manage.png)
333-
334-
1. Select **Delete**.
335-
336-
![Select delete in the top navigation](./media/sql-agent-extension-manually-register-single-vm/delete-sql-vm-resource.png)
337-
338-
1. Type the name of the SQL virtual machine and **clear the check box next to the virtual machine**.
339-
340-
![Uncheck the VM to prevent deleting the actual virtual machine and then select Delete to proceed with deleting the SQL VM resource](./media/sql-agent-extension-manually-register-single-vm/confirm-delete-of-resource-uncheck-box.png)
341-
342-
> [!WARNING]
343-
> Failure to clear the checkbox next to the virtual machine name will *delete* the virtual machine entirely. Clear the checkbox to unregister the SQL Server VM from the extension but *not delete the actual virtual machine*.
344-
345-
1. Select **Delete** to confirm the deletion of the SQL virtual machine *resource*, and not the SQL Server VM.
346-
347-
### Command line
348-
349-
# [Azure CLI](#tab/azure-cli)
350-
351-
To unregister your SQL Server VM from the extension with Azure CLI, use the [az sql vm delete](/cli/azure/sql/vm#az_sql_vm_delete) command. This will remove the SQL Server VM *resource* but will not delete the virtual machine.
352-
353-
```azurecli-interactive
354-
az sql vm delete
355-
--name <SQL VM resource name> |
356-
--resource-group <Resource group name> |
357-
--yes
358-
```
359-
360-
# [PowerShell](#tab/azure-powershell)
361-
362-
To unregister your SQL Server VM from the extension with Azure PowerShell, use the [Remove-AzSqlVM](/powershell/module/az.sqlvirtualmachine/remove-azsqlvm)command. This will remove the SQL Server VM *resource* but will not delete the virtual machine.
363-
364-
```powershell-interactive
365-
Remove-AzSqlVM -ResourceGroupName <resource_group_name> -Name <VM_name>
366-
```
367-
368-
---
369141

370142
## Next steps
371143

0 commit comments

Comments
 (0)