foreman_nutanix 0.0.4 → 0.0.5

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: 58fd70712311be5fe72002a0e5d27e70d47e6371cd344383de1a70d5e1947eae
4
- data.tar.gz: 8fd6669232b0872570eb799b7bfcb964d472cc6e54c2985d240ba6f101bd05e3
3
+ metadata.gz: f2fe33e8b9f7999fbd374d6dfa10f3c52005004299dfe6b7003c297d46e46d3a
4
+ data.tar.gz: ca98e7a92c0a5867d1c637d41e825df7c840e515098f75246a6d2fe7cc57a5fd
5
5
  SHA512:
6
- metadata.gz: a5f2caf8a738cf1f4d0863673f4b305adbb621273b4a585e01da0a8c3455b464ce0023a56e7e4cb4327f173d52ba95549ddd7e410d155ea8773eb87bfb4af767
7
- data.tar.gz: 8829e62d3c86b53cd5b78e55c461de38c4ed1a3c9bb4bd36f7ee8fd8f128d1bee743cc40856070f52bce4edff34d3a859aed2fd0ed1a1f9930d58b4a96f8bf05
6
+ metadata.gz: 48bd46610653b7629b1c28c1cd3fceb44bd65e3131d36964c1b6f9376db1810d116a935072f31aa074faaefbcf8d94cd6d27baaabf1dc4035719bc66b2a0686e
7
+ data.tar.gz: 45a9ee8ce535a062ed664264533ecb17e28e24c5b8eec1956d27dfd9dbbfa82d288e0b0b1bfcb24d5d4458b84fa800d335eb47ecf47c9290f25b5997da18a2f0
@@ -47,12 +47,16 @@ module ForemanNutanix
47
47
  vm = NutanixCompute.new(@cluster, {
48
48
  identity: data['ext_id'],
49
49
  name: data['name'],
50
+ description: data['description'],
50
51
  cpus: total_cpus,
51
52
  memory: memory_gb,
52
53
  power_state: data['power_state'],
53
54
  mac_address: data['mac_address'],
54
55
  ip_addresses: data['ip_addresses'] || [],
55
56
  create_time: data['create_time'],
57
+ boot_method: data['boot_method'],
58
+ secure_boot: data['secure_boot'],
59
+ gpus: data['gpus'],
56
60
  })
57
61
  vm.instance_variable_set(:@persisted, true)
58
62
  vm
@@ -89,6 +93,7 @@ module ForemanNutanix
89
93
  vm = NutanixCompute.new(@cluster, {
90
94
  identity: vm_data['ext_id'],
91
95
  name: vm_data['name'],
96
+ description: vm_data['description'],
92
97
  cpus: total_cpus,
93
98
  memory: memory_gb,
94
99
  power_state: vm_data['power_state'],
@@ -7,7 +7,7 @@ module ForemanNutanix
7
7
  :storage_container_ext_id, :num_sockets, :num_cores_per_socket,
8
8
  :disk_size_bytes, :description, :network_id, :storage_container,
9
9
  :disk_size_gb, :power_on, :mac_address, :vm_ip_addresses, :create_time,
10
- :boot_method, :secure_boot
10
+ :boot_method, :secure_boot, :gpus
11
11
 
12
12
  def initialize(cluster = nil, args = {})
13
13
  Rails.logger.info "=== NUTANIX: NutanixCompute::initialize cluster=#{cluster} args=#{args} ==="
@@ -46,6 +46,9 @@ module ForemanNutanix
46
46
  # Boot config
47
47
  @boot_method = args[:boot_method]
48
48
  @secure_boot = args[:secure_boot]
49
+
50
+ # GPUs
51
+ @gpus = args[:gpus]
49
52
  end
50
53
 
51
54
  # Required by Foreman - indicates if VM exists
@@ -320,7 +323,7 @@ module ForemanNutanix
320
323
  # Required by Foreman - pretty machine type
321
324
  def pretty_machine_type
322
325
  Rails.logger.info '=== NUTANIX: NutanixCompute::pretty_machine_type called ==='
323
- "#{@cpus} CPUs, #{memory}GB RAM"
326
+ "#{@cpus} CPUs \t|\t #{memory}GB RAM \t|\t #{disk_size_gb}GB Disk"
324
327
  end
325
328
 
326
329
  # Required by Foreman - volumes/disks
@@ -1,6 +1,11 @@
1
1
  <%= compute_specific_js(compute_resource, "host_edit") %>
2
2
  <%= javascript "hosts", "host_edit", "host_edit_interfaces" %>
3
3
 
4
+ <%= text_f f,
5
+ :description,
6
+ label: _("Description"),
7
+ help_inline: _("Description for VM in Nutanix") %>
8
+
4
9
  <%= select_f f,
5
10
  :image_id,
6
11
  compute_resource.available_images,
@@ -70,11 +75,25 @@ compute_resource.available_boot_methods,
70
75
  :id,
71
76
  :name,
72
77
  { include_blank: _("Select boot method") },
73
- { label: _("Boot method"), help_inline: _("Select boot method") } %>
74
-
75
- <%= checkbox_f f,
76
- :secure_boot,
77
78
  {
78
- label: _("Secure Boot (not applicable to BIOS boot method)"),
79
- help_inline: _("Enable secure boot"),
79
+ label: _("Boot method"),
80
+ help_inline: _("Select boot method"),
81
+ id: "boot-method-select",
80
82
  } %>
83
+
84
+ <div id="uefi-options" class="hidden">
85
+ <%= checkbox_f f,
86
+ :secure_boot,
87
+ { label: _("Secure Boot"), help_inline: _("Enable secure boot") } %>
88
+ </div>
89
+
90
+ <script>
91
+ var $bootMethod = $('#boot-method-select');
92
+
93
+ function toggleUefiOptions() {
94
+ $('#uefi-options').toggleClass('hidden', $bootMethod.val() !== 'uefi');
95
+ }
96
+
97
+ toggleUefiOptions();
98
+ $bootMethod.on('change', toggleUefiOptions);
99
+ </script>
@@ -1,7 +1,11 @@
1
1
  <thead>
2
2
  <tr>
3
3
  <th><%= _("Name") %></th>
4
- <th><%= _("Type") %></th>
4
+ <th><%= _("Description") %></th>
5
+ <th><%= _("CPUs") %></th>
6
+ <th><%= _("Memory (GB)") %></th>
7
+ <th><%= _("Disk Size (GB)") %></th>
8
+ <th><%= _("GPUs") %></th>
5
9
  <th><%= _("State") %></th>
6
10
  <th><%= _("Actions") %></th>
7
11
  </tr>
@@ -26,7 +30,17 @@
26
30
  ) %>
27
31
  <tr>
28
32
  <td><%= link_to_if_authorized vm.name, view_path %></td>
29
- <td><%= vm.pretty_machine_type %></td>
33
+ <td><%= vm.description %></td>
34
+ <td><%= vm.cpus %></td>
35
+ <td><%= vm.memory %></td>
36
+ <td><%= vm.disk_size_gb %></td>
37
+ <td>
38
+ <% if vm.gpus.empty? %>
39
+ <input type="checkbox" disabled/>&nbsp;
40
+ <% else %>
41
+ <input type="checkbox" disabled checked/>&nbsp;
42
+ <% end %>
43
+ </td>
30
44
  <td><%= vm.status.downcase %></td>
31
45
  <td>
32
46
  <%= action_buttons(
@@ -6,6 +6,10 @@
6
6
  <td><%= _("Name") %></td>
7
7
  <td><%= @vm.name %></td>
8
8
  </tr>
9
+ <tr>
10
+ <td><%= _("Description") %></td>
11
+ <td><%= @vm.description %></td>
12
+ </tr>
9
13
  <tr>
10
14
  <td><%= _("Created") %></td>
11
15
  <td><%= if @vm.creation_timestamp
@@ -39,6 +43,18 @@
39
43
  <td><%= _("IP Addresses") %></td>
40
44
  <td><%= @vm.ip_addresses.join(", ") if @vm.ip_addresses.any? %></td>
41
45
  </tr>
46
+ <tr>
47
+ <td><%= _("Boot Method") %></td>
48
+ <td><%= @vm.boot_method %></td>
49
+ </tr>
50
+ <tr>
51
+ <td><%= _("Secure Boot Enabled (UEFI only)") %></td>
52
+ <td><%= @vm.secure_boot %></td>
53
+ </tr>
54
+ <tr>
55
+ <td><%= _("GPUs") %></td>
56
+ <td><%= @vm.gpus %></td>
57
+ </tr>
42
58
  </tbody>
43
59
  </table>
44
60
 
@@ -1,3 +1,3 @@
1
1
  module ForemanNutanix
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Granger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-08 00:00:00.000000000 Z
11
+ date: 2025-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc