Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/command_modules/azure-cli-vm/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ unreleased
----------
* diagnostics: Fix incorrect Linux diagnostics default config with update for LAD v.3.0 extension
* disk: support cross subscription blob import
* disk: add --no-wait flag to disk create, update, and delete.
* disk: add `az disk wait` command.
* BC: disk: add confirmation prompt to `az disk delete`.
* vm: support license type on create
* BC: vm open-port: command always returns the NSG. Previously it returned the NIC or Subnet.
* vm: fix "vm extension list" crash if the VM has no extensions
* vmss: update arg description for 'vmss delete-instances --instance-ids'
* vmss: hide arg 'vmss show --ids', which is not supposed to work because of 'instance-id' arg


2.0.6 (2017-05-09)
++++++++++++++++++
* Minor fixes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,12 @@
short-summary: Update a managed disk.
"""

helps['disk wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the managed disk is met.
"""


helps['disk grant-access'] = """
type: command
short-summary: Grant read access to a managed disk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,18 @@ def transform_av_set_collection_output(av_sets):
# VM Disk
op_var = 'disks_operations'
op_class = 'DisksOperations'
cli_command(__name__, 'disk create', custom_path.format('create_managed_disk'))
cli_command(__name__, 'disk create', custom_path.format('create_managed_disk'), no_wait_param='no_wait')
cli_command(__name__, 'disk list', custom_path.format('list_managed_disks'))
cli_command(__name__, 'disk show', mgmt_path.format(op_var, op_class, 'get'), cf_disks, exception_handler=empty_on_404)
cli_command(__name__, 'disk delete', mgmt_path.format(op_var, op_class, 'delete'), cf_disks)
cli_command(__name__, 'disk delete', mgmt_path.format(op_var, op_class, 'delete'), cf_disks, no_wait_param='raw', confirmation=True)
cli_command(__name__, 'disk grant-access', custom_path.format('grant_disk_access'))
cli_command(__name__, 'disk revoke-access', mgmt_path.format(op_var, op_class, 'revoke_access'), cf_disks)
cli_generic_update_command(__name__, 'disk update', 'azure.mgmt.compute.compute.operations.{}#{}.get'.format(op_var, op_class),
'azure.mgmt.compute.compute.operations.{}#{}.create_or_update'.format(op_var, op_class),
custom_function_op=custom_path.format('update_managed_disk'),
setter_arg_name='disk', factory=cf_disks)
setter_arg_name='disk', factory=cf_disks, no_wait_param='raw')
cli_generic_wait_command(__name__, 'disk wait', 'azure.mgmt.compute.compute.operations.{}#{}.get'.format(op_var, op_class), cf_disks)

op_var = 'snapshots_operations'
op_class = 'SnapshotsOperations'
cli_command(__name__, 'snapshot create', custom_path.format('create_snapshot'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def create_managed_disk(resource_group_name, disk_name, location=None,
source=None, # pylint: disable=unused-argument
# below are generated internally from 'source'
source_blob_uri=None, source_disk=None, source_snapshot=None,
source_storage_account_id=None):
source_storage_account_id=None, no_wait=False):
from azure.mgmt.compute.models import Disk, CreationData, DiskCreateOption, ImageDiskReference
location = location or get_resource_group_location(resource_group_name)
if source_blob_uri:
Expand All @@ -319,7 +319,7 @@ def create_managed_disk(resource_group_name, disk_name, location=None,
disk = Disk(location, disk_size_gb=size_gb, creation_data=creation_data,
account_type=sku)
client = _compute_client_factory()
return client.disks.create_or_update(resource_group_name, disk_name, disk)
return client.disks.create_or_update(resource_group_name, disk_name, disk, raw=no_wait)


def update_managed_disk(instance, size_gb=None, sku=None):
Expand Down