Bug 1348718 - Azure instance disks not deleted
Summary: Azure instance disks not deleted
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: 5.8.0
Assignee: Bronagh Sorota
QA Contact: Jeff Teehan
Whiteboard: provider:azure
: 1342640 (view as bug list)
Depends On:
Blocks: 1353306 1403019
TreeView+ depends on / blocked
Reported: 2016-06-21 20:58 UTC by David La Motta
Modified: 2017-06-12 16:19 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1353306 1403019 (view as bug list)
Last Closed: 2017-06-12 16:19:57 UTC
Category: ---
Cloudforms Team: Azure
Target Upstream Version:

Attachments (Terms of Use)

Description David La Motta 2016-06-21 20:58:30 UTC
Description of problem:
After an Azure instance is retired or terminated, the disks linger in the Azure storage blob.

Version-Release number of selected component (if applicable):

How reproducible:
100% of the time

Steps to Reproduce:
1. Retire or terminate an instance from Azure using the CF UI
2. Go into the storage account > blobs > manageiq 
3. Verify the disk for the retired instance remains after the instance is deleted

Actual results:
The disk remains in the storage account.

Expected results:
Instance disks should be deleted.

Additional info:

Comment 2 Greg Blomquist 2016-06-30 14:38:13 UTC
Dan, this might be something that Bill Fitz should look at if it's specific to retirement.  Take a look and see if it should be reassigned his way.

Comment 3 Daniel Berger 2016-06-30 20:03:49 UTC
Greg, I suspect this is an issue for Bill Fitz, since Azure doesn't automatically delete associated resources.

Comment 5 Bronagh Sorota 2016-09-19 15:31:59 UTC
hi Dan
Please let me know when the nested delete functionality has been added to the Azure-armrest gem.

Thank you

Comment 6 Jeff Teehan 2016-10-03 15:59:51 UTC
Added Polarion test case

Comment 8 Leo Khomenko 2016-10-05 09:46:21 UTC
*** Bug 1342640 has been marked as a duplicate of this bug. ***

Comment 9 Daniel Berger 2016-11-15 17:56:32 UTC
(In reply to Bronagh Sorota from comment #5)
> hi Dan
> Please let me know when the nested delete functionality has been added to
> the Azure-armrest gem.
> Thank you
> Bronagh

This functionality is now available in azure-armrest 0.3.12. Please see the VirtualMachineService#delete_associated_resources method.

Comment 10 CFME Bot 2016-11-30 19:23:46 UTC
New commit detected on ManageIQ/manageiq-providers-azure/master:

commit 3c3336a621356d60fe289e00ebde300560cffa39
Author:     Bronagh Sorota <bsorota>
AuthorDate: Tue Nov 29 11:53:51 2016 -0500
Commit:     Bronagh Sorota <bsorota>
CommitDate: Tue Nov 29 11:54:02 2016 -0500

    Delete associated resources (NIC, IP, VHD, .status)
    when deleting a VM

 app/models/manageiq/providers/azure/cloud_manager/vm/operations.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 11 Jeff Teehan 2016-12-01 17:57:26 UTC
I don't know this matters or not, but the disk doesn't get deleted using Retire or Delete from the power menu.  And the disk can show up in any of the storage accounts depending on how the VM was created so you will probably need to explicitly extract the disk location.

Comment 13 Jeff Teehan 2017-03-08 19:10:05 UTC
I'm afraid it's still not working in 58004.  Here are the gem versions

gem list
azure-armrest (0.5.2)
azure-signature (0.2.3)

Delete deletes the VM, but not the collateral resources.

Comment 14 Bronagh Sorota 2017-03-23 17:54:04 UTC
I just deleted a VM from CF and the VHD was removed from the storage account in Azure.
Can you list the steps you took to test this BZ? Did you check for the removal of the VHD in: the storage_account_name/blobs/manageiq on the Azure portal?

Comment 15 Jeff Teehan 2017-04-24 16:48:17 UTC
Are you hardcoded to storage_account_name/blobs/manageiq, specifically, the manageiq part?  The vhd can be located anywhere, and for us, I'm certain we don't store it there for these tests.

Comment 16 Jeff Teehan 2017-04-24 18:06:24 UTC
So, I'm only seeing these two commands in the log, both of which are working.  There does not appear to be a third one deleting the VHD.  Find me when you get in and we can try again.  I have on

[root@10-16-6-115 log]# cat azure.log | grep RestClient.delete
RestClient.delete "https://management.azure.com/subscriptions/xxxxxxxx-b20e-48bd-a0c8-879c6dbcbfbb/resourceGroups/automation/providers/Microsoft.Compute/virtualMachines/avhddel1?api-version=2017-03-30", "Accept"=>"application/js............
RestClient.delete "https://management.azure.com/subscriptions/xxxxxxxx-b20e-48bd-a0c8-879c6dbcbfbb/resourceGroups/Automation/providers/Microsoft.Network/networkInterfaces/avhddel1-nic?api-version=2017-04-01", "Accept"=>"application/js.......

Comment 17 Jeff Teehan 2017-04-26 17:28:16 UTC
Adding the need info.  There must be some reason why it is intermittant.

Comment 18 Bronagh Sorota 2017-04-27 18:00:58 UTC
Hi Jeff,
During VM provisioning we always place the newly provisioned VM's VHD in the above referenced location. 
Which tool are you using to create the VM used in these tests?


Comment 19 Jeff Teehan 2017-04-27 18:46:37 UTC
Note that this feature is for CFME VMs created using Lifecycle provisioning.  The Azure orchestration script may use a different storage location.  Tested with and all VM related items are now removed on a VM delete.

Moving to verified.

Note You need to log in before you can comment on or make changes to this bug.