Revision c6e57377

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
181 181

  
182 182
    # @return RbVmomi::VIM::ResourcePool
183 183
    def get_rp
184
        req_rp = one_item['USER_TEMPLATE/VCENTER_RP_REF']
184

  
185
        req_rp = one_item['VCENTER_RESOURCE_POOL'] ||
186
                 one_item['USER_TEMPLATE/VCENTER_RESOURCE_POOL']
187

  
188
        #Get ref for req_rp
189
        rp_list    = cluster.get_resource_pool_list
190
        req_rp_ref = rp_list.select { |rp| rp[:name] == req_rp }.first[:ref] rescue nil
185 191

  
186 192
        if vi_client.rp_confined?
187
            if req_rp && req_rp != vi_client.rp
193
            if req_rp_ref && req_rp_ref != vi_client.rp
188 194
                raise "Available resource pool in host [#{vi_client.rp}]"\
189 195
                      " does not match requested resource pool"\
190 196
                      " [#{req_rp}]"
......
192 198

  
193 199
            return vi_client.rp
194 200
        else
195
            if req_rp
196
                rps = cluster.resource_pools.select{|r| r._ref == req_rp }
201
            if req_rp_ref
202
                rps = cluster.resource_pools.select{|r| r._ref == req_rp_ref }
197 203

  
198 204
                if rps.empty?
199 205
                    raise "No matching resource pool found (#{req_rp})."
......
2124 2130
        str_info << "VCENTER_VMWARETOOLS_RUNNING_STATUS=" << vmware_tools    << " "
2125 2131
        str_info << "VCENTER_VMWARETOOLS_VERSION="        << vmtools_ver     << " "
2126 2132
        str_info << "VCENTER_VMWARETOOLS_VERSION_STATUS=" << vmtools_verst   << " "
2127
        str_info << "VCENTER_RP_REF=\""                   << self["resourcePool"]._ref << "\" "
2133
        str_info << "VCENTER_RESOURCE_POOL=\""            << self["resourcePool"].name << "\" "
2128 2134
    end
2129 2135

  
2130 2136
    def reset_monitor

Also available in: Unified diff