VMware Portgroup
Resumo
- Crie um VMware Port Group em um VMware Standard Switch (vSS) para determinados hosts ESXi ou hosts de determinado cluster.
Parâmetros
Parâmetro | Tipo | Escolhas | Valor Padrão | Comentários |
|---|---|---|---|
switch | string | |
|
portgroup | string | |
|
vlan_id | insterger |
|
|
security | dict | |
|
teaming | dict | |
|
traffic_shaping | dict | |
|
cluster_name | string | |
|
hosts | string | |
|
state | string |
|
|
Estende fragmentos da documentação do módulo VMware Options.
Sub-options de security
Parâmetro | Tipo | Escolhas | Valor Padrão | Comentários |
|---|---|---|---|
promiscuous_mode | bool |
|
|
forged_transmits | bool |
|
|
mac_changes | bool |
|
|
Sub-options de teaming
Parâmetro | Tipo | Escolhas | Valor Padrão | Comentários |
|---|---|---|---|
load_balancing | string |
|
|
network_falilure_detection | string |
|
|
notify_switches | bool |
|
|
failback | bool |
|
|
active_adapters | list/elements=string | |
|
standby_adapters | list/elements=string | |
|
Sub-options de traffic_shaping
Parâmetro | Tipo | Escolhas | Valor Padrão | Comentários |
|---|---|---|---|
enabled | bool | |
|
average_bandwidth | interger |
|
|
peak_bandwidth | interger |
|
|
burst_size | interger | |
|
Notas
Observação
- Testado em ESXi 7.0.2
- Todos os módulos requerem acesso de gravação API e, portanto, não são suportados em uma licença ESXi gratuita.
Exemplos
- name: Add Management Network VM Portgroup
vmware_portgroup:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
switch: "{{ vswitch_name }}"
portgroup: "{{ portgroup_name }}"
vlan_id: "{{ vlan_id }}"
delegate_to: localhost
- name: Add Portgroup with Promiscuous Mode Enabled
vmware_portgroup:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
switch: "{{ vswitch_name }}"
portgroup: "{{ portgroup_name }}"
security:
promiscuous_mode: True
delegate_to: localhost
- name: Add Management Network VM Portgroup to specific hosts
vmware_portgroup:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
hosts: [esxi_hostname_one]
switch: "{{ vswitch_name }}"
portgroup: "{{ portgroup_name }}"
vlan_id: "{{ vlan_id }}"
delegate_to: localhost
- name: Add Management Network VM Portgroup to all hosts in a cluster
vmware_portgroup:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
cluster_name: "{{ cluster_name }}"
switch: "{{ vswitch_name }}"
portgroup: "{{ portgroup_name }}"
vlan_id: "{{ vlan_id }}"
delegate_to: localhost
- name: Remove Management Network VM Portgroup to all hosts in a cluster
vmware_portgroup:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
cluster_name: "{{ cluster_name }}"
switch: "{{ vswitch_name }}"
portgroup: "{{ portgroup_name }}"
vlan_id: "{{ vlan_id }}"
state: absent
delegate_to: localhost
- name: Add Portgroup with all settings defined
vmware_portgroup:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
esxi_hostname: "{{ inventory_hostname }}"
switch: "{{ vswitch_name }}"
portgroup: "{{ portgroup_name }}"
vlan_id: 10
security:
promiscuous_mode: False
mac_changes: False
forged_transmits: False
traffic_shaping:
enabled: True
average_bandwidth: 100000
peak_bandwidth: 100000
burst_size: 102400
teaming:
load_balancing: failover_explicit
network_failure_detection: link_status_only
notify_switches: true
failback: true
active_adapters:
- vmnic0
standby_adapters:
- vmnic1
delegate_to: localhost
register: teaming_resultValores Retornados
Chave | Tipo | Retornado quando | Descrição |
|---|---|---|---|
result | dict | sempre | metadados sobre os portgroups |