首页 > 解决方案 > 通过 ansible AWX 在 ovirt_disk 模块中出错

问题描述

尝试将磁盘添加到 RHVM 时,我遇到了有线错误。我已经检查了文档。所有参数对我来说似乎都是合法的。我需要额外的眼睛来验证这个案例。谢谢你提前

错误信息如下

"msg": "(ovirt_disk) 模块不支持的参数:激活支持的参数包括:auth、bootable、description、download_image_path、fetch_nested、force、format、id、image_provider、interface、logical_unit、name、nested_attributes、openstack_volume_type、poll_interval、profile、 quota_id, 可共享, 大小, 稀疏, 稀疏化, 状态, storage_domain, storage_domains, 超时, upload_image_path, vm_id, vm_name, 等待”}

角色中的参数如下

        "module_args": {
        "vm_name": "Jxyxyxyxy01",
        "activate": true,
        "storage_domain": "Data-xxx-Txxx",
        "description": "Created using Jira ticket CR-329",
        "format": "cow",
        "auth": {
            "timeout": 0,
            "url": "https://xxxxxx.com/ovirt-engine/api",
            "insecure": true,
            "kerberos": false,
            "compress": true,
            "headers": null,
            "token": "xxcddsvsdvdsvsdvdEFl0910KES84qL8Ff5NReA",
            "ca_file": null
        },
        "state": "present",
        "sparse": true,
        "interface": "virtio_scsi",
        "wait": true,
        "size": "20GiB",
        "name": "Jxyxyxyxy01_123"
    }

剧本如下。

 - name: Create New Disk size of {{ disk_size }} on {{ hostname }} using storage domain {{ vm_storage_domain }}
   ovirt_disk:
      auth: "{{ ovirt_auth }}"
      description: "Created using Jira ticket {{ issueKey }}"
      storage_domain:  "{{ vm_storage_domain }}"
      name: "{{ hostname }}_123" # name of the disk
      vm_name: "{{ hostname }}" #name of the virtual machine
      interface: "virtio_scsi"
      size: "{{ disk_size }}GiB"
      sparse: yes
      format: cow
      activate: yes
      wait: yes
      state: present
   register: vm_disk_results

标签: ansible

解决方案


activate参数是在 ansible 2.8 中添加的。

升级您的 ansible 安装或删除该参数。


推荐阅读