我目前正在做一个项目,基于模板自动执行VM部署。为了继续,我使用的是Ansible 2.10和Pyvmomi 7.0.1。
我正面临着一个试图定义Pvlan id (51)的问题,对我的客人来说,这是我的剧本:
---
- hosts: localhost
gather_facts: no
vars:
vcenter_server: "100.64.31.5"
vcenter_user: "xxxxx"
vcenter_pass: 'xxxxxx'
datacenter_name: "xxxxxx"
cluster_name: "xxxxxx"
tasks:
- name: Clone the template
vmware_guest:
hostname: "{{ vcenter_server }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
validate_certs: False
name: NewVmName
template: "mytemplate"
datacenter: "{{ datacenter_name }}"
folder: "/vm"
cluster: "{{ cluster_name }}"
datastore: "SAN08T2lunHDS1"
networks:
- vlan: 51
ip: 100.64.67.13
netmask: 255.255.240.0
type: static但我一直收到以下错误:AttributeError: 'vim.dvs.VmwareDistributedVirtualSwitch.PvlanSpec' object has no attribute 'vlanId'
我已经检查了我在Vswitch、数据存储区和虚拟机上的用户权限,在这一端没有要声明的内容。
发布于 2021-04-07 17:04:24
好了,我刚刚了解了如何继续,您应该使用端口组名称,而不是使用vlan ID。
要继续,请在连接到Vcenter后执行以下操作:
端口组名称是" Name“字段
https://stackoverflow.com/questions/66982371
复制相似问题