Uses a saved session file or session cookie for connecting to a server. Use Util::connect() instead of Vim::login() after loading the session.

You can use save_session() to get a session file or get_session_id() to get a session ID.

Parameters

Parameter Description
service_url URL of the server to which the client connects (optional if using session_file).
session_file Full path and filename for a session file returned by save_session(). You must specify either session_file or session_id. You must pass in the filename as a hash.
session_id Session ID returned by get_session_id(). You must specify either session_file or session_id.

Returns

Returns the vSphere object instance.

Example

To load a session by using a session file, use the following syntax.

load_session(session_file => $filename);

To load a session by using a session ID, use the following syntax.

load_session(service_url => $url, session_id => $sessionid);