|
| 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 | +# Gather 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 | +- Created a `Private endpoint` connecting to the Cluster Manager's `Private link service` |
| 20 | +- Virtual machine instance with a given name |
| 21 | +- 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 | +- A detailed description of the problem and its effect to the end user. |
| 30 | +- 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 | +- [Private Endpoint IP](#determine-the-private-endpoint-ip-address) |
| 32 | +- [Private Endpoint connectivity](#determine-the-private-endpoint-connectivity) |
| 33 | +- [Collecting Console Data](#collect-the-console-data) |
| 34 | + |
| 35 | +### Determine the private endpoint connectivity |
| 36 | + |
| 37 | +1. Navigate to the Azure portal where customer's work environment is located. |
| 38 | +2. Select the Private endpoint resource used for `ssh` to the virtual machine |
| 39 | + :::image type="content" source="media/vm-console-ple-ip-1.png" alt-text="Screenshot that shows the Private endpoint in its Resource Group."::: |
| 40 | +3. In the Private endpoint screen, select the `Private link resource` |
| 41 | + :::image type="content" source="media/vm-console-ple-connectivity-1.png" alt-text="Screenshot that shows the link to the Private link resource."::: |
| 42 | +4. Capture screenshot of `Private link resource` screen. |
| 43 | +5. 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. |
| 44 | + |
| 45 | +### Determine the private endpoint IP address |
| 46 | + |
| 47 | +1. Navigate to the Azure portal where customer's work environment is located. |
| 48 | +2. Select the Private endpoint resource used for `ssh` to the virtual machine |
| 49 | + :::image type="content" source="media/vm-console-ple-connectivity-1.png" alt-text="Screenshot that shows the link to the Private link resource for the Private endpoint."::: |
| 50 | +3. In the Private endpoint screen, select the `Network interface` |
| 51 | + :::image type="content" source="media/vm-console-ple-ip-2.png" alt-text="Screenshot that shows the details of the Private endpoint network interface."::: |
| 52 | +4. In that screen, you find the `Private IPv4 address`, for example, `10.1.0.5` |
| 53 | + :::image type="content" source="media/vm-console-ple-ip-3.png" alt-text="Screenshot that shows the details of the Private IPV4 address."::: |
| 54 | +5. 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` |
| 55 | + |
| 56 | +Another way to retrieve the Private endpoint IP addresses is using Azure CLI, as shown here. |
| 57 | + |
| 58 | +```bash |
| 59 | +ple_interface_ids=$(az network private-endpoint list --resource-group <ple resource group> --query "[].networkInterfaces[0].id" -o tsv) |
| 60 | + |
| 61 | +for ple_interface_id in $ple_interface_ids; do |
| 62 | + ple_name=$(echo $ple_interface_id | awk -F/ '{print $NF}'| awk -F. '{print $1}') |
| 63 | + export sshmux_ple_ip=$(az network nic show --ids $ple_interface_id --query 'ipConfigurations[0].privateIPAddress' -o tsv) |
| 64 | + echo "ple name: ${ple_name}, ple ip: ${sshmux_ple_ip}" |
| 65 | +done |
| 66 | +``` |
| 67 | + |
| 68 | +In case the script option is used, ask the customer which private endpoint ip address was used. |
| 69 | + |
| 70 | +### Collect the Console data |
| 71 | + |
| 72 | +1. Navigate to the Azure portal where the cluster manager is located. |
| 73 | +2. Select on `Extended location` to view its extended locations. |
| 74 | + :::image type="content" source="media/vm-console-resource-1.png" alt-text="Screenshot that shows the Extended location of the cluster manager."::: |
| 75 | +3. Select the Console resource in question. |
| 76 | + :::image type="content" source="media/vm-console-resource-2.png" alt-text="Screenshot that shows the link to console resource."::: |
| 77 | +4. Collect the data for the console resource to be investigated. |
| 78 | + - Console `Enabled` |
| 79 | + - Console `Expiration` |
| 80 | + - Console `Ssh public key` |
| 81 | + - Console `Virtual machine access ID` |
| 82 | + :::image type="content" source="media/vm-console-resource-3.png" alt-text="Screenshot that shows the console resource."::: |
| 83 | + |
| 84 | +If the access to Azure portal isn't available, you're also able to retrieve the Console data with `az networkcloud virtualmachine console show` command. |
| 85 | + |
| 86 | +```bash |
| 87 | +az networkcloud virtualmachine console show \ |
| 88 | + --resource-group "${TARGET_RESOURCE_GROUP}" \ |
| 89 | + --virtual-machine-name "${VM_NAME}" |
| 90 | +``` |
| 91 | + |
| 92 | +Where: |
| 93 | + |
| 94 | +- **TARGET_RESOURCE_GROUP** is the resource group where the customer's virtual machine was created |
| 95 | +- **VM_NAME** is the name of the customer's virtual machine name |
0 commit comments