Skip to content

Az image copy extension fails while creating snapshot from Source blob uri #12177

Description

@manoj-murali

This is autogenerated. Please review and update as needed.

Describe the bug

Az image copy extension fails while creating snapshot from Source blob uri.
I see this was fixed in release Azure/azure-cli-extensions#1211 version 0.2.3 I reinstalled the extension still have the same issue

Error:

source_os_disk_type: BLOB. source_os_disk_id: https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd. source_os_type: Windows
Creating source snapshot
command failed: ['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'test_os_disk_snapshot', '--resource-group', 'AMITCS', '--source', 'https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd', '--output', 'json', '--tags', 'created_by=image-copy-extension']
output: ERROR: Required parameter 'storageAccountId' is missing (null).

Command Name
az snapshot create

Errors:

Required parameter 'storageAccountId' is missing (null).

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az image copy --source-resource-group {} --source-object-name {} --target-location {} --target-resource-group {} --debug
  • az snapshot create --name {} --resource-group {} --source {} --output {} --tags {}

Expected Behavior

Environment Summary

Linux-4.15.0-1069-azure-x86_64-with-debian-stretch-sid
Python 3.6.5
Shell: bash

azure-cli 2.0.81

Extensions:
image-copy-extension 0.2.3

Additional Context

Debug Output

az image copy --source-resource-group AMITCS --source-object-name test --target-location uksouth --target-resource-group amitvmss1 --debug
Command arguments: ['image', 'copy', '--source-resource-group', 'AMITCS', '--source-object-name', 'test', '--target-location', 'uksouth', '--target-resource-group', 'amitvmss1', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7eff086dad08>, <function OutputProducer.on_global_arguments at 0x7eff08212ae8>, <function CLIQuery.on_global_argumentsat 0x7eff08240b70>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.005 seconds.
Loaded module 'acs' in 0.017 seconds.
Loaded module 'advisor' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.005 seconds.
Loaded module 'apim' in 0.001 seconds.
Loaded module 'appconfig' in 0.002 seconds.
Loaded module 'appservice' in 0.009 seconds.
Loaded module 'backup' in 0.004 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.008 seconds.
Loaded module 'batchai' in 0.003 seconds.
Loaded module 'billing' in 0.001 seconds.
Loaded module 'botservice' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.003 seconds.
Loaded module 'cloud' in 0.001 seconds.
Loaded module 'cognitiveservices' in 0.002 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.002 seconds.
Loaded module 'container' in 0.002 seconds.
Loaded module 'cosmosdb' in 0.007 seconds.
Loaded module 'deploymentmanager' in 0.002 seconds.
Loaded module 'dla' in 0.004 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.002 seconds.
Loaded module 'eventhubs' in 0.003 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.001 seconds.
Loaded module 'hdinsight' in 0.002 seconds.
Loaded module 'interactive' in 0.000 seconds.
Loaded module 'iot' in 0.005 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.005 seconds.
Loaded module 'kusto' in 0.002 seconds.
Loaded module 'lab' in 0.003 seconds.
Loaded module 'managedservices' in 0.001 seconds.
Loaded module 'maps' in 0.001 seconds.
Loaded module 'monitor' in 0.005 seconds.
Loaded module 'natgateway' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'netappfiles' in 0.003 seconds.
Loaded module 'network' in 0.030 seconds.
Loaded module 'policyinsights' in 0.002 seconds.
Loaded module 'privatedns' in 0.004 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.006 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.004 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.006 seconds.
Loaded module 'role' in 0.004 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'security' in 0.002 seconds.
Loaded module 'servicebus' in 0.005 seconds.
Loaded module 'servicefabric' in 0.003 seconds.
Loaded module 'signalr' in 0.002 seconds.
Loaded module 'sql' in 0.008 seconds.
Loaded module 'sqlvm' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.030 seconds.
Loaded module 'vm' in 0.014 seconds.
Loaded all modules in 0.255 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/manoj/.azure/cliextensions'
Found 1 extensions: ['image-copy-extension']
Extensions directory: '/home/manoj/.azure/cliextensions'
Extension compatibility result: is_compatible=True cli_core_version=2.0.81 min_required=2.0.24 max_required=None
Extensions directory: '/home/manoj/.azure/cliextensions'
Loaded extension 'image-copy-extension' in 0.001 seconds.
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7eff07a27510>]
az_command_data_logger : command args: image copy --source-resource-group {} --source-object-name {} --target-location {} --target-resource-group {} --debug
metadata file logging enabled - writing logs to '/home/manoj/.azure/commands'.
Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7eff079c41e0>]
Event: CommandInvoker.OnPostArgumentLoad []
Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7eff079f5ea0>, <function register_cache_arguments..add_cache_arguments at 0x7eff0798a048>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7eff05b3c488>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7eff08212b70>, <function CLIQuery.handle_query_parameter at 0x7eff08240bf8>, <function register_ids_argument..parse_ids_arguments at 0x7eff079f5e18>, <function handler at 0x7eff05a0c488>]
Extensions directory: '/home/manoj/.azure/cliextensions'
Extensions directory: '/home/manoj/.azure/cliextensions'
az_command_data_logger : extension name: image-copy-extension
az_command_data_logger : extension version: 0.2.3
Getting os disk id of the source vm/image
command: ['/opt/az/bin/python3', '-m', 'azure.cli', 'image', 'show', '--name', 'test', '--resource-group', 'AMITCS', '--output', 'json'] ended with output: {
"hyperVgeneration": null,
"id": "/subscriptions/5d905227-56ea-4b6b-8ae7-f1b0405f5822/resourceGroups/AMITCS/providers/Microsoft.Compute/images/test",
"location": "centralus",
"name": "test",
"provisioningState": "Succeeded",
"resourceGroup": "AMITCS",
"sourceVirtualMachine": null,
"storageProfile": {
"dataDisks": [],
"osDisk": {
"blobUri": "https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd",
"caching": "ReadWrite",
"diskEncryptionSet": null,
"diskSizeGb": 20,
"managedDisk": null,
"osState": "Generalized",
"osType": "Windows",
"snapshot": null,
"storageAccountType": "Standard_LRS"
},
"zoneResilient": false
},
"tags": null,
"type": "Microsoft.Compute/images"
}

json output starts at position: 0
found BLOB: https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd
source_os_disk_type: BLOB. source_os_disk_id: https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd. source_os_type: Windows
Creating source snapshot
command failed: ['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'test_os_disk_snapshot', '--resource-group', 'AMITCS', '--source', 'https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd', '--output', 'json', '--tags', 'created_by=image-copy-extension']
output: ERROR: Required parameter 'storageAccountId' is missing (null).

cli.azure.cli.core.util : The command failed with an unexpected error. Here is the traceback:

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

cli.azure.cli.core.util : Command '['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'test_os_disk_snapshot', '--resource-group', 'AMITCS', '--source', 'https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd', '--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 206, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 608, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 666, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 659, in _run_job
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 636, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 306, in call
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py", line 493, in default_command_handler
return op(**command_args)
File "/home/manoj/.azure/cliextensions/image-copy-extension/azext_imagecopy/custom.py", line 83, in imagecopy
run_cli_command(cli_cmd)
File "/home/manoj/.azure/cliextensions/image-copy-extension/azext_imagecopy/cli_utils.py", line 46, in run_cli_command
raise ex
File "/home/manoj/.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', 'test_os_disk_snapshot', '--resource-group', 'AMITCS', '--source', 'https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.
Command '['/opt/az/bin/python3', '-m', 'azure.cli', 'snapshot', 'create', '--name', 'test_os_disk_snapshot', '--resource-group', 'AMITCS', '--source', 'https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd', '--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 206, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 608, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 666, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 659, in _run_job
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 636, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 306, in call
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py", line 493, in default_command_handler
return op(**command_args)
File "/home/manoj/.azure/cliextensions/image-copy-extension/azext_imagecopy/custom.py", line 83, in imagecopy
run_cli_command(cli_cmd)
File "/home/manoj/.azure/cliextensions/image-copy-extension/azext_imagecopy/cli_utils.py", line 46, in run_cli_command
raise ex
File "/home/manoj/.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', 'test_os_disk_snapshot', '--resource-group', 'AMITCS', '--source', 'https://amitcsdisks447.blob.core.windows.net/vhds/windowsxpFixed.vhd', '--output', 'json', '--tags', 'created_by=image-copy-extension']' returned non-zero exit status 1.
cli.azure.cli.core.util :
To open an issue, please run: 'az feedback'

To open an issue, please run: 'az feedback'
az_command_data_logger : exit code: 1
telemetry.save : Save telemetry record of length 2575 in cache
telemetry.check : Negative: The /home/manoj/.azure/telemetry.txt was modified at 2020-02-13 10:08:05.604122, which in less than 600.000000 s
command ran in 14.212 seconds.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions