-
Notifications
You must be signed in to change notification settings - Fork 85
New module to create/remove standalone vms #95
base: master
Are you sure you want to change the base?
Conversation
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]>
@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? |
@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. I will add later some screenshots from vcloud director to make it clearer. |
f7e20c5
to
a2ab41a
Compare
Yes !! I guess this is the answer to the vm cloud director changes this year, where they are moving away from the vapp construct. |
@Maunty apologies for the late reply, would you like to merge this code? |
0709d92
to
ab2779b
Compare
@Maunty / @mukultaneja I would like to use this functionality. thanks |
Hey @Maunty @mukultaneja, is there an update to this PR? I could really benefit from this additional module! |
Hi everyone, sorry for late response. I currently dont use this module (even when i needed it - i used my fork). Feel free to use this module from my fork. @mukultaneja what we need to merge this PR? |
Hi all, Sorry for the late response. |
Any progress here? |
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.