.. _azure-driver: .. default-domain:: zuul Azure Compute Driver -------------------- Before using the Azure driver, make sure you have created a service principal and saved the credential information in a JSON file. Follow the instructions at `Azure CLI`_ and use the ``--sdk-auth`` flag:: az ad sp create-for-rbac --name nodepool --sdk-auth You must also have created a network for Nodepool to use. Be sure to enable IPv6 on the network if you plan to use it. You may also need to register the `Microsoft.Compute` resource provider with your subscription. Selecting the azure driver adds the following options to the :attr:`providers` section of the configuration. .. attr-overview:: :prefix: providers.[azure] :maxdepth: 3 .. attr:: providers.[azure] :type: list An Azure provider's resources are partitioned into groups called `pool`, and within a pool, the node types which are to be made available are listed .. note:: For documentation purposes the option names are prefixed ``providers.[azure]`` to disambiguate from other drivers, but ``[azure]`` is not required in the configuration (e.g. below ``providers.[azure].pools`` refers to the ``pools`` key in the ``providers`` section when the ``azure`` driver is selected). Example: .. code-block:: yaml providers: - name: azure-central-us driver: azure location: centralus resource-group: nodepool resource-group-location: centralus auth-path: /path/to/nodepoolCreds.json network: nodepool cloud-images: - name: bionic username: zuul key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAA... image-reference: sku: 18.04-LTS publisher: Canonical version: latest offer: UbuntuServer pools: - name: main max-servers: 10 labels: - name: bionic cloud-image: bionic hardware-profile: vm-size: Standard_D1_v2 .. attr:: name :required: A unique name for this provider configuration. .. attr:: location :required: Name of the Azure region to interact with. .. attr:: resource-group :required: Name of the Resource Group in which to place the Nodepool nodes. .. attr:: resource-group-location :required: Name of the Azure region where the home Resource Group is or should be created. .. attr:: auth-path :required: Path to the JSON file containing the service principal credentials. Create with the `Azure CLI`_ and the ``--sdk-auth`` flag .. attr:: network :required: Network upon which to create VMs. This can either be a string, in which case it must be the name of a network in the provider's resource group and Nodepool will use the subnet named ``default``, or it can be a dictionary with these keys: .. attr:: resource-group :default: The provider's resource group The resource group containing the network. .. attr:: network :required: The name of the network. .. attr:: subnet :default: default The name of the subnet within the network. .. attr:: ipv4 :type: bool Whether to enable IPv4 networking. Defaults to true unless ipv6 is enabled. Enabling this will attach a private IP address. .. attr:: ipv6 :type: bool :default: false Whether to enable IPv6 networking. Enabling this will attach a private IP address. .. attr:: public-ipv4 :type: bool Whether to attach a public IPv4 address to instances. Defaults to true, but will change to false in a future release. Implies ``ipv4``. .. attr:: public-ipv6 :type: bool :default: false Whether to attach a public IPv4 address to instances. Defaults to true, but will change to false in a future release. Implies ``ipv6``. .. attr:: use-internal-ip :type: bool :default: false If a public IP is attached but Nodepool should prefer the private IP, set this to true. .. attr:: host-key-checking :type: bool :default: true Specify custom behavior of validation of SSH host keys. When set to False, nodepool-launcher will not ssh-keyscan nodes after they are booted. This might be needed if nodepool-launcher and the nodes it launches are on different networks. The default value is true. .. attr:: rate :type: float seconds :default: 1.0 In seconds, amount to wait between operations on the provider. .. attr:: boot-timeout :type: int seconds :default: 120 Once an instance is active, how long to try connecting to the image via SSH. If the timeout is exceeded, the node launch is aborted and the instance deleted. .. attr:: launch-timeout :type: int seconds :default: 3600 The time to wait from issuing the command to create a new instance until that instance is reported as "active". If the timeout is exceeded, the node launch is aborted and the instance deleted. .. attr:: launch-retries :type: int :default: 3 The number of times to retry launching a server before considering the request failed. .. attr:: post-upload-hook :type: string :default: None Filename of an optional script that can be called after an image has been uploaded to a provider but before it is taken into use. This is useful to perform last minute validation tests before an image is really used for build nodes. The script will be called as follows: ``