class Chef::Knife::Cloud::OvirtVolumeCreate
Public Instance Methods
before_exec_command()
click to toggle source
Calls superclass method
# File lib/chef/knife/ovirt_volume_create.rb, line 26 def before_exec_command super # setup the create options @create_options = { size_gb: locate_config_value('volume_size'), active: 'true', } [:storage_domain, :interface, :bootable, :alias].each do |opt| @create_options[opt] = locate_config_value("volume_#{opt}") if locate_config_value("volume_#{opt}") end # binding.pry @columns_with_info = [ { label: 'Name', key: 'name' }, { label: 'Status', key: 'status' }, ] end
execute_command()
click to toggle source
# File lib/chef/knife/ovirt_volume_create.rb, line 43 def execute_command result = service.connection.add_volume(locate_config_value(:vm_id), @create_options) name = (result / 'disk/name').first.text id = (result / 'disk').first['id'] print "\nWaiting For Volume(#{name}) to become available" Fog.wait_for(120) do print '.' volume_ready(locate_config_value(:vm_id), id) end print "\nActivating Volume" service.connection.activate_volume(locate_config_value(:vm_id), id: id) end