Skip to content

Commit

Permalink
[Compute] Fix issues with VMSS and VM availability set update. (#2773)
Browse files Browse the repository at this point in the history
* Fix issues with VMSS and VM availability set update.

* Update help. Fix #2762.
  • Loading branch information
tjprescott committed Apr 5, 2017
1 parent fd8f785 commit fa855de
Show file tree
Hide file tree
Showing 8 changed files with 686 additions and 314 deletions.
28 changes: 28 additions & 0 deletions azure-cli.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@
<Folder Include="azure-cli-core\azure\cli\core\test_utils\" />
<Folder Include="azure-cli-core\tests\" />
<Folder Include="azure-cli-core\tests\__pycache__\" />
<Folder Include="azure-cli-nspkg\" />
<Folder Include="azure-cli-testsdk\" />
<Folder Include="azure-cli-testsdk\azure\" />
<Folder Include="azure-cli-testsdk\azure\cli\" />
Expand Down Expand Up @@ -788,17 +789,25 @@
<Folder Include="command_modules\azure-cli-dls\" />
</ItemGroup>
<ItemGroup>
<Content Include="azure-cli-core\HISTORY.rst" />
<Content Include="azure-cli-core\setup.cfg" />
<Content Include="azure-cli-nspkg\HISTORY.rst" />
<Content Include="azure-cli-testsdk\HISTORY.rst" />
<Content Include="azure-cli\az.completion.sh" />
<Content Include="azure-cli\HISTORY.rst" />
<Content Include="azure-cli\setup.cfg" />
<Content Include="command_modules\azure-cli-acr\azure\cli\command_modules\acr\template.json" />
<Content Include="command_modules\azure-cli-acr\HISTORY.rst" />
<Content Include="command_modules\azure-cli-acs\azure\cli\command_modules\acs\mgmt_acs\azuredeploy.json" />
<Content Include="command_modules\azure-cli-acs\azure\cli\command_modules\acs\mgmt_acs\swagger_create_acs.json" />
<Content Include="command_modules\azure-cli-acs\HISTORY.rst" />
<Content Include="command_modules\azure-cli-appservice\HISTORY.rst" />
<Content Include="command_modules\azure-cli-appservice\README.rst" />
<Content Include="command_modules\azure-cli-appservice\setup.cfg" />
<Content Include="command_modules\azure-cli-appservice\tests\sample_web\.gitignore" />
<Content Include="command_modules\azure-cli-appservice\tests\sample_web\package.json" />
<Content Include="command_modules\azure-cli-appservice\tests\sample_web\server.js" />
<Content Include="command_modules\azure-cli-batch\HISTORY.rst" />
<Content Include="command_modules\azure-cli-batch\tests\data\batch-pool-create-invalid.json" />
<Content Include="command_modules\azure-cli-batch\tests\data\batch-pool-create.json" />
<Content Include="command_modules\azure-cli-batch\tests\data\batch-pool-update.json" />
Expand All @@ -812,24 +821,35 @@
<Content Include="command_modules\azure-cli-batch\tests\data\batchtest.cer" />
<Content Include="command_modules\azure-cli-batch\tests\data\batchUpdatePool.json" />
<Content Include="command_modules\azure-cli-batch\tests\README.md" />
<Content Include="command_modules\azure-cli-cloud\HISTORY.rst" />
<Content Include="command_modules\azure-cli-component\HISTORY.rst" />
<Content Include="command_modules\azure-cli-configure\HISTORY.rst" />
<Content Include="command_modules\azure-cli-container\HISTORY.rst" />
<Content Include="command_modules\azure-cli-dla\HISTORY.rst" />
<Content Include="command_modules\azure-cli-dla\MANIFEST.in" />
<Content Include="command_modules\azure-cli-dla\README.rst" />
<Content Include="command_modules\azure-cli-dls\HISTORY.rst" />
<Content Include="command_modules\azure-cli-dls\MANIFEST.in" />
<Content Include="command_modules\azure-cli-dls\README.rst" />
<Content Include="command_modules\azure-cli-documentdb\HISTORY.rst" />
<Content Include="command_modules\azure-cli-feedback\HISTORY.rst" />
<Content Include="command_modules\azure-cli-find\HISTORY.rst" />
<Content Include="command_modules\azure-cli-find\MANIFEST.in" />
<Content Include="command_modules\azure-cli-find\README.rst" />
<Content Include="command_modules\azure-cli-find\setup.cfg" />
<Content Include="command_modules\azure-cli-iot\azure\cli\command_modules\iot\mgmt_iot_hub_device\swagger_iot_hub_device_identity.json" />
<Content Include="command_modules\azure-cli-iot\HISTORY.rst" />
<Content Include="command_modules\azure-cli-keyvault\HISTORY.rst" />
<Content Include="command_modules\azure-cli-keyvault\tests\policy.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\policy2.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\policy_import_pem.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\policy_import_pfx.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\policy_pending.json" />
<Content Include="command_modules\azure-cli-keyvault\tests\test_secret.txt" />
<Content Include="command_modules\azure-cli-lab\HISTORY.rst" />
<Content Include="command_modules\azure-cli-monitor\azure\cli\command_modules\monitor\autoscale-parameters-template.json" />
<Content Include="command_modules\azure-cli-monitor\HISTORY.rst" />
<Content Include="command_modules\azure-cli-network\HISTORY.rst" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\fail1.txt" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\fail2.txt" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\fail3.txt" />
Expand All @@ -840,15 +860,23 @@
<Content Include="command_modules\azure-cli-network\tests\zone_files\zone3.txt" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\zone4.txt" />
<Content Include="command_modules\azure-cli-network\tests\zone_files\zone5.txt" />
<Content Include="command_modules\azure-cli-profile\HISTORY.rst" />
<Content Include="command_modules\azure-cli-redis\HISTORY.rst" />
<Content Include="command_modules\azure-cli-resource\HISTORY.rst" />
<Content Include="command_modules\azure-cli-resource\tests\sample_policy_rule.json" />
<Content Include="command_modules\azure-cli-resource\tests\simple_deploy.json" />
<Content Include="command_modules\azure-cli-resource\tests\simple_deploy_parameters.json" />
<Content Include="command_modules\azure-cli-role\HISTORY.rst" />
<Content Include="command_modules\azure-cli-sql\HISTORY.rst" />
<Content Include="command_modules\azure-cli-storage\HISTORY.rst" />
<Content Include="command_modules\azure-cli-storage\tests\Readme.md" />
<Content Include="command_modules\azure-cli-storage\tests\scripts\purge_test_sample.sh" />
<Content Include="command_modules\azure-cli-storage\tests\scripts\run_integration.sh" />
<Content Include="command_modules\azure-cli-storage\tests\scripts\set_test_env.sh" />
<Content Include="command_modules\azure-cli-storage\tests\testfile.rst" />
<Content Include="command_modules\azure-cli-storage\tests\testpage.rst" />
<Content Include="command_modules\azure-cli-taskhelp\HISTORY.rst" />
<Content Include="command_modules\azure-cli-vm\HISTORY.rst" />
<Content Include="command_modules\azure-cli-vm\tests\aliases.json" />
<Content Include="command_modules\azure-cli-vm\tests\keyvault\policy.json" />
<Content Include="command_modules\azure-cli-vm\tests\sample-public.json" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from azure.cli.core.help_files import helps #pylint: disable=unused-import

#pylint: disable=line-too-long
#pylint: disable=line-too-long, too-many-lines
helps['lock'] = """
type: group
short-summary: Manage Azure locks.
Expand Down
1 change: 1 addition & 0 deletions src/command_modules/azure-cli-vm/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release History
2.0.3 (unreleased)
++++++++++++++++++
* vm/vmss: support create from a market place image which requires plan info(#1209)
* Fix bug with `vmss update` and `vm availability-set update`

2.0.2 (2017-04-03)
++++++++++++++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core.help_files import helps
# pylint: disable=line-too-long, too-many-lines

# pylint: disable=line-too-long
from azure.cli.core.help_files import helps

image_long_summary = """ URN aliases: CentOS, CoreOS, Debian, openSUSE, RHEL, SLES, UbuntuLTS, Win2008R2SP1, Win2012Datacenter, Win2012R2Datacenter.
Example URN: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest
Expand Down Expand Up @@ -146,7 +146,7 @@
long-summary: For more information, see https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-manage-availability.
examples:
- name: Create an availability set.
text: az vm availability-set create -n MyAvSet -g MyResourceGroup
text: az vm availability-set create -n MyAvSet -g MyResourceGroup --platform-fault-domain-count 2 --platform-update-domain-count 2
"""

helps['vm availability-set update'] = """
Expand Down Expand Up @@ -239,11 +239,6 @@
text: az <command> -n name -g group --remove networkProfile.networkInterfaces 3
""".format(generic_update_help)

helps['vm show'] = """
type: command
short-summary: Get information about an Azure Virtual Machine.
"""

helps['vmss get-instance-view'] = """
type: command
parameters:
Expand All @@ -258,13 +253,33 @@
short-summary: "One or more VM scale sets or specific VM instance IDs. If provided, no other 'Resource Id' arguments should be specified."
"""

helps['vmss disk'] = """
type: group
short-summary: Manage the managed data disks associated with a virtual machine scale set.
"""

helps['vmss nic'] = """
type: group
short-summary: Manage the network interfaces associated with a virtual machine scale set.
"""

helps['vmss show'] = """
type: command
parameters:
- name: --ids
short-summary: "One or more VM scale sets or specific VM instance IDs. If provided, no other 'Resource Id' arguments should be specified."
"""

helps['vmss update'] = """
type: command
short-summary: Update a virtual machine scale set.
"""

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

helps['vm convert'] = """
type: command
short-summary: Convert a VM with unmanaged disks to use managed disks.
Expand Down Expand Up @@ -445,7 +460,7 @@

helps['vm disk'] = """
type: group
short-summary: Manage the data disks attached to a VM.
short-summary: Manage the managed data disks attached to a VM.
long-summary: >
{0}
""".format(disk_long_summary)
Expand Down Expand Up @@ -506,6 +521,11 @@
text: az vm disk attach -g MyResourceGroup --vm-name MyVm --disk disk_name --new
"""

helps['vm encryption'] = """
type: group
short-summary: Manage encryption of VM disks.
"""

helps['vm extension'] = """
type: group
short-summary: Extend the functionality of your VMs with extensions.
Expand Down Expand Up @@ -842,6 +862,7 @@

helps['vm resize'] = """
type: command
short-summary: Update VM size.
examples:
- name: Resize a VM.
text: az vm resize -g MyResourceGroup -n MyVm --size Standard_DS3_v2
Expand All @@ -858,6 +879,7 @@

helps['vm show'] = """
type: command
short-summary: Show details of a VM.
examples:
- name: Show information about a VM.
text: az vm show -g MyResourceGroup -n MyVm -d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1473,17 +1473,18 @@ def availset_get(resource_group_name, name):
return _compute_client_factory().availability_sets.get(resource_group_name, name)


def availset_set(**kwargs):
return _compute_client_factory().availability_sets.create_or_update(**kwargs)
def availset_set(resource_group_name, name, **kwargs):
return _compute_client_factory().availability_sets.create_or_update(resource_group_name, name,
**kwargs)


def vmss_get(resource_group_name, name):
return _compute_client_factory().virtual_machine_scale_sets.get(resource_group_name, name)


def vmss_set(no_wait=False, **kwargs):
def vmss_set(resource_group_name, name, no_wait=False, **kwargs):
return _compute_client_factory().virtual_machine_scale_sets.create_or_update(
raw=no_wait, **kwargs)
resource_group_name, name, raw=no_wait, **kwargs)


def convert_av_set_to_managed_disk(resource_group_name, availability_set_name):
Expand Down
Loading

0 comments on commit fa855de

Please sign in to comment.