image-copy-extension - ERROR: Resource <temp-resource-group> is not found
See original GitHub issue- If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at Azure/azure-cli
Extension name (the extension in question)
[ { “extensionType”: “whl”, “name”: “image-copy-extension”, “version”: “0.0.8” } ]
Description of issue (in as much detail as possible)
I’m trying to copy image from one subscription to another under the same tenant, where the location of source and target image is different.
Triggered the below command:
az image copy --source-resource-group Images --source-object-name SourceImage --target-name TargetImage --target-location eastus --target-resource-group Images --target-subscription <target-subscription-id>
Output:
Getting os disk id of the source vm/image
Creating source snapshot
command failed: ['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'SourceImage_os_disk_snapshot', '--resource-group', 'Images', '--source', '/subscriptions/<source-subscription-id>/resourceGroups/packer-Resource-Group-2f7zlqhv52/providers/Microsoft.Compute/disks/pkros2f7zlqhv52', '--output', 'json', '--tags', 'created_by=image-copy-extension']
output: ERROR: Resource pkros2f7zlqhv52 is not found.
Command '['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'SourceImage_os_disk_snapshot', '--resource-group', 'Images', '--source', '/subscriptions/<source-subscription-id>/resourceGroups/packer-Resource-Group-2f7zlqhv52/providers/Microsoft.Compute/disks/pkros2f7zlqhv52', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 197, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 369, in execute
six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 343, in execute
result = cmd(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 182, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 436, in default_command_handler
result = op(**command_args)
File "/home/packer/.azure/cliextensions/image-copy-extension/azext_imagecopy/custom.py", line 78, in imagecopy
run_cli_command(cli_cmd)
File "/home/packer/.azure/cliextensions/image-copy-extension/azext_imagecopy/cli_utils.py", line 35, in run_cli_command
raise ex
File "/home/packer/.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.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/opt/az/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'SourceImage_os_disk_snapshot', '--resource-group', 'Images', '--source', '/subscriptions/<source-subscription-id>/resourceGroups/packer-Resource-Group-2f7zlqhv52/providers/Microsoft.Compute/disks/pkros2f7zlqhv52', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m closing this @tamirkamara . I don’t think you can help here since this is something Azure sucks at. They should reaaaallly think about use cases when providing features like Images, rather than having people go for workarounds for something as basic of a use case as this. Thank you for your help. I think you have developed something very nice here. Just doesn’t fit in my use-case 😃
Hi,
Looks like it doesn’t find the source disk resource: /subscriptions/<source-subscription-id>/resourceGroups/packer-Resource-Group-2f7zlqhv52/providers/Microsoft.Compute/disks/pkros2f7zlqhv52
If I remember currently packer creates the image and then removes the resources used to get there. If that’s right it means that the disk (of the vm) is no longer present and that is required for this extension to work…