Sha256: 24881f940462d45e34add2af32b330b70ff11ff94771e212f41198443db62937

Contents?: true

Size: 821 Bytes

Versions: 27

Compression:

Stored size: 821 Bytes

Contents

require 'manageiq-gems-pending'
require 'ostruct'
require 'MiqVm/MiqVm'

require 'logger'
$log = Logger.new(STDERR)
$log.level = Logger::DEBUG

VHD = raise "Please define VHD"
diskid    = "ide0:0"
hardware  = "#{diskid}.present = \"TRUE\"\n"
hardware += "#{diskid}.filename = \"#{VHD}\"\n"

begin
  ost = OpenStruct.new
  ost.fileName = VHD
  vm = MiqVm.new(hardware, ost)

  vm.rootTrees.each do |fs|
    puts "*** Found root tree for #{fs.guestOS}"
    puts "Listing files in #{fs.pwd} directory:"
    fs.dirEntries.each { |de| puts "\t#{de}" }
    puts
  end

  CATEGORIES	= %w(accounts services software system)
  CATEGORIES.each do |cat|
    puts "Extracting: #{cat}:"
    xml = vm.extract(cat)
    xml.write($stdout, 4)
    puts
  end

  vm.unmount
rescue => err
  puts err.to_s
  puts err.backtrace.join("\n")
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.18.2 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.3.1 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.3.0 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.24 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.18.1 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.23 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.22 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.21 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.20 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.19 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.18 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.17 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.16 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.15 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.14 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.13 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.12 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.11 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.10 lib/MiqVm/test/localVm.rb
manageiq-smartstate-0.2.9 lib/MiqVm/test/localVm.rb