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