Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Automate script to delete & detach floating IP addresses from Openstack instances #27

Closed
ryankwilliams opened this issue Dec 12, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@ryankwilliams
Copy link
Contributor

Currently the MIQ REST API does not provide a collection with actions to delete floating IP addresses and detach the IP from instances.

In order to provide networking capabilities #16 we need to leverage MIQ automate feature. We need to create an automate script (Ruby language) to delete/detach IP to instances. Which can be called via the REST API automation_requests collection.

TBD

  • Parameter input
@smatula
Copy link
Contributor

smatula commented Jan 8, 2018

Completed prototype automate scripts:

release_floating_ip - will detach and remove a floating ip. Input Ip name or id.
retire_floating_ip - will detach and delete all floating ips from vm instance. Input of vm.
vm can be given by name or id.

Methods can currently be Imported from the following git: 'https://github.com/smatula/PIT-Datastore.git'.
This will need to be moved to a project repository.

This is just a proof of concept. It is not fully robust. It expects the input values to be correct. It will return errors but the messages are basically a trace and can be cryptic. Exact design will need to be discussed.

Can be imported to Cloudforms or ManageIQ.

  1. Make sure 'Git Repositories Owner' is on in your CloudForms/ManageIQ system.
    Performed from Configuration. The Configuration located in the drop down in the upper right hand corner.
    Settings->Zones

  2. Perform Import
    Automation->Automate->Import/Export
    Import get_floating_ip from Git 'https://github.com/smatula/PIT-Datastore.git'

  3. Once imported you may run it through the rest api as follows:

    A. Update the input json payload file with correct values for method.
    
    B. Execute:
    

    http --verify=no -a : POST https://<manageIQ/cloudforms>:8443/api/automation_requests @<payload_file.json>

    C. Keep checking for Command to finish. Returned request_state equals 'finished'. <id> is the id returned for command executed in B.
    

    http --verify=no -a : https://<manageIQ/cloudform>:8443/api/automation_requests/

    D. Get results from returned data. Once finished. Options will be updated with the return data.
    

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants