Class: RbVmomi::VIM::ManagedObject

Inherits:
Object
  • Object
show all
Defined in:
lib/rvc/modules/vsan.rb,
lib/rvc/modules/spbm.rb

Instance Method Summary collapse

Instance Method Details

#_catch_spbm_resets(conn) ⇒ Object



192
193
194
195
196
197
198
199
200
201
# File 'lib/rvc/modules/spbm.rb', line 192

def _catch_spbm_resets(conn)
  begin
    yield
  rescue EOFError
    if conn
      conn.pbm = nil
    end
    raise "Connection to SPBM timed out, try again"
  end
end

#dup_on_conn(conn) ⇒ Object



2453
2454
2455
# File 'lib/rvc/modules/vsan.rb', line 2453

def dup_on_conn conn
  self.class.new(conn, self._ref)
end

#pbm_associated_profilesObject



182
183
184
185
186
187
188
189
190
# File 'lib/rvc/modules/spbm.rb', line 182

def pbm_associated_profiles
  conn = _connection
  _catch_spbm_resets(conn) do 
    pbm = _connection.pbm
    pm = pbm.serviceContent.profileManager
    ids = pm.PbmQueryAssociatedProfile(:entity => self.to_pbmobjref)
    pm.PbmRetrieveContent(:profileIds => ids) 
  end
end

#to_pbmobjrefObject



172
173
174
175
176
177
178
179
180
# File 'lib/rvc/modules/spbm.rb', line 172

def to_pbmobjref
  type = self.class.wsdl_name
  type = "%s%s" % [type[0].downcase, type[1..-1]] 
  PBM::PbmServerObjectRef(
    :objectType => type,
    :key => _ref,
    :serverUuid => _connection.serviceContent.about.instanceUuid
  )
end