Azure / Azure/azure-cli-extensions

az image copy failed on a snapshot creation

Open
#4,108 1 comment 0 reactions 2 assignees Claimed by @zhoxing-ms View on GitHub
Compute customer-reported feature-request
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### **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:**
```
Command '['/usr/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'tnsr-Ubuntu-20.04-b1652_os_disk_snapshot', '--location', 'southcentralus', '--resource-group', 'CentralUSBlobs', '--source', '/subscriptions/2bc62acd-ee69-4f6d-97fd-a208b15c94b0/resourceGroups/Engineering-TNSR/providers/Microsoft.Compute/disks/tnsr-Ubuntu-20.04-b1652-disk', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.
Traceback (most recent call last):
...
```

## 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
```
Linux-3.10.0-1062.18.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core
Python 3.6.8
Installer: RPM

azure-cli 2.3.1

Extensions:
image-copy-extension 0.2.8

```
## Additional Context

```
Getting OS disk ID of the source VM/image
Creating source snapshot
command failed: ['/usr/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'tnsr-Ubuntu-20.04-b1652_os_disk_snapshot', '--location', 'southcentralus', '--resource-group', 'CentralUSBlobs', '--source', '/subscriptions/2bc62acd-ee69-4f6d-97fd-a208b15c94b0/resourceGroups/Engineering-TNSR/providers/Microsoft.Compute/disks/tnsr-Ubuntu-20.04-b1652-disk', '--output', 'json', '--tags', 'created_by=image-copy-extension']
output: Resource tnsr-Ubuntu-20.04-b1652-disk is not found.

The command failed with an unexpected error. Here is the traceback:

Command '['/usr/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'tnsr-Ubuntu-20.04-b1652_os_disk_snapshot', '--location', 'southcentralus', '--resource-group', 'CentralUSBlobs', '--source', '/subscriptions/2bc62acd-ee69-4f6d-97fd-a208b15c94b0/resourceGroups/Engineering-TNSR/providers/Microsoft.Compute/disks/tnsr-Ubuntu-20.04-b1652-disk', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 215, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 625, in execute
raise ex
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 689, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 682, in _run_job
six.reraise(*sys.exc_info())
File "/usr/lib64/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 659, in _run_job
result = cmd_copy(params)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 324, in __call__
return self.handler(*args, **kwargs)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 531, in default_command_handler
return op(**command_args)
File "/home/jaz/.azure/cliextensions/image-copy-extension/azext_imagecopy/custom.py", line 105, in imagecopy
run_cli_command(cli_cmd)
File "/home/jaz/.azure/cliextensions/image-copy-extension/azext_imagecopy/cli_utils.py", line 45, in run_cli_command
raise ex
File "/home/jaz/.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 "/usr/lib64/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib64/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'tnsr-Ubuntu-20.04-b1652_os_disk_snapshot', '--location', 'southcentralus', '--resource-group', 'CentralUSBlobs', '--source', '/subscriptions/2bc62acd-ee69-4f6d-97fd-a208b15c94b0/resourceGroups/Engineering-TNSR/providers/Microsoft.Compute/disks/tnsr-Ubuntu-20.04-b1652-disk', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.

To open an issue, please run: 'az feedback'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.