-
Notifications
You must be signed in to change notification settings - Fork 1.5k
vm-repair : Using run command to enable nested vm #3128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
fb828e5
Checking in nested script
haagha 34f9dcf
hyperv changes
haagha b092336
Merge branch 'master' of https://github.com/Azure/azure-cli-extensions
haagha 38b4e96
adding exceptions and methods
haagha 35f8b19
Merge branch 'master' of https://github.com/Azure/azure-cli-extensions
haagha 711e620
logger changes
haagha c4312d5
Merge branch 'master' of https://github.com/Azure/azure-cli-extensions
haagha 99f3363
commit changes for enable-nested
haagha d037613
Merge branch 'master' of https://github.com/Azure/azure-cli-extensions
haagha 1b32df6
style changes
haagha 9bce5b7
validating vm is windows
haagha 8db2755
styling fixes
haagha b4ff15b
Update src/vm-repair/azext_vm_repair/_validators.py
haagha 20ee06e
Update src/vm-repair/azext_vm_repair/custom.py
haagha c674ec3
Using run command to enable nested VM
haagha a6b79a1
Merge branch 'master' of https://github.com/haagha/azure-cli-extensions
haagha f624477
removing status
haagha 15ad470
Merge branch 'master' of https://github.com/Azure/azure-cli-extensions
haagha 9ecce9c
Style Check
haagha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,29 +169,27 @@ def create(cmd, vm_name, resource_group_name, repair_password=None, repair_usern | |
|
|
||
| # invoke enable-NestedHyperV.ps1 again to attach Disk to Nested | ||
| if enable_nested: | ||
| logger.info("Running hyperv") | ||
| logger.info("Running Script win-enable-nested-hyperv.ps1 to install HyperV") | ||
|
|
||
| stdout, stderr = _invoke_run_command("win-enable-nested-hyperv.ps1", repair_vm_name, repair_group_name, 0) | ||
| logger.debug("stderr: %s", stderr) | ||
| if stderr: | ||
| logger.debug(stderr) | ||
| raise ScriptReturnsError('Error when running script') | ||
| run_hyperv_command = "az vm repair run -g {g} -n {name} --run-id win-enable-nested-hyperv" \ | ||
| .format(g=repair_group_name, name=repair_vm_name) | ||
| ret_enable_nested = _call_az_command(run_hyperv_command) | ||
|
|
||
| logger.debug("stdout: %s", stdout) | ||
| if str.find(stdout, "SuccessRestartRequired") > -1: | ||
| logger.debug("az vm repair run hyperv command returned: %s", ret_enable_nested) | ||
|
|
||
| if str.find(ret_enable_nested, "SuccessRestartRequired") > -1: | ||
| restart_cmd = 'az vm restart -g {rg} -n {vm}'.format(rg=repair_group_name, vm=repair_vm_name) | ||
| logger.info("restarting") | ||
| logger.info("Restarting Repair VM") | ||
| restart_ret = _call_az_command(restart_cmd) | ||
| logger.info(restart_ret) | ||
| logger.debug(restart_ret) | ||
|
|
||
| # invoking hyperv script again | ||
| logger.info("Running HyperV script again") | ||
| stdout, stderr = _invoke_run_command("win-enable-nested-hyperv.ps1", repair_vm_name, repair_group_name, 0) | ||
| if stderr: | ||
| raise ScriptReturnsError('Error when running script') | ||
| logger.info("Running win-enable-nested-hyperv.ps1 again to create nested VM") | ||
| run_hyperv_command = "az vm repair run -g {g} -n {name} --run-id win-enable-nested-hyperv" \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I find it. This line invokes win-enable-nested-hyperv.ps1. I searched win-enable-nested-hyperv.ps1 and didn't find occurrence. |
||
| .format(g=repair_group_name, name=repair_vm_name) | ||
| ret_enable_nested_again = _call_az_command(run_hyperv_command) | ||
|
|
||
| logger.debug("stderr: %s", stderr) | ||
| print(stdout) | ||
| logger.debug("stderr: %s", ret_enable_nested_again) | ||
|
|
||
| created_resources = _list_resource_ids_in_rg(repair_group_name) | ||
| command.set_status_success() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.