azure-cli-extensions
azure-cli-extensions copied to clipboard
Image copy to another region failed
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az image copy Extension Name: image-copy-extension. Version: 0.2.8.
Errors:
...
subprocess.py, ln 438, in run
subprocess.CalledProcessError: Command '['C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\python.exe', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'RG2021RH77-image-v2_os_disk_snapshot', '--location', 'westus', '--resource-group', 'MSCAzurePOCRG', '--source', '/subscriptions/146ea064-4d31-4a0e-95f2-c4226eb2ec0d/resourceGroups/MSCAzurePOCRG/providers/Microsoft.Compute/disks/RG2021rhtest_disk1_33f7e7c6948b40ca84b433a609678ad4', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 3.
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
-
az image copy --source-resource-group {} --source-object-name {} --target-location {} --target-resource-group {} --cleanup
Expected Behavior
Environment Summary
Windows-10-10.0.17763-SP0
Python 3.6.8
Installer: MSI
azure-cli 2.21.0
Extensions:
image-copy-extension 0.2.8
Additional Context
image copy extension
This bug was never fixed and it appears that the az image copy command isn't able to function at all - over a year later from these comments. It isn't a feature request; I don't think that can be disputed. It is a feature that exists and has been broken for years now without being fixed.
Correct command as specified by the documentation:
az image copy --source-resource-group CustomImagesRG ` --source-object-name Win10MultiV9.5-20220107 ` --target-resource-group CustomImagesRG ` --target-location eastus ` --target-subscription 12345678-1234-1234-1234-605185bb3005
Output:
Getting OS disk ID of the source VM/image Creating source snapshot command failed: ['/usr/bin/../../opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'Win10MultiV9.5-20220107_os_disk_snapshot', '--location', 'eastus', '--resource-group', 'CustomImagesRG', '--source', '/subscriptions/12345678-1234-1234-1234-605185bb3005/resourceGroups/AVDImageBuildRG/providers/Microsoft.Compute/disks/AVDImageBuild_OsDisk_1_4125c892f47a42c09530358ab9632b88', '--hyper-v-generation', 'V1', '--output', 'json', '--tags', 'created_by=image-copy-extension'] output: ERROR: (NotFound) Resource AVDImageBuild_OsDisk_1_4125c892f47a42c09530358ab9632b88 is not found. Code: NotFound Message: Resource AVDImageBuild_OsDisk_1_4125c892f47a42c09530358ab9632b88 is not found.
The command failed with an unexpected error. Here is the traceback: Command '['/usr/bin/../../opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'Win10MultiV9.5-20220107_os_disk_snapshot', '--location', 'eastus', '--resource-group', 'CustomImagesRG', '--source', '/subscriptions/12345678-1234-1234-1234-605185bb3005/resourceGroups/AVDImageBuildRG/providers/Microsoft.Compute/disks/AVDImageBuild_OsDisk_1_4125c892f47a42c09530358ab9632b88', '--hyper-v-generation', 'V1', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned >> non-zero exit status 3. Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, **kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/home/csp/.azure/cliextensions/image-copy-extension/azext_imagecopy/custom.py", line 108, in imagecopy run_cli_command(cli_cmd) File "/home/csp/.azure/cliextensions/image-copy-extension/azext_imagecopy/cli_utils.py", line 45, in run_cli_command raise ex File "/home/csp/.azure/cliextensions/image-copy-extension/azext_imagecopy/cli_utils.py", line 21, in run_cli_command cmd_output = check_output(cmd, stderr=STDOUT, universal_newlines=True) File "/opt/az/lib/python3.10/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/opt/az/lib/python3.10/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/usr/bin/../../opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'Win10MultiV9.5-20220107_os_disk_snapshot', '--location', 'eastus', '--resource-group', 'CustomImagesRG', '--source', '/subscriptions/12345678-1234-1234-1234-605185bb3005/resourceGroups/AVDImageBuildRG/providers/Microsoft.Compute/disks/AVDImageBuild_OsDisk_1_4125c892f47a42c09530358ab9632b88', '--hyper-v-generation', 'V1', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 3.