Skip to content

Commit b1b46da

Browse files
Merge pull request #289252 from sshiba/main
Updated VM Console Service with ConsoleExtendedLocation info
2 parents 5bf8a66 + d9db72e commit b1b46da

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

articles/operator-nexus/howto-use-vm-console-service.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
title: "Azure Operator Nexus: VM Console Service"
3-
description: Learn how to use the VM Console service.
3+
description: Learn how to use the VM Console service to remotely access Nexus Virtual Machine through ssh from your environment.
44
author: sshiba
55
ms.author: sidneyshiba
66
ms.service: azure-operator-nexus
77
ms.topic: how-to
8-
ms.date: 10/11/2023
8+
ms.date: 10/25/2024
99
ms.custom: template-how-to, devx-track-azurecli
1010
---
1111

1212
# Introduction to the Virtual Machine console service
1313

14-
The Virtual Machine (VM) console service provides managed access to a VM hosted in an Operator Nexus Instance. It relies on the Azure Private Link Service (PLS) to establish a private network connection between the user's network and the Azure Operator Nexus Cluster Manager's private network.
14+
The Virtual Machine (VM) console service provides managed access to a VM hosted in an Operator Nexus Instance. It uses Azure Private Link Service (PLS) to provide network connectivity on Azure private network. The VM Console service is a secure and private way to access a VM without exposing it to the public internet.
1515

1616
:::image type="content" source="media/vm-console-service.png" alt-text="Diagram of VM Console service." lightbox="media/vm-console-service.png":::
1717

@@ -23,7 +23,7 @@ This guide helps you to:
2323

2424
1. Establish a secure private network connectivity between your network and the Cluster Manager's private network.
2525
1. Create a Console resource in your workload/tenant resource group using the `az networkcloud virtualmachine console` CLI command.
26-
1. Initiate an SSH session to connect to the Virtual Machine's Console.
26+
1. Start an SSH session to connect to the Virtual Machine's Console.
2727

2828
> [!NOTE]
2929
> In order to avoid passing the `--subscription` parameter to each Azure CLI command, execute the following command:
@@ -44,15 +44,17 @@ To help set up the environment for access to Virtual Machines, define these envi
4444
> These environment variable values do not reflect a real deployment and users MUST change them to match their environments.
4545
>
4646
> It should be noted that the first set of variables in the section below are for the **Cluster Manager** not the Cluster.
47+
> The CM_EXTENDED_LOCATION value can be found with the command `az networkcloud virtualmachine show --name <virtual machine name> --resource-group <virtual machine's resource group> --query "consoleExtendedLocation" | jq -r '.consoleExtendedLocation.name'`.
4748
4849
```bash
4950
# CM_HOSTED_RESOURCES_RESOURCE_GROUP: Cluster Manager resource group name
5051
export CM_HOSTED_RESOURCES_RESOURCE_GROUP="my-contoso-console-rg"
51-
# CM_EXTENDED_LOCATION: Cluster Manager Extended Location, can be retrieved but you will need access rights to execute certain Azure CLI commands
52-
export CM_EXTENDED_LOCATION="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName"
5352
5453
# VIRTUAL_MACHINE_NAME: Virtual Machine name you want to access through VM Console service
5554
export VIRTUAL_MACHINE_NAME="my-undercloud-vm"
55+
# CM_EXTENDED_LOCATION: Cluster Manager Extended Location, can be retrieved but you will need access rights to execute certain Azure CLI commands
56+
export CM_EXTENDED_LOCATION=$(az networkcloud virtualmachine show --name ${VIRTUAL_MACHINE_NAME} --resource-group ${VIRTUAL_MACHINE_RG} --query "consoleExtendedLocation" | jq -r '.consoleExtendedLocation.name')
57+
5658
# CONSOLE_PUBLIC_KEY: Public Key matching Private Key to be used when establish `ssh` session, e.g., `ssh -i $HOME/.ssh/id-rsa`
5759
export CONSOLE_PUBLIC_KEY="xxxx-xxxx-xxxxxx-xxxx"
5860
# CONSOLE_EXPIRATION_TIME: Expiration date and time (RFC3339 format) for any `ssh` session with a virtual machine.
@@ -74,13 +76,13 @@ To help set up the environment for access to Virtual Machines, define these envi
7476
7577
## Creating Console Resource
7678

77-
The Console resource provides the information about the VM such as VM name, public SSH key, expiration date for the SSH session, etc.
79+
The Console resource provides the information about the Nexus VM. It provides the VM name, public SSH key, expiration date for the SSH session, and so on.
7880

7981
This section provides step-by-step guide to help you to create a Console resource using Azure CLI commands.
8082

8183
:::image type="content" source="media/vm-console-resource.png" alt-text="Diagram of VM Console Resource." lightbox="media/vm-console-resource.png":::
8284

83-
1. In order to create a ***Console*** resource in the Cluster Manager, you will need to collect some information, e.g., resource group (CM_HOSTED_RESOURCES_RESOURCE_GROUP) and custom location (CM_EXTENDED_LOCATION). You have to provide the resource group but you can retrieve the custom location if you have access rights to excute the commands listed below.
85+
1. To create a ***Console*** resource in the Cluster Manager, you'll need to collect some information, for example, resource group (CM_HOSTED_RESOURCES_RESOURCE_GROUP) and custom location (CM_EXTENDED_LOCATION). You have to provide the resource group but you can retrieve the custom location if you have access rights to excute the following commands:
8486

8587
```bash
8688
export cluster_manager_resource_id=$(az resource list -g ${CM_HOSTED_RESOURCES_RESOURCE_GROUP} --query "[?type=='Microsoft.NetworkCloud/clusterManagers'].id" --output tsv)
@@ -99,7 +101,7 @@ This section provides step-by-step guide to help you to create a Console resourc
99101
[--expiration "${CONSOLE_EXPIRATION_TIME}"]
100102
```
101103

102-
If you omit the `--expiration` parameter, the expiration will be defaulted to one day after the creation of the Console resource. Also note that the `expiration` date & time format **must** comply with RFC3339 otherwise the creation of the Console resource fails.
104+
If you omit the `--expiration` parameter, the expiration will be defaulted to one day after the creation of the Console resource. Also note that the `expiration` date & time format **must** follow RFC3339 (e.g., 2024-10-04T14:48:00Z) otherwise the creation of the Console resource fails.
103105

104106
> [!NOTE]
105107
> For a complete synopsis for this command, invoke `az networkcloud console create --help`.
@@ -127,7 +129,7 @@ This section provides step-by-step guide to help you to create a Console resourc
127129

128130
## Establishing Private Network Connectivity
129131

130-
In order to establish a secure session with a Virtual Machine, you need to establish private network connectivity between your network and the Cluster Manager's private network.
132+
To establish a secure session with a Virtual Machine, you need to establish private network connectivity between your network and the Cluster Manager's private network.
131133
132134
This private network relies on the Azure Private Link Endpoint (PLE) and the Azure Private Link Service (PLS).
133135
@@ -167,7 +169,7 @@ This section provides a step-by-step guide to help you to establish a private ne
167169

168170
At this point, you have the `virtual_machine_access_id` and the `sshmux_ple_ip`. This input is the info needed for establishing a session with the VM.
169171

170-
The VM Console service is a `ssh` server that "relays" the session to the designated VM. The `sshmux_ple_ip` indirectly references the VM Console service and the `virtual_machine_access_id` the identifier for the VM.
172+
The VM Console service is a `ssh` server that "relays" the session to a Nexus VM. The `sshmux_ple_ip` indirectly references the VM Console service and the `virtual_machine_access_id` the identifier for the VM.
171173

172174
> [!IMPORTANT]
173175
> The VM Console service listens to port `2222`, therefore you **must** specify this port number in the `ssh` command.
@@ -185,7 +187,7 @@ The VM Console service was designed to allow **only** one session per Virtual Ma
185187

186188
## Updating Console Resource
187189

188-
You can disable the session to a given VM by updating the expiration date/time and/or updating the public SSH key used when creating the session with a VM.
190+
You can disable the session to a VM by updating the expiration date/time and the public SSH key used when creating the session with a VM.
189191

190192
```bash
191193
az networkcloud virtualmachine console update \
@@ -196,14 +198,14 @@ az networkcloud virtualmachine console update \
196198
[--expiration "${CONSOLE_EXPIRATION_TIME}"]
197199
```
198200

199-
If you want to disable access to a VM, you need to update the Console resource with the parameter `enabled False`. This update closes any existing session and restricts any subsequent sessions.
201+
If you want to disable access to a VM, you need to update the Console resource with the parameter `enabled False`. This update closes any existing session and restricts any later sessions.
200202

201203
> [!NOTE]
202204
> Before creating a session to a VM, the corresponding Console resource **must** be set to `--enabled True`.
203205

204206
When a Console `--expiration` time expires, it closes any session corresponding the Console resource. You'll need to update the expiration time with a future value so that you can establish a new session.
205207
206-
When you update the Console's public SSH key, the VM Console service closes any active session referenced by the Console resource. You have to provide a matching private SSH key matching the new public key when you establish a new session.
208+
When you update the Console's public SSH key, the VM Console service closes all active sessions. You present a new private SSH key to create a new session.
207209

208210
## Cleaning Up (Optional)
209211

0 commit comments

Comments
 (0)