foreman_nutanix 0.0.3 → 0.0.4

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: 11a2607891ac7dfcfd5d892b2b3277f9eeea5ab6dda221181e4e47b0b98bea80
4
- data.tar.gz: 2ad7001192225388db255b26d314b964e06d5b82b5f93f294953ba133f2430f5
3
+ metadata.gz: 58fd70712311be5fe72002a0e5d27e70d47e6371cd344383de1a70d5e1947eae
4
+ data.tar.gz: 8fd6669232b0872570eb799b7bfcb964d472cc6e54c2985d240ba6f101bd05e3
5
5
  SHA512:
6
- metadata.gz: f9da93bb721b2b838eee320ff779b4594040c5e9d7b165b839d9d936926bf412c390eb46617878902d2f5b31b4c9c4be4e53d2334fde7b854d96261ec0a79748
7
- data.tar.gz: '062282c3d249c3333b414e5f592156b26611454410db2569e5bc473d97c50966638270406043fb1dcc5bae0561ee8801f4e4287e0f582eed7e891eef145b0847'
6
+ metadata.gz: a5f2caf8a738cf1f4d0863673f4b305adbb621273b4a585e01da0a8c3455b464ce0023a56e7e4cb4327f173d52ba95549ddd7e410d155ea8773eb87bfb4af767
7
+ data.tar.gz: 8829e62d3c86b53cd5b78e55c461de38c4ed1a3c9bb4bd36f7ee8fd8f128d1bee743cc40856070f52bce4edff34d3a859aed2fd0ed1a1f9930d58b4a96f8bf05
@@ -23,6 +23,10 @@ module ForemanNutanix
23
23
  NutanixCompute.new(@cluster, attrs)
24
24
  end
25
25
 
26
+ def each(&block)
27
+ all.each(&block)
28
+ end
29
+
26
30
  def get(uuid)
27
31
  Rails.logger.info "=== NUTANIX: ServersCollection::get called with uuid: #{uuid} ==="
28
32
 
@@ -102,4 +106,3 @@ module ForemanNutanix
102
106
  end
103
107
  end
104
108
  end
105
-
@@ -70,6 +70,13 @@ module ForemanNutanix
70
70
  []
71
71
  end
72
72
 
73
+ def available_boot_methods
74
+ [
75
+ OpenStruct.new({ id: 'uefi', name: 'UEFI' }),
76
+ OpenStruct.new({ id: 'bios', name: 'BIOS' }),
77
+ ]
78
+ end
79
+
73
80
  # Available networks for VMs
74
81
  def available_networks
75
82
  Rails.logger.info '=== NUTANIX: Fetching available networks from shim server ==='
@@ -149,13 +156,6 @@ module ForemanNutanix
149
156
  nil
150
157
  end
151
158
 
152
- # Available machine types/flavors
153
- def available_flavors
154
- Rails.logger.info '=== NUTANIX: Returning available flavors ==='
155
- [OpenStruct.new({ id: 'small', name: 'Small (2 CPU, 4GB RAM)' })]
156
- end
157
- alias_method :machine_types, :available_flavors
158
-
159
159
  # Available images
160
160
  def available_images(_opts = {})
161
161
  Rails.logger.info '=== NUTANIX: Fetching available images from shim server ==='
@@ -1,7 +1,13 @@
1
1
  module ForemanNutanix
2
2
  class NutanixCompute
3
3
  attr_reader :identity, :name, :hostname, :cluster, :args
4
- attr_accessor :zone, :machine_type, :network, :image_id, :associate_external_ip, :cpus, :memory, :power_state, :subnet_ext_id, :storage_container_ext_id, :num_sockets, :num_cores_per_socket, :disk_size_bytes, :description, :network_id, :storage_container, :disk_size_gb, :power_on, :mac_address, :vm_ip_addresses, :create_time
4
+ attr_accessor :zone, :machine_type,
5
+ :network, :image_id, :associate_external_ip,
6
+ :cpus, :memory, :power_state, :subnet_ext_id,
7
+ :storage_container_ext_id, :num_sockets, :num_cores_per_socket,
8
+ :disk_size_bytes, :description, :network_id, :storage_container,
9
+ :disk_size_gb, :power_on, :mac_address, :vm_ip_addresses, :create_time,
10
+ :boot_method, :secure_boot
5
11
 
6
12
  def initialize(cluster = nil, args = {})
7
13
  Rails.logger.info "=== NUTANIX: NutanixCompute::initialize cluster=#{cluster} args=#{args} ==="
@@ -36,6 +42,10 @@ module ForemanNutanix
36
42
  @mac_address = args[:mac_address]
37
43
  @vm_ip_addresses = args[:ip_addresses] || []
38
44
  @create_time = args[:create_time]
45
+
46
+ # Boot config
47
+ @boot_method = args[:boot_method]
48
+ @secure_boot = args[:secure_boot]
39
49
  end
40
50
 
41
51
  # Required by Foreman - indicates if VM exists
@@ -77,6 +87,8 @@ module ForemanNutanix
77
87
  disk_size_bytes: actual_disk_bytes.to_i,
78
88
  description: @description || '',
79
89
  power_on: @power_on.nil? || @power_on, # Default to true if not set
90
+ secure_boot: @secure_boot,
91
+ boot_method: @boot_method,
80
92
  }
81
93
 
82
94
  Rails.logger.info "=== NUTANIX: Provisioning VM with request: #{provision_request} ==="
@@ -314,7 +326,8 @@ module ForemanNutanix
314
326
  # Required by Foreman - volumes/disks
315
327
  def volumes
316
328
  Rails.logger.info '=== NUTANIX: NutanixCompute::volumes called ==='
317
- [OpenStruct.new({ name: 'disk-1', size_gb: 20 })]
329
+ # [OpenStruct.new({ name: 'disk-1', size_gb: 20 })]
330
+ []
318
331
  end
319
332
 
320
333
  # Required by Foreman - volumes_attributes setter
@@ -367,4 +380,3 @@ module ForemanNutanix
367
380
  end
368
381
  end
369
382
  end
370
-
@@ -53,9 +53,6 @@
53
53
  |
54
54
  <strong>Images:</strong>
55
55
  <%= @compute_resource.available_images.count %>
56
- |
57
- <strong>Flavors:</strong>
58
- <%= @compute_resource.available_flavors.count %>
59
56
  </td>
60
57
  </tr>
61
58
  </table>
@@ -31,14 +31,6 @@ compute_resource.available_storage_containers,
31
31
  help_inline: _("Storage container for VM disks"),
32
32
  } %>
33
33
 
34
- <%= select_f f,
35
- :machine_type,
36
- compute_resource.available_flavors,
37
- :id,
38
- :name,
39
- { include_blank: _("Select Flavor") },
40
- { label: _("Machine Type"), help_inline: _("VM size template (optional)") } %>
41
-
42
34
  <%= counter_f f,
43
35
  :cpus,
44
36
  { label: _("CPUs"), help_inline: _("Number of CPU cores"), min: 1, max: 32 } %>
@@ -52,12 +44,13 @@ compute_resource.available_flavors,
52
44
  max: 64,
53
45
  } %>
54
46
 
55
- <%= text_f f,
47
+ <%= counter_f f,
56
48
  :disk_size_gb,
57
49
  {
58
50
  label: _("Disk Size (GB)"),
59
51
  help_inline: _("Size of the boot disk in GB"),
60
- value: 50,
52
+ min: 2,
53
+ max: 10_000,
61
54
  } %>
62
55
 
63
56
  <%= checkbox_f f,
@@ -70,3 +63,18 @@ compute_resource.available_flavors,
70
63
  ),
71
64
  checked: true,
72
65
  } %>
66
+
67
+ <%= select_f f,
68
+ :boot_method,
69
+ compute_resource.available_boot_methods,
70
+ :id,
71
+ :name,
72
+ { include_blank: _("Select boot method") },
73
+ { label: _("Boot method"), help_inline: _("Select boot method") } %>
74
+
75
+ <%= checkbox_f f,
76
+ :secure_boot,
77
+ {
78
+ label: _("Secure Boot (not applicable to BIOS boot method)"),
79
+ help_inline: _("Enable secure boot"),
80
+ } %>
@@ -1,3 +1,3 @@
1
1
  module ForemanNutanix
2
- VERSION = '0.0.3'.freeze
2
+ VERSION = '0.0.4'.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.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
- - The Foreman Team
7
+ - Miles Granger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-28 00:00:00.000000000 Z
11
+ date: 2025-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -26,7 +26,7 @@ dependencies:
26
26
  version: '0'
27
27
  description: Nutanix compute resource plugin for Foreman
28
28
  email:
29
- - dev@community.theforeman.org
29
+ - mgra@norceresearch.no
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
@@ -48,7 +48,6 @@ files:
48
48
  - app/views/compute_resources/form/_nutanix.html.erb
49
49
  - app/views/compute_resources/show/_nutanix.html.erb
50
50
  - app/views/compute_resources_vms/form/nutanix/_base.html.erb
51
- - app/views/compute_resources_vms/form/nutanix/_volume.html.erb
52
51
  - app/views/compute_resources_vms/index/_nutanix.html.erb
53
52
  - app/views/compute_resources_vms/show/_nutanix.html.erb
54
53
  - config/initializers/zeitwerk.rb
@@ -1 +0,0 @@
1
- <%= text_f f, :size_gb, class: "col-md-2", label: _("Size (GB)"), label_size: "col-md-2", onchange: 'tfm.computeResource.capacityEdit(this)' %>