Bug 1342640

Summary: [RFE] Azure retirement of private images does not delete all resources
Product: Red Hat CloudForms Management Engine Reporter: ncatling
Component: ProvisioningAssignee: Bronagh Sorota <bsorota>
Status: CLOSED DUPLICATE QA Contact: Leo Khomenko <lkhomenk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: bsorota, jhardy, jteehan, kzvyahin, lkhomenk, obarenbo, simaishi
Target Milestone: GAKeywords: FutureFeature
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: provider:azure:retire:power:delete
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1380728 (view as bug list) Environment:
Last Closed: 2016-10-05 09:46:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Unknown Target Upstream Version:
Embargoed:

Description ncatling 2016-06-03 18:20:28 UTC
Description of problem:
Azure retirement of private images does not delete all resources. Only running instances is removed, leaving 'Network Interface' and 'Public IP Address'.

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


How reproducible:

Steps to Reproduce:
1. Provision instance from private image (Compute > Clouds > Instances > Lifecycle > Provision Instance)
2. Retire instance (Lifecycle > Retire Instance)
3. 

Actual results:
Instance is removed from Azure, 'Network Interface' and 'Public IP Address' remain.

Expected results:


Additional info:

Comment 2 Bronagh Sorota 2016-06-10 13:33:57 UTC
I will take this BZ, the solution is to do what we do for other cloud providers and support floating IPs in the provisioning dialogs.

If the user chooses not to assign a floating IP, a new Public IP will be created automatically. This means we will still inch towards the maximum allowed number of Public IPs in a subscription and region, but this is an issue that exists across all cloud providers we support and should be addressed in a uniform way.
If a customer wishes to delete a Public IP on an instance during retirement they can do this through automate.

Comment 4 Jeff Teehan 2016-07-14 23:14:52 UTC
There is an order to the resource deletions.  I'll update this when my automation is doing it correctly.
Assigning the QE to myself.

Comment 5 CFME Bot 2016-07-15 14:45:48 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d5915744fea29eb84ee49d74fe94d6b99213db9e

commit d5915744fea29eb84ee49d74fe94d6b99213db9e
Author:     Bronagh Sorota <bsorota>
AuthorDate: Fri Jun 17 14:49:36 2016 -0400
Commit:     Bronagh Sorota <bsorota>
CommitDate: Thu Jul 14 15:11:59 2016 -0400

    Azure provisioning - floating IP support
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1342640

 .../providers/azure/cloud_manager/provision.rb     |  1 +
 .../azure/cloud_manager/provision/cloning.rb       | 10 ++++++-
 .../azure/cloud_manager/provision/state_machine.rb |  9 +++++++
 .../miq_provision_azure_dialogs_template.yaml      |  9 +++++++
 .../azure/cloud_manager/provision_spec.rb          | 31 ++++++++++++++++------
 5 files changed, 51 insertions(+), 9 deletions(-)
 create mode 100644 app/models/manageiq/providers/azure/cloud_manager/provision/state_machine.rb

Comment 6 CFME Bot 2016-07-15 14:45:52 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/9067e66e79490c14f95b5432f374893cabddc965

commit 9067e66e79490c14f95b5432f374893cabddc965
Author:     Bronagh Sorota <bsorota>
AuthorDate: Mon Jul 11 13:28:45 2016 -0400
Commit:     Bronagh Sorota <bsorota>
CommitDate: Thu Jul 14 15:40:37 2016 -0400

    Azure floating IP support - Addresses PR feedback
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1342640

 .../manageiq/providers/azure/cloud_manager/provision/cloning.rb  | 9 +++------
 .../manageiq/providers/azure/cloud_manager/provision_spec.rb     | 6 +++---
 2 files changed, 6 insertions(+), 9 deletions(-)

Comment 10 Bronagh Sorota 2016-09-23 15:12:56 UTC
hi Leo

The fix for this BZ is not to delete the IPs or disassociate them with the instance. Instead, the opportunity to reuse a public (floating) IP during VM provisioning was added.
I have provided a fuller explanation here:
https://github.com/ManageIQ/manageiq/pull/9279

Another BZ was created to cleanup residual components after a VM has been deleted, including IPs.
https://bugzilla.redhat.com/show_bug.cgi?id=1348718