diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py index 9f833a1e2aa9..434838754cc9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models.py @@ -208,7 +208,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py index 086f534f9fe1..b85aa09d67bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py @@ -208,7 +208,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index f848c5305a81..b9efe84a440b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -231,7 +231,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index 5c6854732a4d..01586e0bc7a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -231,7 +231,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py index 5ac6a42a34c8..dc4655c27f44 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py @@ -231,7 +231,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ @@ -4054,7 +4054,7 @@ class OSProfile(Model): customData property**

This property cannot be updated after the VM is created.

customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure - VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) + VMs](https://docs.microsoft.com/azure/virtual-machines/custom-data)

For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py index f85b895c57a3..ba0a76d85201 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py @@ -231,7 +231,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ @@ -4054,7 +4054,7 @@ class OSProfile(Model): customData property**

This property cannot be updated after the VM is created.

customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure - VMs](https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/) + VMs](https://docs.microsoft.com/azure/virtual-machines/custom-data)

For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py index 1ae624b1ac57..c2ad29b3c283 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py @@ -434,6 +434,7 @@ DiskCreateOptionTypes, StorageAccountTypes, DiffDiskOptions, + DiffDiskPlacement, PassNames, ComponentNames, SettingNames, @@ -693,6 +694,7 @@ 'DiskCreateOptionTypes', 'StorageAccountTypes', 'DiffDiskOptions', + 'DiffDiskPlacement', 'PassNames', 'ComponentNames', 'SettingNames', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py index 085de025e548..863434f6e55e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_compute_management_client_enums.py @@ -247,6 +247,12 @@ class DiffDiskOptions(str, Enum): local = "Local" +class DiffDiskPlacement(str, Enum): + + cache_disk = "CacheDisk" + resource_disk = "ResourceDisk" + + class PassNames(str, Enum): oobe_system = "OobeSystem" @@ -333,6 +339,7 @@ class IPVersion(str, Enum): class OrchestrationServiceNames(str, Enum): automatic_repairs = "AutomaticRepairs" + class OrchestrationServiceState(str, Enum): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py index fa9f6d34f8ad..5c8a3b41f64e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py @@ -208,7 +208,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ @@ -1138,15 +1138,25 @@ class DiffDiskSettings(Model): disk. Possible values include: 'Local' :type option: str or ~azure.mgmt.compute.v2019_12_01.models.DiffDiskOptions + :param placement: Specifies the ephemeral disk placement for operating + system disk. This property is used to specify Cache disk or Resource disk + for ephemeral OS disk provisioning. By default if customer does not + specify this placement property in the request, the Ephemeral OS disk will + be provisioned using Cache disk. Possible values include: 'CacheDisk', + 'ResourceDisk' + :type placement: str or + ~azure.mgmt.compute.v2019_12_01.models.DiffDiskPlacement """ _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, + 'placement': {'key': 'placement', 'type': 'str'}, } def __init__(self, **kwargs): super(DiffDiskSettings, self).__init__(**kwargs) self.option = kwargs.get('option', None) + self.placement = kwargs.get('placement', None) class Disallowed(Model): @@ -3294,14 +3304,12 @@ def __init__(self, **kwargs): class OrchestrationServiceStateInput(Model): """The input for OrchestrationServiceState. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :ivar service_name: Required. The name of the service. Default value: - "AutomaticRepairs" . - :vartype service_name: str + :param service_name: Required. The name of the service. Possible values + include: 'AutomaticRepairs' + :type service_name: str or + ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :param action: Required. The action to be performed. Possible values include: 'Resume', 'Suspend' :type action: str or @@ -3309,7 +3317,7 @@ class OrchestrationServiceStateInput(Model): """ _validation = { - 'service_name': {'required': True, 'constant': True}, + 'service_name': {'required': True}, 'action': {'required': True}, } @@ -3318,10 +3326,9 @@ class OrchestrationServiceStateInput(Model): 'action': {'key': 'action', 'type': 'str'}, } - service_name = "AutomaticRepairs" - def __init__(self, **kwargs): super(OrchestrationServiceStateInput, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) self.action = kwargs.get('action', None) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py index 4450606e7a87..5434d44cf361 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py @@ -208,7 +208,7 @@ class AutomaticRepairsPolicy(Model): state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the - default value. + default value. The maximum allowed grace period is 90 minutes (PT90M). :type grace_period: str """ @@ -1138,15 +1138,25 @@ class DiffDiskSettings(Model): disk. Possible values include: 'Local' :type option: str or ~azure.mgmt.compute.v2019_12_01.models.DiffDiskOptions + :param placement: Specifies the ephemeral disk placement for operating + system disk. This property is used to specify Cache disk or Resource disk + for ephemeral OS disk provisioning. By default if customer does not + specify this placement property in the request, the Ephemeral OS disk will + be provisioned using Cache disk. Possible values include: 'CacheDisk', + 'ResourceDisk' + :type placement: str or + ~azure.mgmt.compute.v2019_12_01.models.DiffDiskPlacement """ _attribute_map = { 'option': {'key': 'option', 'type': 'str'}, + 'placement': {'key': 'placement', 'type': 'str'}, } - def __init__(self, *, option=None, **kwargs) -> None: + def __init__(self, *, option=None, placement=None, **kwargs) -> None: super(DiffDiskSettings, self).__init__(**kwargs) self.option = option + self.placement = placement class Disallowed(Model): @@ -3294,14 +3304,12 @@ def __init__(self, *, network_interfaces=None, **kwargs) -> None: class OrchestrationServiceStateInput(Model): """The input for OrchestrationServiceState. - Variables are only populated by the server, and will be ignored when - sending a request. - All required parameters must be populated in order to send to Azure. - :ivar service_name: Required. The name of the service. Default value: - "AutomaticRepairs" . - :vartype service_name: str + :param service_name: Required. The name of the service. Possible values + include: 'AutomaticRepairs' + :type service_name: str or + ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :param action: Required. The action to be performed. Possible values include: 'Resume', 'Suspend' :type action: str or @@ -3309,7 +3317,7 @@ class OrchestrationServiceStateInput(Model): """ _validation = { - 'service_name': {'required': True, 'constant': True}, + 'service_name': {'required': True}, 'action': {'required': True}, } @@ -3318,10 +3326,9 @@ class OrchestrationServiceStateInput(Model): 'action': {'key': 'action', 'type': 'str'}, } - service_name = "AutomaticRepairs" - - def __init__(self, *, action, **kwargs) -> None: + def __init__(self, *, service_name, action, **kwargs) -> None: super(OrchestrationServiceStateInput, self).__init__(**kwargs) + self.service_name = service_name self.action = action diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py index bd166bc7a8a4..6ba4bdd814a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -1840,8 +1840,8 @@ def convert_to_single_placement_group( def _set_orchestration_service_state_initial( - self, resource_group_name, vm_scale_set_name, action, custom_headers=None, raw=False, **operation_config): - parameters = models.OrchestrationServiceStateInput(action=action) + self, resource_group_name, vm_scale_set_name, service_name, action, custom_headers=None, raw=False, **operation_config): + parameters = models.OrchestrationServiceStateInput(service_name=service_name, action=action) # Construct URL url = self.set_orchestration_service_state.metadata['url'] @@ -1883,7 +1883,7 @@ def _set_orchestration_service_state_initial( return client_raw_response def set_orchestration_service_state( - self, resource_group_name, vm_scale_set_name, action, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, vm_scale_set_name, service_name, action, custom_headers=None, raw=False, polling=True, **operation_config): """Changes ServiceState property for a given service. :param resource_group_name: The name of the resource group. @@ -1891,6 +1891,10 @@ def set_orchestration_service_state( :param vm_scale_set_name: The name of the virtual machine scale set to create or update. :type vm_scale_set_name: str + :param service_name: The name of the service. Possible values include: + 'AutomaticRepairs' + :type service_name: str or + ~azure.mgmt.compute.v2019_12_01.models.OrchestrationServiceNames :param action: The action to be performed. Possible values include: 'Resume', 'Suspend' :type action: str or @@ -1909,6 +1913,7 @@ def set_orchestration_service_state( raw_result = self._set_orchestration_service_state_initial( resource_group_name=resource_group_name, vm_scale_set_name=vm_scale_set_name, + service_name=service_name, action=action, custom_headers=custom_headers, raw=True, diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py index 0e9624711a6b..3a20dc3e0a88 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py @@ -1654,6 +1654,85 @@ def get_long_running_output(response): perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance'} + def _simulate_eviction_initial( + self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.simulate_eviction.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def simulate_eviction( + self, resource_group_name, vm_name, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to simulate the eviction of spot virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._simulate_eviction_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + simulate_eviction.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/SimulateEviction'} + + def _run_command_initial( self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL