Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

New module to create/remove standalone vms #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Maunty
Copy link

@Maunty Maunty commented Jan 13, 2020

Made execute_task to return task_state variable that contains information about executed task.
This information may be converted with pycloud.vcd.utils:task_to_dict function and returned to ansible play.

New module vcd_vdc_vm. Creates and removes vms with autonatime vapp.
This code is a mix of vcd_vapp_vm.py module and pycloud.vcd.vapp::vapp:to_sourced_item.
To use this module cloud must support 32.0 api version.

To remove such stanalone vms its vapp name is still needed. Vapp name is unique, vms name not.
To create vms target_vapp is not required but still needed if play must be idempotent.
Vapp name may be get from module output - msg.owner_name

Mainly add_vm from vcd_vdc_vm and vcd_vapp_vm are similar. Create vm task is generated by self.to_instantiate_vm_template_params function instead of self.vapp.to_sourced_item in vcd_vapp_vm. Main difference is in high level tags name. Function delete_vm is inspired by same functions from vcd_vapp_vm and vcd_vapp. Operations are supported throw vcd_vapp_vm* modules.

Made execute_task to return task_state variable that contains information about executed task.
This information may be converted with pycloud.vcd.utils:task_to_dict function and returned to ansible play.

Signed-off-by: Rotaru Sergey <[email protected]>
New module vcd_vdc_vm. Creates and removes vms with autonatime vapp.
This code is a mix of vcd_vapp_vm.py module and pycloud.vcd.vapp::vapp:to_sourced_item.
To use this module cloud must support 32.0 api version.

To remove such stanalone vms its vapp name is still needed. Vapp name is unique, vms name not.
To create vms target_vapp is not required but still needed if play must be idempotent.
Vapp name may be get from module output - msg.owner_name

Mainly add_vm from vcd_vdc_vm and vcd_vapp_vm are similar. Create vm task is generated by self.to_instantiate_vm_template_params function instead of self.vapp.to_sourced_item in vcd_vapp_vm. Main difference is in high level tags name. Functionin delete_vm is inspired by same functions from vcd_vapp_vm and vcd_vapp. Operations are supported throw vcd_vapp_vm* modules.

Signed-off-by: Rotaru Sergey <[email protected]>
@mukultaneja
Copy link
Collaborator

@Maunty, thanks for submitting a PR. Could you please help me to understand how this module is different than vcd_vapp_vm in terms of its purpose?

@Maunty
Copy link
Author

Maunty commented Feb 9, 2020

@mukultaneja, hi. This module creates standalone vm. When it is not linked to any of VApp. In fact it has vapp, but u cant see them in vapp frames, such vm u can create from vcloud interface in vms frame. If i a not wrong such vapp is called auto natured. This module need 32 api version support from vcloud.

In fact u still need to register vapp name after creation to shutdown, start(throw vcd_vapp_vm module ) or delete vapp (throw this module, deleting of snadalone vm is different). We are using tool developed by our team with a database, dynamic registry and web interface, that why is not a problem to save vapp name and use it in further playbook runs.
To stop and start action u need to use vcd_vapp_vm as i mentioned earlier.

I will add later some screenshots from vcloud director to make it clearer.

@Maunty
Copy link
Author

Maunty commented Feb 10, 2020

New vm
Screenshot from 2020-02-10 10-15-35
Creation
Screenshot from 2020-02-10 10-15-57
Standalone vm with auto natured vapp
Screenshot from 2020-02-10 10-18-06
Vapp frame
Screenshot from 2020-02-10 10-18-14

@sgutermann
Copy link

Yes !! I guess this is the answer to the vm cloud director changes this year, where they are moving away from the vapp construct.

@mukultaneja
Copy link
Collaborator

@Maunty apologies for the late reply, would you like to merge this code?

@rmeichsner
Copy link

@Maunty / @mukultaneja I would like to use this functionality.
any plans to merge the code and complete the pr?

thanks

@nwerker
Copy link

nwerker commented Apr 20, 2021

Hey @Maunty @mukultaneja,

is there an update to this PR? I could really benefit from this additional module!

@Maunty
Copy link
Author

Maunty commented Apr 26, 2021

Hi everyone, sorry for late response.

I currently dont use this module (even when i needed it - i used my fork).
I still have some access to infrastructure with vcloud director but i dont know current api version of it.

Feel free to use this module from my fork.

@mukultaneja what we need to merge this PR?
I got tons of messages from GH because of my GH organization, best way to contact me for this pr i think would be telegram @w3orc.
I will update my fork with latest updates i will return with feedback - if this module is still working.

@mukultaneja
Copy link
Collaborator

mukultaneja commented Apr 27, 2021

Hi all, Sorry for the late response.
@Maunty please write a wiki page to describe how to use this module along with a sample playbook.

@whoamiUNIX
Copy link

Any progress here?

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

Successfully merging this pull request may close these issues.

6 participants