vmware_host_auto_start: enable the tests

- remove the unsupported alias
- refactoring
- move the hosts outside of the cluster to avoid any conflict with DRS
- import the `prepare_vmware_tests` role
- does not work with govcsim
pull/65381/head
Gonéri Le Bouder 6 years ago
parent af3603f9ee
commit f956581846

@ -1,4 +1,5 @@
cloud/vcenter
unsupported
skip/python2.6
zuul/vmware/vcenter_only
shippable/vcenter/group1
needs/target/prepare_vmware_tests
zuul/vmware/vcenter_1esxi

@ -2,9 +2,6 @@
# Copyright: (c) 2019, sky-joker <sky.jokerxx@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- when: vcsim is not defined
block:
- include_tasks: reset_auto_start_config.yml
- name: Update enabled param of autoStart defaults parameters for ESXi.
vmware_host_auto_start:
@ -89,7 +86,7 @@
password: "{{ esxi_password }}"
validate_certs: no
datacenter: ha-datacenter
name: "{{ virtual_machines[0].name }}"
name: test_vm1
schema: vsphere
properties:
- summary.vm
@ -102,7 +99,7 @@
password: "{{ esxi_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[0].name }}"
name: test_vm1
power_info:
start_action: powerOn
register: changed_vm_power_info_result
@ -148,7 +145,7 @@
password: "{{ esxi_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[0].name }}"
name: test_vm1
power_info:
start_action: powerOn
start_delay: 200
@ -188,7 +185,7 @@
password: "{{ esxi_password }}"
validate_certs: no
datacenter: ha-datacenter
name: "{{ virtual_machines[1].name }}"
name: test_vm2
schema: vsphere
properties:
- summary.vm
@ -201,7 +198,7 @@
password: "{{ esxi_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
power_info:
start_action: powerOn
start_delay: 100
@ -241,7 +238,7 @@
password: "{{ esxi_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
power_info:
start_action: powerOn
start_delay: 100
@ -282,7 +279,7 @@
password: "{{ esxi_password }}"
validate_certs: no
datacenter: "{{ dc1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
schema: vsphere
properties:
- config.instanceUuid

@ -2,5 +2,56 @@
# Copyright: (c) 2019, sky-joker <sky.jokerxx@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- when: vcsim is not defined
block:
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
setup_datastore: true
- name: Move the ESXi hosts out of the cluster
vmware_host:
datacenter_name: '{{ dc1 }}'
esxi_hostname: '{{ item }}'
esxi_username: '{{ esxi_user }}'
esxi_password: '{{ esxi_password }}'
folder: '/DC0/host'
state: present
with_items: "{{ esxi_hosts }}"
- name: Disable the Maintenance Mode
vmware_maintenancemode:
esxi_hostname: '{{ item }}'
state: absent
with_items: "{{ esxi_hosts }}"
- name: Create VM on esxi1
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ dc1 }}"
validate_certs: no
name: '{{ item }}'
folder: vm
esxi_hostname: "{{ esxi1 }}"
state: present
guest_id: centos7_64Guest
disk:
- size_gb: 1
type: thin
datastore: '{{ rw_datastore }}'
hardware:
version: latest
memory_mb: 1024
num_cpus: 1
scsi: paravirtual
with_items: ['test_vm1', 'test_vm2']
- include_tasks: reset_auto_start_config.yml
- include: vcenter_auto_start_ops.yml
- include_tasks: reset_auto_start_config.yml
- include: esxi_auto_start_ops.yml
always:
- include_tasks: reset_auto_start_config.yml

@ -2,33 +2,33 @@
# Copyright: (c) 2019, sky-joker <sky.jokerxx@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: "Reset powerInfo for autoStart parameters of {{ virtual_machines[0].name }}."
- name: "Reset powerInfo for autoStart parameters of {{ test_vm1 }}."
vmware_host_auto_start:
hostname: "{{ vcenter_hostname | default(esxi1) }}"
username: "{{ vcenter_username | default(esxi_user) }}"
password: "{{ vcenter_password | default(esxi_password) }}"
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[0].name }}"
name: test_vm1
power_info:
start_action: none
- name: "Reset powerInfo for autoStart parameters of {{ virtual_machines[1].name }}"
- name: "Reset powerInfo for autoStart parameters of {{ test_vm2 }}"
vmware_host_auto_start:
hostname: "{{ vcenter_hostname | default(esxi1) }}"
username: "{{ vcenter_username | default(esxi_user) }}"
password: "{{ vcenter_password | default(esxi_password) }}"
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
power_info:
start_action: none
- name: Reset autoStart defaults parameters.
vmware_host_auto_start:
hostname: "{{ vcenter_hostname | default(esxi1) }}"
username: "{{ vcenter_username | default(esxi_user) }}"
password: "{{ vcenter_password | default(esxi_password) }}"
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
system_defaults:

@ -2,10 +2,6 @@
# Copyright: (c) 2019, sky-joker <sky.jokerxx@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- when: vcsim is not defined
block:
- include_tasks: reset_auto_start_config.yml
- name: Update enabled param of autoStart defaults parameters for ESXi via vCenter.
vmware_host_auto_start:
hostname: "{{ vcenter_hostname }}"
@ -89,7 +85,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
datacenter: "{{ dc1 }}"
name: "{{ virtual_machines[0].name }}"
name: test_vm1
schema: vsphere
properties:
- summary.vm
@ -102,7 +98,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[0].name }}"
name: test_vm1
power_info:
start_action: powerOn
register: changed_vm_power_info_result
@ -148,7 +144,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[0].name }}"
name: test_vm1
power_info:
start_action: powerOn
start_delay: 200
@ -188,7 +184,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
datacenter: "{{ dc1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
schema: vsphere
properties:
- summary.vm
@ -201,7 +197,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
power_info:
start_action: powerOn
start_delay: 100
@ -241,7 +237,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
esxi_hostname: "{{ esxi1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
power_info:
start_action: powerOn
start_delay: 100
@ -282,7 +278,7 @@
password: "{{ vcenter_password }}"
validate_certs: no
datacenter: "{{ dc1 }}"
name: "{{ virtual_machines[1].name }}"
name: test_vm2
schema: vsphere
properties:
- config.instanceUuid

Loading…
Cancel
Save