Commit graph

16 commits

Author SHA1 Message Date
Mahima Singh
d9aee6baee Add vsphere_connection_timeout to prevent thread hangs when vSphere unresponsive 2026-03-13 11:49:16 +05:30
Mahima Singh
4a57a270f6 Wire circuit breaker into vsphere provider public methods
Without this change, the circuit breaker was initialized in base.rb
but never called in the vsphere provider, so vSphere API failures
(TCP timeouts, connection errors) would not trip the circuit open.

Changes:
- Add with_circuit_breaker helper that calls @circuit_breaker.call
  if circuit_breaker is configured, otherwise yields directly
- Wrap vms_in_pool, get_vm, create_vm, destroy_vm, get_vm_ip_address
  with with_circuit_breaker so vSphere failures trip the circuit
- Replace 'return' with 'next' inside blocks where needed to ensure
  circuit breaker on_success is properly called on partial results

This prevents cascading failures: once the circuit opens after
failure_threshold errors, subsequent calls fail fast (CircuitOpenError)
instead of waiting for the full TCP timeout (~18s per pool).

Resolves: P4DEVOPS-9438
2026-03-12 16:49:20 +05:30
isaac-hammes
a223bf4d61 (RE-15750) Handle vm no longer existing when attempting to migrate. 2023-09-07 12:47:58 -07:00
isaac-hammes
9fa1072a32 (maint) Convert booleans and Time objects to strings when being added to redis 2023-08-30 08:57:07 -07:00
isaac-hammes
81f5192ded (maint) Update Gemfile.lock and use block for transaction. 2023-08-28 07:39:11 -07:00
isaac-hammes
978fc0031a (maint) Increase timeout for cloned vms to obtain IPs. 2023-08-23 05:46:49 -07:00
Jake Spain
7316431f78
Increase timeout for getting an IP 2023-08-21 23:27:12 -04:00
Jake Spain
f02e0eb19a
Fix getting IP by not returning a bad address 2023-08-21 23:27:03 -04:00
isaac-hammes
5ca0555a52 (POD-10) Log reason for failed VM checks. 2023-08-17 13:18:33 -07:00
Jake Spain
0579f15a4b
Fix rubocops 2023-04-17 09:07:18 -04:00
Jake Spain
c0e59a0347
Refactor obtaining and saving ip address 2023-04-17 09:07:18 -04:00
Jake Spain
130736fa9d
Use domain provided by pool's dns_config 2023-04-17 09:07:18 -04:00
Jake Spain
daa49dd1c9
Collect the ip address of created VM for use with dns plugins 2023-03-07 12:01:02 -05:00
isaac-hammes
713a4a2c9d (maint) Use timeout builtin to TCPSocket when opening sockets. 2023-03-02 11:27:55 -08:00
Samuel Beaulieu
81d71b8a13
Move vSphere specific methods out of VMPooler
VMPooler has the vSphere provider taken out, moving some vSphere related
methods to the provider:

1) pool_folders
2) get_base_folders

And the related spec tests.
At the same time renaming some configuration and code items
to remove harmful terminology.
Note this version of the vsphere provider needs to run on vmpooler
that also contain the renaming changes (version >2.1)
2021-12-13 10:20:09 -05:00
a08cba099f
Initial commit migrating from VMPooler proper
This copies in all needed files from the main VMPooler repo. Version
1.3.0 of VMPooler was used as the basis for this code.
2021-11-29 16:03:09 -05:00