Sha256: 36534beea110ba01bf5c40d6d9529919c0c0f00b71a5ebda8104f3b6cbf87710

Contents?: true

Size: 1.76 KB

Versions: 27

Compression:

Stored size: 1.76 KB

Contents

# Only run if we are calling this script directly
require 'metadata/VmConfig/VmConfig'
require 'metadata/MIQExtract/MIQExtract'

$log = Logger.new("#{File.basename(__FILE__, ".*")}.log")
$log.level = Logger::DEBUG

vmNames = []
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/DHCP Server/Windows Server 2003 Standard Edition.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/SQL 2005 1/SQL1.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/Domain Controller/Windows Server 2003 Standard Edition.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/SQL 2005 2/SQL1.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/VMWare Appliance Marketplace/operating systems/Ubuntu-baseline/Ubuntu server 7.04 EXT2/Ubuntu.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/VMWare Appliance Marketplace/rmoore/Squid/squidserver-minimal.tar/squidserver-minimal/squidserver-minimal/squidserver-minimal.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VMware/Win2K3-EE Fat32/Windows Server 2003 Enterprise Edition.vmx"
# vmNames << "//miq-websvr1/scratch2/vmimages/VirtualPC/WS03R2EE_EXCH_LCS/WS03R2EE_EXCH_LCS.vmc"
# vmNames << "C:/Virtual Machines/MiqSprint25/MIQ Server Appliance - Ubuntu.vmx"
# vmNames << "C:/Virtual Machines/Clone of SQL Svr 1/Clone of SQL Svr 1.vmx"
vmNames << "C:/Virtual Machines/10425-2008-10-05.023502/Ubuntu.vmx"

vmNames.each do |vmName|
  begin
    vmCfg = VmConfig.new(vmName)

    # Print all key/value pairs
    # vmCfg.getHash.each_pair { |k, v| puts "#{k} => #{v}" }

    # Get xml object and print to screen in a nice format
    miqvm = MiqVm.new(vmName, nil)

    xml = vmCfg.toXML(true, miqvm)
    xml.write(STDOUT, 0)
    puts "\n"
  rescue => err
    $log.error err
    $log.error err.backtrace.join("\n")
  end
end

$log.info "done"

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.8 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
manageiq-smartstate-0.2.7 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
manageiq-smartstate-0.2.6 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
manageiq-smartstate-0.2.5 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
manageiq-smartstate-0.2.4 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
manageiq-smartstate-0.2.3 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb
manageiq-smartstate-0.2.2 lib/metadata/VmConfig/test/GetVMwareCfgTest.rb