Class: VagrantPlugins::XenServer::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::XenServer::Config
- Defined in:
- lib/vagrant-xenserver/config.rb
Instance Attribute Summary collapse
-
#api_timeout ⇒ Int
Timeout for commands sent to XenServer.
-
#memory ⇒ Int
Memory settings.
-
#name ⇒ String
Name of the VM.
-
#pv ⇒ Bool
True if the VM should be PV.
-
#use_himn ⇒ Object
Use HIMN: If this is set, we’ll use the host-internal-management-network to connect to the VM (proxying via dom0) Useful if the guest does not have tools installed.
-
#xs_host ⇒ String
The XenServer host name or IP.
-
#xs_password ⇒ String
The XenServer password.
-
#xs_port ⇒ Int
The port to communicate with the API on XenServer.
-
#xs_use_ssl ⇒ Bool
True if the API should be accessed over SSL/TLS.
-
#xs_username ⇒ String
The XenServer username.
-
#xva_url ⇒ String
XVA URL: If this is set, we’ll assume that the XenServer should directly download an XVA from the specified URL.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/vagrant-xenserver/config.rb', line 60 def initialize @xs_host = UNSET_VALUE @xs_port = UNSET_VALUE @xs_use_ssl = UNSET_VALUE @xs_username = UNSET_VALUE @xs_password = UNSET_VALUE @name = UNSET_VALUE @pv = UNSET_VALUE @api_timeout = UNSET_VALUE @memory = UNSET_VALUE @xva_url = UNSET_VALUE @use_himn = UNSET_VALUE end |
Instance Attribute Details
#api_timeout ⇒ Int
Timeout for commands sent to XenServer
44 45 46 |
# File 'lib/vagrant-xenserver/config.rb', line 44 def api_timeout @api_timeout end |
#memory ⇒ Int
Memory settings
49 50 51 |
# File 'lib/vagrant-xenserver/config.rb', line 49 def memory @memory end |
#name ⇒ String
Name of the VM
34 35 36 |
# File 'lib/vagrant-xenserver/config.rb', line 34 def name @name end |
#pv ⇒ Bool
True if the VM should be PV
39 40 41 |
# File 'lib/vagrant-xenserver/config.rb', line 39 def pv @pv end |
#use_himn ⇒ Object
Use HIMN: If this is set, we’ll use the host-internal-management-network to connect to the VM (proxying via dom0) Useful if the guest does not have tools installed
58 59 60 |
# File 'lib/vagrant-xenserver/config.rb', line 58 def use_himn @use_himn end |
#xs_host ⇒ String
The XenServer host name or IP
9 10 11 |
# File 'lib/vagrant-xenserver/config.rb', line 9 def xs_host @xs_host end |
#xs_password ⇒ String
The XenServer password
29 30 31 |
# File 'lib/vagrant-xenserver/config.rb', line 29 def xs_password @xs_password end |
#xs_port ⇒ Int
The port to communicate with the API on XenServer
14 15 16 |
# File 'lib/vagrant-xenserver/config.rb', line 14 def xs_port @xs_port end |
#xs_use_ssl ⇒ Bool
True if the API should be accessed over SSL/TLS
19 20 21 |
# File 'lib/vagrant-xenserver/config.rb', line 19 def xs_use_ssl @xs_use_ssl end |
#xs_username ⇒ String
The XenServer username
24 25 26 |
# File 'lib/vagrant-xenserver/config.rb', line 24 def xs_username @xs_username end |
#xva_url ⇒ String
XVA URL: If this is set, we’ll assume that the XenServer should directly download an XVA from the specified URL
54 55 56 |
# File 'lib/vagrant-xenserver/config.rb', line 54 def xva_url @xva_url end |
Instance Method Details
#finalize! ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/vagrant-xenserver/config.rb', line 74 def finalize! @xs_host = nil if @xs_host == UNSET_VALUE @xs_port = 80 if @xs_port == UNSET_VALUE @xs_use_ssl = false if @xs_use_ssl == UNSET_VALUE @xs_username = nil if @xs_username == UNSET_VALUE @xs_password = nil if @xs_password == UNSET_VALUE @name = nil if @name == UNSET_VALUE @pv = nil if @pv == UNSET_VALUE @api_timeout = 60 if @api_timeout == UNSET_VALUE @memory = 1024 if @memory == UNSET_VALUE @xva_url = nil if @xva_url == UNSET_VALUE @use_himn = false if @use_himn == UNSET_VALUE end |
#validate(machine) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/vagrant-xenserver/config.rb', line 88 def validate(machine) errors = _detected_errors errors << I18n.t("vagrant_xenserver.config.host_required") if @xs_host.nil? errors << I18n.t("vagrant_xenserver.config.username_required") if @xs_username.nil? errors << I18n.t("vagrant_xenserver.config.password_required") if @xs_password.nil? if not (machine.config.vm.networks.any? { |type,| type == :public_network }) errors << I18n.t("vagrant_xenserver.config.himn_required") if not @use_himn end { "XenServer Provider" => errors } end |