Class: Veewee::Provider::Kvm::Box

Inherits:
Core::Box show all
Includes:
Core, Core::BoxCommand, Veewee::Provider::Kvm, BoxCommand
Defined in:
lib/veewee/provider/kvm/box.rb

Instance Attribute Summary collapse

Attributes inherited from Core::Box

#definition, #env, #name, #provider

Instance Method Summary collapse

Methods included from BoxCommand

#add_floppy, #add_virtio_drivers, #build, #console_type, #create, #create_server, #create_volume, #destroy, #destroy_vm, #destroy_volume, #exists?, #exists_vm?, #exists_volume?, #export_vagrant, #halt, #ip_address, #poweroff, #running?, #stop, #template_metadatafile, #up, #validate_kvm

Methods included from Core::BoxCommand

#check_output_run, #check_output_sudorun, #checks_linux, #checks_windows, #copy_to_box, #create_floppy, #create_wget_vbs_command, #escape_and_echo, #exec, #halt, #issh, #poweroff, #run_hook, #scp, #send_vnc_keycode, #ssh, #ssh_command_string, #string_to_vnccode, #sudo, #validate_tags, #vnc_type, #wget_vbs, #wget_vbs_file, #wincp, #winrm, #winrm_command_string

Methods inherited from Core::Box

#gem_available?, #reload, #set_definition, #ui

Methods included from Core::Helper::Iso

#download_iso, #download_progress, #hashsum, #no_proxy?, #verify_iso, #verify_sum

Methods included from Core::Helper::Comm

#comm_execute, #comm_method, #comm_transfer_file, #when_comm_login_works

Methods included from Core::Helper::Ssh

#build_ssh_options, #ssh_connection, #ssh_execute, #ssh_key_to_a, #ssh_options, #ssh_transfer_file, #tcp_test_ssh, #when_ssh_login_works

Methods included from Core::Helper::Shell

#shell_exec

Methods included from Core::Helper::Web

#allow_for_http_request, #wait_for_http_request

Methods included from Core::Helper::Tcp

#execute_when_tcp_available, #get_local_ip, #guess_free_port, #guess_free_ssh_port, #host_ip_as_seen_by_guest, #is_tcp_port_open?

Constructor Details

#initialize(name, env) ⇒ Box


30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/veewee/provider/kvm/box.rb', line 30

def initialize(name,env)

  super(name,env)

  @connection=::Fog::Compute[:libvirt]

  # Many of the existing templates have disk_format set to "VDI"
  # Use "qcow2" instead as a vagrant-libvirt-compatible default
  definition.disk_format.downcase!
  definition.disk_format = "qcow2" if definition.disk_format == "vdi"
  @volume_name = "#{name}.#{definition.disk_format}"

end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection


28
29
30
# File 'lib/veewee/provider/kvm/box.rb', line 28

def connection
  @connection
end