Forum Discussion

Ankur_Mathur's avatar
Ankur_Mathur
Icon for Nimbostratus rankNimbostratus
Mar 15, 2019

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

1 Reply

  • Unfortunately, according to the vCMP manual they leave the disk for reuse by another guest later.

     

    This is from the article I link to below:

     

    Deleting a virtual disk from the BIG-IP system Using the BIG-IP Configuration utility, you can delete a virtual disk from the system. You do this by using the Virtual Disk List screen.

     

    Important: This is the only way to delete a virtual disk from the system. If you delete the associated guest instead, the system retains the virtual disk for re-use by another guest later.

     

    On the Main tab, click vCMP > Virtual Disk List. Locate the Virtual Disk List area of the screen. In the Name column, locate the name of the virtual disk that you want to delete. To the left of the virtual disk name, select the check box. Click Delete. The system prompts you to confirm the delete action. Click Delete.

     

    HERE is some more info on that.

     

    Hope that helps, if it does please up-vote and select this answer, it would be greatly appreciated!

     

    -Dylan