|
| 1 | +--- |
| 2 | +title: "Azure Operator Nexus: Gather VM Console Data" |
| 3 | +description: Learn how to gather VM Console Data. |
| 4 | +author: keithritchie |
| 5 | +ms.author: keithritchie |
| 6 | +ms.service: azure-operator-nexus |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 11/26/2024 |
| 9 | +--- |
| 10 | + |
| 11 | +# Gathering Important Virtual Machine (VM) Console Data |
| 12 | + |
| 13 | +The article provides generic guidance on how to collect data necessary for diagnosing VM console-related issues. |
| 14 | + |
| 15 | +## Prerequisites to complete these procedures |
| 16 | + |
| 17 | +In order to `ssh` to a virtual machine, you must have: |
| 18 | + |
| 19 | +1. Created a `Private endpoint` connecting to the Cluster Manager's `Private link service` |
| 20 | +1. Virtual machine instance with a given name |
| 21 | +1. Created the corresponding Console with same name used for the virtual machine |
| 22 | + |
| 23 | +## Data Collection |
| 24 | + |
| 25 | +### Data needed by the VM Console service team for troubleshooting |
| 26 | + |
| 27 | +If there's a problem that needs to further investigation by the VM Console service team, collect the following information to help them get started: |
| 28 | + |
| 29 | +1. A detailed description of the problem and its affect to the customer. |
| 30 | +1. Screenshots. The Azure portal is obviously a visual component. Try to get as much visual data as possible to describe the problem happening. Screenshots are often the best way to show the problem or how to reproduce the problem. |
| 31 | +1. [Private Endpoint IP](#determining-the-private-endpoint-ip-address) |
| 32 | +1. [Private Endpoint connectivity](#determining-the-private-endpoint-connectivity) |
| 33 | +1. [Collecting Console Data](#collecting-the-console-data) |
| 34 | + |
| 35 | +### Determining the private endpoint connectivity |
| 36 | + |
| 37 | +1. Navigate to the Azure portal where customer's work environment is located. |
| 38 | +1. Select the Private endpoint resource used for `ssh` to the virtual machine |
| 39 | +  |
| 40 | +1. In the Private endpoint screen, select the `Private link resource` |
| 41 | +  |
| 42 | +1. Capture screenshot of `Private link resource` screen. Example of screenshot provided. |
| 43 | +  |
| 44 | +1. Confirm with the customer that `Private endpoint` is referencing the correct `Private Link Service`, as it's possible that customer might be using the wrong PLE when trying to `ssh` to a virtual machine. |
| 45 | + |
| 46 | +### Determining the private endpoint IP address |
| 47 | + |
| 48 | +1. Navigate to the Azure portal where customer's work environment is located. |
| 49 | +1. Select the Private endpoint resource used for `ssh` to the virtual machine |
| 50 | +  |
| 51 | +1. In the Private endpoint screen, select the `Network interface` |
| 52 | +  |
| 53 | +1. In that screen you'll find the `Private IPv4 address`, for example, `10.1.0.5` |
| 54 | +  |
| 55 | +1. Confirm with customer that whit IP address was in the `ssh` command, for example, `ssh -p 2222 <virtual machine access id>@10.1.0.5` |
| 56 | + |
| 57 | +Another way to retrieve the Private endpoint IP addresses is using Azure CLI, as shown here. |
| 58 | + |
| 59 | +```bash |
| 60 | +ple_interface_ids=$(az network private-endpoint list --resource-group <ple resource group> --query "[].networkInterfaces[0].id" -o tsv) |
| 61 | + |
| 62 | +for ple_interface_id in $ple_interface_ids; do |
| 63 | + ple_name=$(echo $ple_interface_id | awk -F/ '{print $NF}'| awk -F. '{print $1}') |
| 64 | + export sshmux_ple_ip=$(az network nic show --ids $ple_interface_id --query 'ipConfigurations[0].privateIPAddress' -o tsv) |
| 65 | + echo "ple name: ${ple_name}, ple ip: ${sshmux_ple_ip}" |
| 66 | +done |
| 67 | +``` |
| 68 | + |
| 69 | +In case the script option is used, ask the customer which private endpoint ip address was used. |
| 70 | + |
| 71 | +### Collecting the Console data |
| 72 | + |
| 73 | +1. Navigate to the Azure portal where the cluster manager is located. |
| 74 | +1. Select on `Extended location` to view its extended locations. |
| 75 | +  |
| 76 | +1. Select the Console resource in question. |
| 77 | +  |
| 78 | +1. Collect the data for the console resource to be investigated. |
| 79 | + 1. Console `Enabled` |
| 80 | + 1. Console `Expiration` |
| 81 | + 1. Console `Ssh public key` |
| 82 | + 1. Console `Virtual machine access ID |
| 83 | +  |
| 84 | + |
| 85 | +If the access to Azure portal isn't available, you may also to retrieve the Console data with `az networkcloud virtualmachine console show` command. |
| 86 | + |
| 87 | +```bash |
| 88 | +az networkcloud virtualmachine console show \ |
| 89 | + --resource-group "${TARGET_RESOURCE_GROUP}" \ |
| 90 | + --virtual-machine-name "${VM_NAME}" |
| 91 | +``` |
| 92 | + |
| 93 | +Where: |
| 94 | + |
| 95 | +- **TARGET_RESOURCE_GROUP** is the resource group where the customer's virtual machine was created |
| 96 | +- **VM_NAME** is the name of the customer's virtual machine name |
0 commit comments