foreman_nutanix 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dc8d8d815452a66476d8ac1f6418219bb81a7caf415f612783fbecdd81c7183
4
- data.tar.gz: 730949134174fb0280391012d0f17f6adc20fccfe7cda2809e41daef4b3abfd7
3
+ metadata.gz: 98d7a2fe204f206c4662d5aaff791aac585b138863553564ea07d495f915e0a1
4
+ data.tar.gz: d2e04eba571e9a100664033e13806cfeca2822e7a1964a2d0d9225381baac326
5
5
  SHA512:
6
- metadata.gz: 7a936e9ae13e6872563c4d5ca6c801596925c1b039c7455f1476f5241a3f83adfa30c13bfbaa2538b3833c618065ba41dea24980197ead2ef4d30096503b4823
7
- data.tar.gz: 4f62aca21b33c951b5dc993a39b96667bbdaf4ce109102b718724699eb9d039e2725432308c38a9f7323732df8ecc259044109d35e8b15e327cf1a52c90bc5f4
6
+ metadata.gz: c758a26cd957f60d524fd61d66f89aa0d2dfb72872bd0ce9e19e35c53d7dd8edda1d977f7838c4492ee9e29b55a78a9690460dbf4074ebea9eb2367b110da347
7
+ data.tar.gz: e279ab17cfea206925076204d1f97f313a334e33afa871a873366941b0d6eb8cd5d5d5f4fbbbc8c64ff7205bab2bbb05b5c5c0876971915dd452da9b72ffbd1f
@@ -226,23 +226,10 @@ module ForemanNutanix
226
226
  raise e
227
227
  end
228
228
 
229
- # Called by Foreman after host orchestration completes
230
- # This is where we exit build mode for bare VM provisioning
231
- def setHostForOrchestration(host)
232
- Rails.logger.info "=== NUTANIX: setHostForOrchestration called for host: #{host.name} ==="
233
- super if defined?(super)
234
-
235
- # Auto-exit build mode for bare VM provisioning
236
- # Since we're not installing an OS, the host will never callback naturally
237
- if host && host.build?
238
- Rails.logger.info "=== NUTANIX: Auto-exiting build mode for host #{host.name} ==="
239
- host.build = false
240
- host.save!
241
- end
242
- rescue StandardError => e
243
- Rails.logger.error "=== NUTANIX: Error in setHostForOrchestration: #{e.message} ==="
244
- # Don't fail the whole provisioning if this fails
245
- end
229
+ # Note: Power-on after provisioning is handled by Foreman's built-in
230
+ # setComputePowerUp orchestration task (priority 1000) which runs last.
231
+ # It's triggered when compute_attributes[:start] == '1' and calls start_vm(uuid).
232
+ # VMs are always created in OFF state by the shim server.
246
233
 
247
234
  # New VM instance (not persisted)
248
235
  def new_vm(attr = {})
@@ -6,7 +6,7 @@ module ForemanNutanix
6
6
  :cpus, :memory, :power_state, :subnet_ext_id,
7
7
  :storage_container_ext_id, :num_sockets, :num_cores_per_socket,
8
8
  :disk_size_bytes, :description, :network_id, :storage_container,
9
- :disk_size_gb, :power_on, :mac_address, :vm_ip_addresses, :create_time,
9
+ :disk_size_gb, :mac_address, :vm_ip_addresses, :create_time,
10
10
  :boot_method, :secure_boot, :gpus
11
11
 
12
12
  def initialize(cluster = nil, args = {})
@@ -30,7 +30,6 @@ module ForemanNutanix
30
30
  @network_id = args[:network_id] || args[:network]
31
31
  @storage_container = args[:storage_container]
32
32
  @disk_size_gb = args[:disk_size_gb] || 50
33
- @power_on = args.key?(:power_on) ? args[:power_on] : true # Default to true
34
33
  @subnet_ext_id = args[:subnet_ext_id] || @network_id
35
34
  @storage_container_ext_id = args[:storage_container_ext_id] || @storage_container
36
35
  @num_sockets = args[:num_sockets] || 1
@@ -79,6 +78,10 @@ module ForemanNutanix
79
78
  raise StandardError, 'Storage Container is required for VM provisioning'
80
79
  end
81
80
 
81
+ # Note: VMs are always provisioned in OFF state.
82
+ # Power-on is handled by Foreman's built-in setComputePowerUp orchestration
83
+ # task (priority 1000) which runs after all other provisioning steps complete.
84
+ # It's triggered when compute_attributes[:start] == '1'.
82
85
  provision_request = {
83
86
  name: @name,
84
87
  cluster_ext_id: @cluster,
@@ -89,7 +92,6 @@ module ForemanNutanix
89
92
  memory_size_bytes: memory_bytes,
90
93
  disk_size_bytes: actual_disk_bytes.to_i,
91
94
  description: @description || '',
92
- power_on: @power_on.nil? || @power_on, # Default to true if not set
93
95
  secure_boot: @secure_boot,
94
96
  boot_method: @boot_method,
95
97
  }
@@ -67,12 +67,12 @@ compute_resource.available_storage_containers,
67
67
  } %>
68
68
 
69
69
  <%= checkbox_f f,
70
- :power_on,
70
+ :start,
71
71
  {
72
- label: _("Power On After Creation"),
72
+ label: _("Start After Creation"),
73
73
  help_inline:
74
74
  _(
75
- "Automatically power on the VM after it is created. If power-on fails, the VM will be deleted.",
75
+ "Start the VM after Foreman completes all provisioning steps (DHCP, DNS, TFTP, etc.)",
76
76
  ),
77
77
  checked: true,
78
78
  } %>
@@ -1,3 +1,3 @@
1
1
  module ForemanNutanix
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_nutanix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Granger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-09 00:00:00.000000000 Z
11
+ date: 2026-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc