Class: HammerCLIForeman::ComputeResources::Libvirt

Inherits:
Base
  • Object
show all
Defined in:
lib/hammer_cli_foreman/compute_resource/libvirt.rb

Instance Method Summary collapse

Methods inherited from Base

#provider_specific_fields

Instance Method Details

#compute_attributesObject



8
9
10
11
12
13
14
15
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 8

def compute_attributes
  [
    ['cpus',   _('Number of CPUs'), { bold: true }],
    ['memory', _('String, amount of memory, value in bytes'), { bold: true }],
    ['cpu_mode', _('Possible values: %{modes}') % { modes: 'default, host-model, host-passthrough' }],
    ['boot_order', _('Device names to specify the boot order')]
  ]
end

#host_attributesObject



17
18
19
20
21
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 17

def host_attributes
  [
    ['start', _('Boolean (expressed as 0 or 1), whether to start the machine or not')]
  ]
end

#interface_attributesObject



23
24
25
26
27
28
29
30
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 23

def interface_attributes
  [
    ['compute_type',   _('Possible values: %s') % 'bridge, network'],
    ['compute_bridge', _('Name of interface according to type')],
    ['compute_model',  _('Possible values: %s') % 'virtio, rtl8139, ne2k_pci, pcnet, e1000'],
    ['compute_network'], _('Libvirt instance network, e.g. default')
  ]
end

#interfaces_attrs_nameObject



41
42
43
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 41

def interfaces_attrs_name
  'nics_attributes'
end

#mandatory_resource_optionsObject



57
58
59
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 57

def mandatory_resource_options
  super + %i[url]
end

#nameObject



4
5
6
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 4

def name
  'Libvirt'
end

#provider_vm_specific_fieldsObject



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 45

def provider_vm_specific_fields
  [
      Fields::Field.new(:label => _('CPUs'), :path => [:cpus]),
      Fields::Field.new(:label => _('Memory'), :path => [:memory_size]),
      Fields::Field.new(:label => _('Status'), :path => [:state]),
      Fields::Field.new(:label => _('OS Type'), :path => [:os_type]),
      Fields::Field.new(:label => _('Domain Type'), :path => [:domain_type]),
      Fields::Field.new(:label => _('Persistent'), :path => [:persistent]),
      Fields::List.new(:label => _('Boot order'), :path => [:boot_order])
  ]
end

#volume_attributesObject



32
33
34
35
36
37
38
39
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 32

def volume_attributes
  [
    ['pool_name',   _('One of available storage pools'), { bold: true }],
    ['capacity',    _('String value, e.g. 10G'), { bold: true }],
    ['allocation'], _('Initial allocation, e.g. 0G'),
    ['format_type', _('Possible values: %s') % 'raw, qcow2']
  ]
end