diff --git a/azure-cli.pyproj b/azure-cli.pyproj index 729ddbf4a9c..6d815dfefbe 100644 --- a/azure-cli.pyproj +++ b/azure-cli.pyproj @@ -61,6 +61,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -197,6 +219,15 @@ + + + + + + + + + @@ -222,6 +253,20 @@ + + + + + + + + + + + + + + diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/generated.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/generated.py index 86efddfa4bb..5dd6bcfb796 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/generated.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/generated.py @@ -221,6 +221,15 @@ def __call__(self, parser, namespace, values, option_string=None): else: namespace.ssh_key_value = ssh_value +class VMDNSNameAction(argparse.Action): #pylint: disable=too-few-public-methods + def __call__(self, parser, namespace, values, option_string=None): + dns_value = values + + if dns_value: + namespace.dns_name_type = 'new' + + namespace.dns_name_for_public_ip = dns_value + extra_parameters = [ { 'name': '--image', @@ -229,6 +238,14 @@ def __call__(self, parser, namespace, values, option_string=None): { 'name': '--ssh-key-value', 'action': VMSSHFieldAction + }, + { + 'name': '--dns-name-for-public-ip', + 'action': VMDNSNameAction + }, + { + 'name': '--dns-name-type', + 'help': argparse.SUPPRESS } ] @@ -242,8 +259,8 @@ def __call__(self, parser, namespace, values, option_string=None): required: false short-summary: OS image (Common, URN or URI). long-summary: | - Common OS types: CentOS, CoreOS, Debian, openSUSE, RHEL, SLES, UbuntuLTS, Win2012R2Datacenter, Win2012Datacenter, Win2008R2SP1 - Example URN: canonical:Ubuntu_Snappy_Core:15.04:2016.0318.1949 + Common OS types: Win2012R2Datacenter, Win2012Datacenter, Win2008SP1, or Offer from 'az vm image list' + Example URN: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest Example URI: http://.blob.core.windows.net/vhds/osdiskimage.vhd populator-commands: - az vm image list @@ -261,7 +278,7 @@ def __call__(self, parser, namespace, values, option_string=None): -l "West US" -g myvms --name myvm001 --public-ip-address-type new --dns-name-for-public-ip myGloballyUniqueVmDnsName - name: Create a Linux VM with SSH key authentication, add a public DNS entry and add to an existing Virtual Network and Availability Set. text: > - az vm create --image canonical:Ubuntu_Snappy_Core:15.04:2016.0318.1949 + az vm create --image --admin-username myadmin --admin-password Admin_001 --authentication-type sshkey --virtual-network-type existing --virtual-network-name myvnet --subnet-name default --availability-set-type existing --availability-set-id myavailset diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json index 752b979ee1d..57bcd9ee6d7 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/azuredeploy.json @@ -123,13 +123,6 @@ "type": "string", "defaultValue": "Win2012R2Datacenter", "allowedValues": [ - "CentOS", - "CoreOS", - "Debian", - "openSUSE", - "RHEL", - "SLES", - "UbuntuLTS", "Win2012R2Datacenter", "Win2012Datacenter", "Win2008R2SP1", @@ -282,55 +275,27 @@ }, "variables": { "imagePublishers": { - "CoreOS": "CoreOS", "Win2012R2Datacenter": "MicrosoftWindowsServer", "Win2012Datacenter": "MicrosoftWindowsServer", "Win2008R2SP1": "MicrosoftWindowsServer", - "Debian": "credativ", - "RHEL": "RedHat", - "CentOS": "OpenLogic", - "openSUSE": "SUSE", - "UbuntuLTS": "Canonical", - "SLES": "SUSE", "Custom": "[parameters('osPublisher')]" }, "imageOffers": { - "CoreOS": "CoreOS", "Win2012R2Datacenter": "WindowsServer", "Win2012Datacenter": "WindowsServer", "Win2008R2SP1": "WindowsServer", - "Debian": "Debian", - "RHEL": "RHEL", - "CentOS": "CentOS", - "openSUSE": "openSUSE", - "UbuntuLTS": "UbuntuServer", - "SLES": "SLES", "Custom": "[parameters('osOffer')]" }, "imageSkus": { - "CoreOS": "Stable", "Win2012R2Datacenter": "2012-R2-Datacenter", "Win2012Datacenter": "2012-Datacenter", "Win2008R2SP1": "2008-R2-SP1", - "Debian": "8", - "RHEL": "7.2", - "CentOS": "7.2", - "openSUSE": "13.2", - "UbuntuLTS": "14.04.4-LTS", - "SLES": "12-SP1", "Custom": "[parameters('osSKU')]" }, "imageVersions": { - "CoreOS": "latest", "Win2012R2Datacenter": "latest", "Win2012Datacenter": "latest", "Win2008R2SP1": "latest", - "Debian": "latest", - "RHEL": "latest", - "CentOS": "latest", - "openSUSE": "latest", - "UbuntuLTS": "latest", - "SLES": "latest", "Custom": "[parameters('osVersion')]" }, "vnetDeploymentName": "[concat('VNet', variables('vmName'))]", diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py index 974d360ce44..943eba7801d 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/models/deployment_vm.py @@ -25,14 +25,16 @@ class DeploymentVM(Model): the template. :type content_version: str :param storage_container_name: Name of storage container for the VM OS - disk. + disk. Default value: "vhds" . :type storage_container_name: str :param virtual_network_name: Name of virtual network to add VM to. :type virtual_network_name: str - :param subnet_ip_address_prefix: The subnet address prefix in CIDR format. + :param subnet_ip_address_prefix: The subnet address prefix in CIDR + format. Default value: "10.0.0.0/24" . :type subnet_ip_address_prefix: str :param private_ip_address_allocation: Private IP address allocation - method. + method. Possible values include: 'Dynamic', 'Static'. Default value: + "Dynamic" . :type private_ip_address_allocation: str :param dns_name_for_public_ip: Globally unique DNS Name for the Public IP used to access the Virtual Machine. Requires a new public IP to be @@ -56,25 +58,26 @@ class DeploymentVM(Model): :param admin_password: Password for the Virtual Machine. Required if SSH (Linux only) is not specified. :type admin_password: str - :param os_sku: The OS SKU to install. + :param os_sku: The OS SKU to install. Default value: "2012-R2-Datacenter" + . :type os_sku: str :param subnet_name: The subnet name. :type subnet_name: str :param os_type: Common OS choices. Choose 'Custom' to specify an image with the osPublisher, osOffer, osSKU, and osVersion parameters. Possible - values include: 'CentOS', 'CoreOS', 'Debian', 'openSUSE', 'RHEL', - 'SLES', 'UbuntuLTS', 'Win2012R2Datacenter', 'Win2012Datacenter', + values include: 'Win2012R2Datacenter', 'Win2012Datacenter', 'Win2008R2SP1', 'Custom'. Default value: "Win2012R2Datacenter" . :type os_type: str :param admin_username: Username for the Virtual Machine. :type admin_username: str - :param os_version: The OS version to install. + :param os_version: The OS version to install. Default value: "latest" . :type os_version: str - :param os_disk_name: Name of new VM OS disk. + :param os_disk_name: Name of new VM OS disk. Default value: "osdiskimage" + . :type os_disk_name: str :param ssh_dest_key_path: VM file path for SSH key. :type ssh_dest_key_path: str - :param os_offer: The OS Offer to install. + :param os_offer: The OS Offer to install. Default value: "WindowsServer" . :type os_offer: str :param public_ip_address_allocation: Public IP address allocation method. Possible values include: 'Dynamic', 'Static'. Default value: "Dynamic" . @@ -97,7 +100,7 @@ class DeploymentVM(Model): "none" . :type public_ip_address_type: str :param virtual_network_ip_address_prefix: The virtual network IP address - prefix in CIDR format. + prefix in CIDR format. Default value: "10.0.0.0/16" . :type virtual_network_ip_address_prefix: str :param availability_set_id: Existing availability set for the VM. :type availability_set_id: str @@ -105,7 +108,8 @@ class DeploymentVM(Model): :type ssh_key_value: str :param location: Location for VM resources. :type location: str - :param os_publisher: The OS publisher of the OS image. + :param os_publisher: The OS publisher of the OS image. Default value: + "MicrosoftWindowsServer" . :type os_publisher: str :param availability_set_type: Flag to add the VM to an existing availability set. Possible values include: 'none', 'existing'. Default @@ -174,7 +178,7 @@ class DeploymentVM(Model): mode = "Incremental" - def __init__(self, name, admin_username, content_version=None, storage_container_name=None, virtual_network_name=None, subnet_ip_address_prefix=None, private_ip_address_allocation=None, dns_name_for_public_ip=None, storage_account_type="new", os_disk_uri=None, virtual_network_type="new", admin_password=None, os_sku=None, subnet_name=None, os_type="Win2012R2Datacenter", os_version=None, os_disk_name=None, ssh_dest_key_path=None, os_offer=None, public_ip_address_allocation="Dynamic", authentication_type="password", storage_account_name=None, storage_redundancy_type="Standard_LRS", size="Standard_A2", public_ip_address_type="none", virtual_network_ip_address_prefix=None, availability_set_id=None, ssh_key_value=None, location=None, os_publisher=None, availability_set_type="none", public_ip_address_name=None, dns_name_type="none"): + def __init__(self, name, admin_username, content_version=None, storage_container_name="vhds", virtual_network_name=None, subnet_ip_address_prefix="10.0.0.0/24", private_ip_address_allocation="Dynamic", dns_name_for_public_ip=None, storage_account_type="new", os_disk_uri=None, virtual_network_type="new", admin_password=None, os_sku="2012-R2-Datacenter", subnet_name=None, os_type="Win2012R2Datacenter", os_version="latest", os_disk_name="osdiskimage", ssh_dest_key_path=None, os_offer="WindowsServer", public_ip_address_allocation="Dynamic", authentication_type="password", storage_account_name=None, storage_redundancy_type="Standard_LRS", size="Standard_A2", public_ip_address_type="none", virtual_network_ip_address_prefix="10.0.0.0/16", availability_set_id=None, ssh_key_value=None, location=None, os_publisher="MicrosoftWindowsServer", availability_set_type="none", public_ip_address_name=None, dns_name_type="none"): self.content_version = content_version self.storage_container_name = storage_container_name self.virtual_network_name = virtual_network_name diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py index 7d18763023d..28ea73bc4c7 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/lib/operations/vm_operations.py @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def create_or_update( - self, resource_group_name, deployment_name, name, admin_username, content_version=None, storage_container_name=None, virtual_network_name=None, subnet_ip_address_prefix=None, private_ip_address_allocation=None, dns_name_for_public_ip=None, storage_account_type="new", os_disk_uri=None, virtual_network_type="new", admin_password=None, os_sku=None, subnet_name=None, os_type="Win2012R2Datacenter", os_version=None, os_disk_name=None, ssh_dest_key_path=None, os_offer=None, public_ip_address_allocation="Dynamic", authentication_type="password", storage_account_name=None, storage_redundancy_type="Standard_LRS", size="Standard_A2", public_ip_address_type="none", virtual_network_ip_address_prefix=None, availability_set_id=None, ssh_key_value=None, location=None, os_publisher=None, availability_set_type="none", public_ip_address_name=None, dns_name_type="none", custom_headers={}, raw=False, **operation_config): + self, resource_group_name, deployment_name, name, admin_username, content_version=None, storage_container_name="vhds", virtual_network_name=None, subnet_ip_address_prefix="10.0.0.0/24", private_ip_address_allocation="Dynamic", dns_name_for_public_ip=None, storage_account_type="new", os_disk_uri=None, virtual_network_type="new", admin_password=None, os_sku="2012-R2-Datacenter", subnet_name=None, os_type="Win2012R2Datacenter", os_version="latest", os_disk_name="osdiskimage", ssh_dest_key_path=None, os_offer="WindowsServer", public_ip_address_allocation="Dynamic", authentication_type="password", storage_account_name=None, storage_redundancy_type="Standard_LRS", size="Standard_A2", public_ip_address_type="none", virtual_network_ip_address_prefix="10.0.0.0/16", availability_set_id=None, ssh_key_value=None, location=None, os_publisher="MicrosoftWindowsServer", availability_set_type="none", public_ip_address_name=None, dns_name_type="none", custom_headers={}, raw=False, **operation_config): """ Create or update a virtual machine. @@ -57,7 +57,7 @@ def create_or_update( format. :type subnet_ip_address_prefix: str :param private_ip_address_allocation: Private IP address allocation - method. + method. Possible values include: 'Dynamic', 'Static' :type private_ip_address_allocation: str :param dns_name_for_public_ip: Globally unique DNS Name for the Public IP used to access the Virtual Machine. Requires a new public @@ -81,8 +81,7 @@ def create_or_update( :type subnet_name: str :param os_type: Common OS choices. Choose 'Custom' to specify an image with the osPublisher, osOffer, osSKU, and osVersion - parameters. Possible values include: 'CentOS', 'CoreOS', 'Debian', - 'openSUSE', 'RHEL', 'SLES', 'UbuntuLTS', 'Win2012R2Datacenter', + parameters. Possible values include: 'Win2012R2Datacenter', 'Win2012Datacenter', 'Win2008R2SP1', 'Custom' :type os_type: str :param os_version: The OS version to install. diff --git a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json index 42fb9ebaae5..f155a984475 100644 --- a/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json +++ b/src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt/swagger_create_vm.json @@ -481,13 +481,6 @@ "type": "string", "description": "Common OS choices. Choose 'Custom' to specify an image with the osPublisher, osOffer, osSKU, and osVersion parameters.", "enum": [ - "CentOS", - "CoreOS", - "Debian", - "openSUSE", - "RHEL", - "SLES", - "UbuntuLTS", "Win2012R2Datacenter", "Win2012Datacenter", "Win2008R2SP1",