azure - 如何使用ansible在azure中添加磁盘

标签 azure azure-storage ansible

我们使用此模块 ( http://docs.ansible.com/ansible/azure_module.html ) 在 azure 上创建了实例。但是它没有显示如何添加额外的 VHD 磁盘。有没有办法使用 ansible 在 azure 中添加磁盘?

最佳答案

   vars:

        vm2:
            - name: azu-ve109456
              network_interface:
                  name: azu-eu-west-subnet-a-ni-ve108456
              vm_size: Standard_DS1_v2
              username: ubuntu

  - name: Create VM
    azure_rm_virtualmachine:
      resource_group: NAME
      name: "{{ item.name }}"
      vm_size: "{{ item.vm_size }}"
      admin_username: "{{ item.username }}"
      ssh_password_enabled: false
      ssh_public_keys:
        - path: "/home/{{ item.username }}/.ssh/authorized_keys"
          key_data: "ssh-rsa AAAABxxxxxxgxYN"
      network_interfaces: "{{ item.network_interface.name }}"
      image:
          offer: UbuntuServer
          publisher: Canonical
          sku: 16.04-LTS
          version: latest
      managed_disk_type: Premium_LRS
      data_disks:
          - lun: 0
            disk_size_gb: 64
            managed_disk_type: Premium_LRS
          - lun: 1
            disk_size_gb: 128
            managed_disk_type: Premium_LRS
          - lun: 2
            disk_size_gb: 128
            managed_disk_type: Premium_LRS

      with_items: "{{ vm2 }}"

关于azure - 如何使用ansible在azure中添加磁盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33266811/

相关文章:

ssl - kolla-ansible TLS 部署失败

ubuntu - Ansible 和 GCE 中的其他图像

azure - 用于管理 Windows Azure Active Directory 用户的工具

azure - VSS 客户端 SDK 文档链接不可用 - https ://www. Visualstudio.com/docs/integrate/extensions/reference/client/core-sdk

azure - 使用 ARM 或 powershell 设置 Azure SQL Server 防火墙关闭

用于登录/注册生成 404 的 Azure AD B2C 自定义登录页面

sql - 将 SQL 数据迁移到 Azure/云

javascript - Active Directory 从浏览器访问 Azure 存储

azure - 跨 Azure 订阅使用专用终结点

kubernetes - 分离字典列表