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
# 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' }]
  ]
end

#host_attributesObject



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

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

#interface_attributesObject



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

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



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

def interfaces_attrs_name
  'nics_attributes'
end

#mandatory_resource_optionsObject



55
56
57
# File 'lib/hammer_cli_foreman/compute_resource/libvirt.rb', line 55

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



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

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])
  ]
end

#volume_attributesObject



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

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