Ankur_Mathur
Mar 15, 2019Nimbostratus
bigip_vcmp_guest module does not delete the virtual disk on guest deletion
The bigip_vcmp_guest module is not deleting the virtual disk associated with the guest. The guest is first shutdown and then deleted but the virtual disk stays in "Ready" state. It is though not associated with any guest. This issue hits the automation as the new guest cant be created as a virtual disk is already present by that name.
====== (f5_poc) -bash-4.2$ pip list
Package Version
---------------- ----------
ansible 2.7.0
asn1crypto 0.24.0
bcrypt 3.1.4
bigsuds 1.0.6
certifi 2018.10.15
cffi 1.11.5
chardet 3.0.4
cryptography 2.3.1
deepdiff 3.3.0
f5-icontrol-rest 1.3.11
f5-sdk 3.0.20
idna 2.7
Jinja2 2.10
jsonpickle 1.0
MarkupSafe 1.0
netaddr 0.7.19
paramiko 2.4.2
pip 18.1
pyasn1 0.4.4
pycparser 2.19
PyNaCl 1.3.0
PyYAML 3.13
requests 2.19.1
setuptools 40.5.0
six 1.11.0
suds-jurko 0.6
urllib3 1.23
wheel 0.32.1
Playbook
---
- hosts: vms_to_upgrade
connection: local
gather_facts: False
roles:
- role: f5devcentral.f5ansible
tasks:
- name: Configure User
set_fact:
provider:
user: "{{ansible_user}}"
password: "{{ansible_ssh_pass}}"
validate_certs: no
timeout: 7200
admin_user:
user: root
password: default
validate_certs: no
no_log: true
- name: Shut down current Guest
bigip_vcmp_guest:
provider: "{{provider}}"
server: "{{server_name}}"
name: "{{vm_to_upgrade}}"
state: disabled
mgmt_address: "{{ ip_addr }}/{{ nw_bits }}"
mgmt_network: bridged
mgmt_route: "{{gateway}}"
delegate_to: localhost
Delete Guest:
- name: Delete the vcmp guest & delete the virtual disk
bigip_vcmp_guest:
provider: "{{provider}}"
server: "{{server_name}}"
name: "{{vm_to_upgrade}}"
state: absent
delete_virtual_disk: yes
delegate_to: localhost