Revision 1ce3451a

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
1989 1989
        self['rootSnapshot'] && !self['rootSnapshot'].empty?
1990 1990
    end
1991 1991

  
1992
    def get_vcenter_disks
1993
        disks = []
1994
        @item["config.hardware.device"].each do |device|
1995
            disk = {}
1996
            if is_disk_or_iso?(device)
1997
                disk[:device]    = device
1998
                disk[:datastore] = device.backing.datastore
1999
                disk[:path_wo_ds]= device.backing.fileName.sub(/^\[(.*?)\] /, "")
2000
                disk[:path]      = device.backing.fileName
2001
                disk[:type]      = is_disk?(device) ? "OS" : "CDROM"
2002
                disks << disk
2003
            end
2004
        end
2005
        return disks
2006
    end
2007

  
2008
    def get_vcenter_nics
2009
        nics = []
2010
        @item["config.hardware.device"].each do |device|
2011
            nic = {}
2012
            if is_nic?(device)
2013
                nic[:net_name]  = device.backing.network.name
2014
                nic[:net_ref]   = device.backing.network._ref
2015
                nic[:pg_type]   = VCenterDriver::Network.get_network_type(device)
2016
                nics << nic
2017
            end
2018
        end
2019
        return nics
2020
    end
2021

  
2022 1992
    def remove_poweroff_detached_vcenter_nets(networks)
2023 1993
        esx_host = VCenterDriver::ESXHost.new_from_ref(@item.runtime.host._ref, vi_client)
2024 1994
        dc = cluster.get_dc # Get datacenter

Also available in: Unified diff