Skip to content

az vm restart --help fails with Attribute disks does not exist #32087

@dod38fr

Description

@dod38fr

Describe the bug

The command az vm restart --help fails with Attribute disks does not exist

Related command

az vm restart --help

Errors

The command failed with an unexpected error. Here is the traceback:
Attribute disks does not exist.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 281, in getattr
return self._operations_groups_value[item]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'disks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 554, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/init.py", line 58, in load_arguments
load_arguments(self, command)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", line 37, in load_arguments
DiskStorageAccountTypes = self.get_models('DiskStorageAccountTypes', operation_group='disks')
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 809, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 493, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 485, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 283, in getattr
raise AttributeError('Attribute {} does not exist.'.format(item))
AttributeError: Attribute disks does not exist.
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

$ az vm restart --help --debug
cli.knack.cli: Command arguments: ['vm', 'restart', '--help', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f3aed231260>, <function OutputProducer.on_global_arguments at 0x7f3aed010f40>, <function CLIQuery.on_global_arguments at 0x7f3aed03f060>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'vm': ['azure.cli.command_modules.vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: vm 0.164 60 227
cli.azure.cli.core: Total (1) 0.164 60 227
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 60 groups, 227 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : vm restart
cli.azure.cli.core: Command table: vm restart
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f3aebf70c20>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/domi/.azure/commands/2025-09-09.17-08-56.vm_restart.238874.log'.
az_command_data_logger: command args: vm restart --help --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f3aebfc1ee0>]
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 281, in getattr
return self._operations_groups_value[item]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'disks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 554, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/init.py", line 58, in load_arguments
load_arguments(self, command)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", line 37, in load_arguments
DiskStorageAccountTypes = self.get_models('DiskStorageAccountTypes', operation_group='disks')
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 809, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 493, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 485, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 283, in getattr
raise AttributeError('Attribute {} does not exist.'.format(item))
AttributeError: Attribute disks does not exist.

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: Attribute disks does not exist.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 281, in getattr
return self._operations_groups_value[item]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'disks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 554, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/init.py", line 58, in load_arguments
load_arguments(self, command)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", line 37, in load_arguments
DiskStorageAccountTypes = self.get_models('DiskStorageAccountTypes', operation_group='disks')
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 809, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 493, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 485, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 283, in getattr
raise AttributeError('Attribute {} does not exist.'.format(item))
AttributeError: Attribute disks does not exist.
az_command_data_logger: Attribute disks does not exist.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 281, in getattr
return self._operations_groups_value[item]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'disks'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 554, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/init.py", line 58, in load_arguments
load_arguments(self, command)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/vm/_params.py", line 37, in load_arguments
DiskStorageAccountTypes = self.get_models('DiskStorageAccountTypes', operation_group='disks')
File "/usr/lib/python3/dist-packages/azure/cli/core/init.py", line 809, in get_models
return get_sdk(self.cli_ctx, resource_type, *attr_args, mod='models', operation_group=operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/init.py", line 91, in get_sdk
return _sdk_get_versioned_sdk(cli_ctx.cloud.profile, resource_type, *attr_args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 493, in get_versioned_sdk
sdk_path = get_versioned_sdk_path(api_profile, resource_type, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 485, in get_versioned_sdk_path
api_version = getattr(api_version, operation_group)
File "/usr/lib/python3/dist-packages/azure/cli/core/profiles/_shared.py", line 283, in getattr
raise AttributeError('Attribute {} does not exist.'.format(item))
AttributeError: Attribute disks does not exist.
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f3aebf70ea0>]
az_command_data_logger: exit code: 1
cli.azure.cli.main: Command ran in 0.385 seconds (init: 0.106, invoke: 0.278)
cli.azure.cli.core.decorators: Suppress exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/main.py", line 53, in
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/main.py", line 46, in
sys.exit(exit_code)
~~~~~~~~^^^^^^^^^^^
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/azure/cli/core/decorators.py", line 79, in _wrapped_func
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/telemetry.py", line 580, in _get_device_id
from deviceid import get_device_id
ModuleNotFoundError: No module named 'deviceid'

telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 7842 in cache file under /home/domi/.azure/telemetry/20250909170856186
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/python3 /usr/lib/python3/dist-packages/azure/cli/telemetry/init.py /home/domi/.azure /home/domi/.azure/telemetry/20250909170856186"
telemetry.process: Return from creating process 238894
telemetry.main: Finish creating telemetry upload process.

Expected behavior

I expected the command to show the inline help of az vm restart

Environment Summary

az --version
azure-cli 2.77.0

core 2.77.0
telemetry 1.1.0

Extensions:
aks-preview 14.0.0b4
azure-devops 1.0.1

Dependencies:
msal 1.32.3
azure-mgmt-resource 25.0.0b1

Python location '/usr/bin/python3'
Config directory '/home/domi/.azure'
Extensions directory '/home/domi/.azure/cliextensions'
Extensions system directory '/usr/lib/python3/dist-packages/azure-cli-extensions'

Python (Linux) 3.13.7 (main, Aug 20 2025, 22:17:40) [GCC 14.3.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

az cli was installed with Debian package on Debian/sid:

 dpkg -l *azure*
Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder
| État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements
|/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais)
||/ Nom                            Version        Architecture Description
+++-==============================-==============-============-=============================================================
ii  azure-cli                      2.77.0-1       all          Azure Command-Line Interface (CLI)
un  python-azure-doc               <aucune>       <aucune>     (aucune description n'est disponible)
ii  python3-azure                  20250829+git-1 all          Microsoft Azure SDK for Python 3.x
ii  python3-azure-cli              2.77.0-1       all          Azure Command-Line Interface (CLI) - commands modules
ii  python3-azure-cli-core         2.77.0-1       all          Azure Command-Line Interface (CLI) - core modules
ii  python3-azure-cli-telemetry    2.77.0-1       all          Azure Command-Line Interface (CLI) - telemetry modules
un  python3-azure-cosmos           <aucune>       <aucune>     (aucune description n'est disponible)
ii  python3-azure-datalake-store   1.0.1-1        all          Azure Data Lake Store Filesystem Library for Python
ii  python3-azure-multiapi-storage 1.5.0-1        all          Azure Storage Data Plane SDK supporting multiple API versions
ii  python3-azure-storage          20250829+git-1 all          Microsoft Azure Storage Library for Python 3.x
ii  python3-msrestazure            0.6.4-4        all          Runtime library for AutoRest generated Python 3.x clients

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions