ubicloud/spec
Hadi Moshayedi cbd4c77cdf Make VmHostSlice.enabled mean "not scheduled for destroy".
Previously, `VmHostSlice.enabled` was overloaded to mean both:
- The slice was prepared
- The slice was not scheduled for destruction

In old times, we waited for slice to be prepared before preparing the VM
inside it. We removed the “prepared” check in 428d367, so tracking
preparedness in a vm_host_slice column is no longer needed. The
“prepared” state can still be inferred from the Strand’s label if
necessary.

A slice is allocatable immediately upon creation (we already allocate
the first VM at creation time). When `slice.is_shared=false`, 2nd
allocation couldn't happen. When `slice.is_shared=true`, we waited until
the slice is prepared to allow the 2nd allocation. This isn't necessary.

The other use of `enabled` is to prevent new VM allocations once a slice
is scheduled for destruction. A slice is marked for destroy when its
last VM begins teardown.

-------------

Dropping the “prepared” purpose of `enabled` clarifies its intent and
fixes an edge case where unprepared slices could be left behind after
their final VM was deleted. Previously, `Nexus::destroy_slice` relied on
an `enabled: true → false` transition that never fired for unprepared
slices, leaving them orphaned. This could happen for example in cases
when a VM was destroyed before its slice was prepared.

Theoretically, there were few other ways to solve this issue. But this
change makes the system less complex in addition to solving the issue.
2025-07-15 16:54:14 -07:00
..
clec Introduce autoloading of a test helper 2024-10-29 07:40:12 -07:00
lib Add OpenSSH integration test for SshKey 2025-07-14 18:14:37 -07:00
model Include Vm ch_version in GithubRunner#log_duration if available 2025-07-15 01:50:21 +09:00
prog Make VmHostSlice.enabled mean "not scheduled for destroy". 2025-07-15 16:54:14 -07:00
routes Disallow changing login for an account to a locked domain 2025-07-16 08:06:32 +09:00
scheduling Support filtering by os_version in the Allocator 2025-07-15 01:50:21 +09:00
serializers Return current and target sizes in PG API 2025-07-08 20:19:56 +05:30
cli_config.ru Change CLI --version option to version command 2025-03-19 14:08:49 -07:00
cli_spec.rb Delete the UBI_TOKEN environment variable before testing for its absence 2025-04-08 22:22:45 +03:00
config_spec.rb Increase Config test coverage and delete unused lines 2023-08-07 01:05:05 +03:00
coverage_helper.rb Stop using omniauth_openid_connect 2025-07-08 00:10:06 +09:00
db_spec.rb Better NetAddr/Sequel integration 2025-06-12 07:32:57 +09:00
resource_methods_spec.rb Combine the two resource_methods_spec files 2025-06-04 04:55:45 +09:00
respirate_smoke_test.rb Make partitioned respirate automatically rebalance based on number of workers 2025-06-14 01:46:43 +09:00
ruby_sdk_spec.rb Add inference api key support to the ruby sdk 2025-05-03 03:33:32 +09:00
spec_helper.rb Pass the vm host family while assembling it 2025-05-13 17:25:23 +03:00
thawed_mock.rb Add OIDC login flow 2025-07-08 00:10:06 +09:00
ubid_spec.rb Add specs for gen_timestamp_ubid_uuid database function 2025-06-04 05:26:37 +09:00