MitchDrage commented on PR #264:
URL: 
https://github.com/apache/cloudstack-terraform-provider/pull/264#issuecomment-5364026521

   Hi @Curverneur,
   
   I just finished building this same support for the Ansible collection and 
went through a few iterations to get it all working.
   
   I ran into some issues along the way and checked how you've done it and I've 
spotted a few improvements that I'd like to suggest if I may?
   
   1. Your Read path for importing an existing resource doesn't include 
sourceport, instanceport, description or sourceipaddress - so the first plan 
after an import proposes replacing it.
   2. There's no Update option for changing `virtualmachineids`, so adding or 
removing a VM from a pool will tear down the loadbalancer and recreate it.
   The most-common reason for changing membership would be for conducting 
backend server maintenance, so to rebuild the LB would cause an outage - the 
very thing that you'd be trying to avoid.
   The APIs for `assignToLoadBalancerRule` and `removeFromLoadBalancerRule` 
both work against Internal LBs, so you could either add an Update path to call 
those APIs (and remove ForceNew on it), or alternatively make a separate 
resource for the members (e.g. `cloudstack_loadbalancer_member`) and handle it 
there. That second option is how I did it with the Ansible collection.
   
   Hope that helps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to