Skip to content
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

Unable to copy image to another resource group #1097

Closed
vikramaditya234 opened this issue Nov 14, 2019 · 8 comments
Closed

Unable to copy image to another resource group #1097

vikramaditya234 opened this issue Nov 14, 2019 · 8 comments
Assignees
Labels
extension/image-copy Service Attention This issue is responsible by Azure service team.

Comments

@vikramaditya234
Copy link

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.1.

Errors:

Command '['/usr/bin/python', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'optimizerredis-0.1.3_os_disk_snapshot', '--resource-group', 'sa-beta', '--source', u'https://factoryoptimizerred2235.blob.core.windows.net/vhds/optimizerredis-0.1.3.vhd', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1
Traceback (most recent call last):
python2.7/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
...

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-object-name {} --source-resource-group {} --target-location {} --target-resource-group {}

Expected Behavior

Environment Summary

Linux-4.14.146-119.123.amzn2.x86_64-x86_64-with-glibc2.2.5
Python 2.7.16
Shell: bash

azure-cli 2.0.75 *

Extensions:
image-copy-extension 0.2.1

Additional Context

@fengzhou-msft fengzhou-msft added the Service Attention This issue is responsible by Azure service team. label Nov 15, 2019
@tamirkamara
Copy link
Contributor

Hi @vikramaditya234,
Can you try the latest version of the extension 0.2.2 again? If it still fails, please run it with the --debug flag and post the information here.

@imabedalghafer
Copy link
Contributor

Hi @tamirkamara
I have been able to reproduce the issue with the latest version of the extension 0.2.2
I am using the cloud shell on the portal
below is the versions
image

I am not able to attach the debug logs as it is too much , would you please specify which section of the debug logs is needed and I could attach it.
you can also reproduce the issue by doing the same for Azure cloud shell.

P.S. checking on the release note of the latest CLI I can see that they have updated the snapshot API used : https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli?view=azure-cli-latest#compute , so it might be the source of the issue.

Thank you and looking forward to hear from you

Ibrahim Abedalghafer

@tamirkamara
Copy link
Contributor

tamirkamara commented Dec 13, 2019

I've confirmed that it is something with the changes in version 2.0.77 of the cli, and not the extension directly. Are you able to downgrade to version 76 until I could provide a fix?
@imabedalghafer @vikramaditya234

Related to: Azure/azure-cli#10737

@imabedalghafer
Copy link
Contributor

imabedalghafer commented Dec 13, 2019

Hi @tamirkamara

Thank you for your confirmation.
I have been looking at the code and on the file "azext_imagecopy/create_target.py"
I think (please let me know if I am getting it incorrectly) to add a new variable to get the storage account id that is created and then pass it to create the snapshot. as in below example :

json_output = run_cli_command(cli_cmd, return_as_json=True)
target_blob_endpoint = json_output['primaryEndpoints']['blob']
target_sa_id = json_output['id']

and on the command to create the new snapshot:
cli_cmd = prepare_cli_command(['snapshot', 'create',
'--resource-group', snapshot_resource_group_name,
'--name', target_snapshot_name,
'--location', location,
'--source', target_blob_path,
'--source-storage-account-id', target_sa_id ],
subscription=target_subscription)

if this is fine , should I create a PR for this change ?

@qwordy
Copy link
Member

qwordy commented Jan 6, 2020

Hi @tamirkamara

Thank you for your confirmation.
I have been looking at the code and on the file "azext_imagecopy/create_target.py"
I think (please let me know if I am getting it incorrectly) to add a new variable to get the storage account id that is created and then pass it to create the snapshot. as in below example :

json_output = run_cli_command(cli_cmd, return_as_json=True)
target_blob_endpoint = json_output['primaryEndpoints']['blob']
target_sa_id = json_output['id']

and on the command to create the new snapshot:
cli_cmd = prepare_cli_command(['snapshot', 'create',
'--resource-group', snapshot_resource_group_name,
'--name', target_snapshot_name,
'--location', location,
'--source', target_blob_path,
'--source-storage-account-id', target_sa_id ],
subscription=target_subscription)

if this is fine , should I create a PR for this change ?

I opened a PR to fix it. #1172
I find that your implementation is more elegant.

@imabedalghafer
Copy link
Contributor

Hi @qwordy ,

Thank you so much for the update, would you please let me know if there is an ETA when this fix will be released ?

Thank you
Ibrahim Abedalghafer

@qwordy
Copy link
Member

qwordy commented Jan 8, 2020

Hi @qwordy ,

Thank you so much for the update, would you please let me know if there is an ETA when this fix will be released ?

Thank you
Ibrahim Abedalghafer

The patch is in review now. Within one week by my estimation.

@qwordy
Copy link
Member

qwordy commented Mar 17, 2020

The patch is released several months ago. Hope it solves your issue. Close it now. If any problem, you can open a new issue or comment in this issue.

@qwordy qwordy closed this as completed Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension/image-copy Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants