forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_help.py
More file actions
123 lines (115 loc) · 6.36 KB
/
_help.py
File metadata and controls
123 lines (115 loc) · 6.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.help_files import helps
helps['vm repair'] = """
type: group
short-summary: Setup repair VMs with copied source OS Disk to resolve issues.
long-summary: |
When your VM is non-bootable, VM Repair enables users to setup new repair VMs and copy over the source VM's OS Disk and attach it as a data disk. Then the user can run their own scripts or use [pre-built](https://github.com/Azure/repair-script-library) ones to fix the disk.
"""
helps['vm repair create'] = """
type: command
short-summary: Create a new repair VM and attach the source VM's copied OS disk as a data disk.
examples:
- name: Create a repair VM
text: >
az vm repair create -g MyResourceGroup -n myVM --verbose
- name: Create a repair VM and set the VM authentication
text: >
az vm repair create -g MyResourceGroup -n myVM --repair-username username --repair-password password!234 --verbose
- name: Create a repair VM of a specific distro or a specific URN could also be provided
text: >
az vm repair create -g MyResourceGroup -n myVM --distro 'rhel7|sles12|ubuntu20|centos6|oracle8|sles15'
- name: Create a repair VM with a Private IP address without any pop up asking for confirmation.
text: >
az vm repair create -g MyResourceGroup -n myVM --yes --repair-username <username> --repair-password <password>
- name: Create a repair VM with a Public IP address without any user input.
text: >
az vm repair create -g MyResourceGroup -n myVM --associate-public-ip --yes --repair-username <username> --repair-password <password>
- name: Create a repair VM with Standard Security type.
text: >
az vm repair create -g MyResourceGroup -n myVM --yes --repair-username <username> --repair-password <password> --disable-trusted-launch
- name: Create a repair VM from a source VM with an encrypted disk. The repair VM is created with the data disk unencrypted and accessible.
text: >
az vm repair create -g MyResourceGroup -n myVM --yes --repair-username <username> --repair-password <password> --unlock-encrypted-vm --encrypt-recovery-key <key>
"""
helps['vm repair restore'] = """
type: command
short-summary: Replace source VM's OS disk with data disk from repair VM.
examples:
- name: Restore from the repair VM, command will auto-search for repair-vm
text: >
az vm repair restore -g MyResourceGroup -n MyVM --verbose
- name: Restore from the repair VM, specify the disk to restore
text: >
az vm repair restore -g MyResourceGroup -n MyVM --disk-name MyDiskCopy --verbose
"""
helps['vm repair run'] = """
type: command
short-summary: Run verified scripts from GitHub on a VM. 'az vm repair list-scripts' to view available scripts.
examples:
- name: Run the script with <run-id> directly on the VM.
text: >
az vm repair run -g MyResourceGroup -n MySourceWinVM --run-id win-hello-world --verbose
- name: Run the script with <run-id> on the linked repair VM.
text: >
az vm repair run -g MyResourceGroup -n MySourceWinVM --run-id win-hello-world --run-on-repair --verbose
- name: Run a script with parameters on the VM.
text: >
az vm repair run -g MyResourceGroup -n MySourceWinVM --run-id win-hello-world --parameters hello=hi world=earth --verbose
- name: Run a local custom script on the VM.
text: >
az vm repair run -g MyResourceGroup -n MySourceWinVM --custom-script-file ./file.ps1 --verbose
- name: Run unverified script from your fork of https://github.com/Azure/repair-script-library
text: >
az vm repair run -g MyResourceGroup -n MySourceWinVM --preview "https://github.com/User/repair-script-library/blob/main/map.json" --run-id test
"""
helps['vm repair list-scripts'] = """
type: command
short-summary: List available scripts. Located https://github.com/Azure/repair-script-library
examples:
- name: List scripts
text: >
az vm repair list-scripts --verbose
- name: List windows scripts only.
text: >
az vm repair list-scripts --query "[?starts_with(id, 'win')]"
- name: List scripts with test in its description.
text: >
az vm repair list-scripts --query "[?contains(description, 'test')]"
- name: List unverified script from your fork of https://github.com/Azure/repair-script-library
text: >
az vm repair list-scripts --preview "https://github.com/User/repair-script-library/blob/main/map.json"
"""
helps['vm repair reset-nic'] = """
type: command
short-summary: Reset the network interface stack on the VM guest OS. https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/reset-network-interface
examples:
- name: Reset the VM guest NIC. Specify VM resource group and name.
text: >
az vm repair reset-nic -g MyResourceGroup -n MyVM --verbose
- name: Reset the VM guest NIC. Specify subscription id, VM resource group and name.
text: >
az vm repair reset-nic -g MyResourceGroup -n MyVM --subscription mySub --verbose
- name: Reset the VM guest NIC and auto-start the VM if it is not in running state.
text: >
az vm repair reset-nic -g MyResourceGroup -n MyVM --yes --verbose
"""
helps['vm repair repair-and-restore'] = """
type: command
short-summary: Repair and restore the VM.
examples:
- name: Repair and restore a VM.
text: >
az vm repair repair-and-restore --name vmrepairtest --resource-group MyResourceGroup --verbose
"""
helps['vm repair repair-button'] = """
type: command
short-summary: repair button script.
examples:
- name: repair-button.
text: >
az vm repair repair-button --name vmrepairtest --resource-group MyResourceGroup --button-command fstab --verbose
"""