ErrorHandling? (Vim::login)

Hello

I'm trying to put in place some measures in my script to output to a log file. Somehow, I can't get this to work:

print LOG "login failed\n" If! ((Vim::login)

service_url = & gt; $service_url,.

user_name = & gt; $username,

password = & gt; $password));

in case of error, I get the output on the console, but not in the log file... How this might be done?

Lars

You can use eval blocks:


eval {
     Vim::login( service_url=> $service_url, user_name => $username, password => $password);
};

if ($@) {
     # A fault was thrown
     print LOG $@ . "\n";

     # ...any other error handling...
}

You can also do string comparisons against the $@ variable to see if it corresponds to a fault.  For example, connection could throw "InvalidLogin - thrown if the combination user / password is not valid."  You can use code like:


if ( $@ =~ m/InvalidLogin/gi ) {
      print LOG "Invalid Login ($@)\n";
}
else {
      print LOG "Login Error: ($@)\n";
}

This allows to handle specific errors if you want to retrieve or trigger another way to code accordingly.

Tags: VMware

Similar Questions

  • Solved: Howto disable Rule DRS

    Hello

    I searched and searched, but couldn't find a solution.

    How can I disable a Rule existing DRS with perl?

    Here's where I start but do not get further :-(

    my $cluster = "mycluster."

    # The connection to the Web of VMware Infrastructure service

    Vim::login (service_url = > $service_url, user_name = > $username, password = > $password);

    My $cluster_view = Vim::find_entity_view (view_type = > 'ClusterComputeResource', filter = > {name = > $cluster});

    my $rules = $cluster_view - > configurationEx-> rule;

    foreach (type {$a-> name cmp $b-> name} @$rules) {}

    My $rule = $_;

    #rule active = 1, disabled = 0

    $rule-> active = > 0;

    My $rule_status = $rule - > enabled;

    My $rule_name = $rule-> name;

    Print "$rule_name status: $rule_status \n";

    }

    Kind regards

    Rainer

    My part - in ClusterConfigSpecExtype, the property is named rulesSpec, not ruleSpec.

    #! / usr/bin/perl

    use strict;

    use warnings;

    use VMware::VIRuntime;

    My % opts =)

    cluster-online {}

    => Type ": s"

    necessary,-online 1

    },

    );

    OPTS::add_options (%OPTS);

    OPTS::parse();

    OPTS::Validate();

    Util::Connect();

    My $cluster_view = Vim::find_entity_view)

    view_type-online "ClusterComputeResource."

    filter => {name-online Opts: get_option ('cluster')}

    );

    my $rules is $cluster_view-> {'configurationEx'} {'rule'};.

    My @rule_specs = ();

    foreach my {$rule (type {$a-> name cmp $b-> name} @$rules)}

    My $is_enabled is $rule-> active;.

    My $rule_name = $rule-> name;

    Print "$rule_name $is_enabled \n";

    My $rule_change = new ClusterRuleSpec)

    operation => ArrayUpdateOperation-> new ('edit'),

    Info-Online $rule,

    );

    # Enable or disable the rule

    $rule_change-> {'info'} {'enabled'} = 0;

    push @rule_specs, $rule_change;

    }

    My $cluster_spec = new ClusterConfigSpecEx)

    rulesSpec-online \@rule_specs,

    );

    # Must obtain and check the status of the task, we're going to be lazy and use the version no-Task

    $cluster_view-> ReconfigureComputeResource)

    Spec => $cluster_spec.

    change-online 'true '.

    );

  • test session

    Hello

    I want to load a session and check if it is still active or not.

    If so, the script uses and continue, otherwise the script to connect to vcenter as usual and save the session file for reuse the next time.

    Is there a return code for $vim-> load_session (session_file = > '.mysession');

    Here is my code:

    my $service_url = " " https://$Server/SDK/vimService ";
    My $vim = Vim-> new (service_url = > $service_url);
    $vim-> load_session (session_file = > '.mysession');
    ######
    # Here I would have something like
    ######
    If ($error) {}
    $vim-> login (user_name = > $username, password = > $password);
    # Save the session $vim in file .mysession
    $vim-> save_session (session_file = > '.mysession');
    }

    But as soon as I used an idle session, the script ends by:

    Error when testing connection status ' https://X.X.X.X/sdk/webService': The session is not authenticated.

    SessionIsActive looked, but can't find how to use it
    You have any idea to help me please?
    Rgds

    The SDK connects you by default when the global VIM (or scalar instance) is out of range (it's in the deconstructor).  Try calling

    unset_logout_on_disconnect().

    $vim-> unset_logout_on_disconnect();

    And make sure you are not yelling logout()).

  • Connect to multiple instances of a script vCenter?

    How can I connect to multiple instances of a script vCenter without going through separate-entry sequences of credentials or credentials on disk storage?

    I need to browse through a table of the vCenters and run scripts against each of them. They are not related, but the same credentials must be valid on all instances.

    It would be great if there was also a way of parallelization of this job such as each returned only thread STDOUT is it speeding up the script.

    All suggestions are welcome, I can see some tips using PowerShell, but I need to do it in Perl.

    Thank you

    Stephen

    You get close, you are missing just a few required modules. Here is the final excerpt that will work for you:

    use strict;
    use warnings;
    use VMware::VILib;
    use VMware::VIRuntime;

    {eval
    My $vim = Vim::login (service_url-online $url, user_name => $username, password-online $password).
    My $vms = $vim-> find_entity_views (view_type-online 'VirtualMachine');
    {foreach(@$VMS)}
    Print $_-> name. "\n";
    }
    };
    Si ($@) {}
    Print $@. "\n";
    }

    Make sure you put things highlighted in bold, it's what you have in your Perl script. I checked on the VMAs, but I'm sure it'll work on Windows as well.

    You're right, the documentation can be better... If one of the reason, VMware has created all these routines support auxiliary, is to abstract the complication of the API. They also assumed that you'd be connectingn to a single host or vCenter simultaneously. All that falls on these basic configs, it will take your own code/etc. and where watching is that the first part of the challenge

    Good luck

  • a few questions on the perl sdk

    I've been using perl sdk for 3.5.1 for awhile and I sued to connect with the virtual Center as follows

    Vim::login (service_url = & gt; "https://lbz0893/sdk/vimService", user_name = & gt;... .

    This no longer works on the new vsphere. can someone help me get started with this.

    (2) is there any sdk perl for Mrs. that I can use to create recovery plans and execute them?

    Thank you.

    In fact, there is an API of SRM , but there seems to be any client-side stubs. You may be able to use SOAP::Lite, however, not sure. The API is also quite minimal in its current form.

    =====

    Carter Shanklin

    Read the PowerCLI Blog
    [Follow me on Twitter |] http://twitter.com/cshanklin]

  • user login Active Directory vMA 6.0

    I joined vMA to the AD domain successfully, but the AD users can connect to the device only using the local console (login: class\Administrator) but not using ssh.

    Here is the example:

    Log in as: [email protected]@vma1

    Welcome to SUSE Linux Enterprise Server 11 for VMware (x86_64) - Kernel \r (\l) SP3.

    Keyboard-interactive authentication.

    Password:

    Access denied

    Logs messages

    2015 08-28 T 11: 59:01 + 02:00 vma1 sshd [5545]: invalid user ' 10.216.1.143 class\\Administrator'@vma1

    2015 08-28 T 11: 59:01 + 02:00 vma1 sshd [5545]: input_userauth_request: invalid user ' class\\\Administrator'@vma1 [preauth]

    2015 08-28 T 11: 59:01 + 02:00 vma1 sshd [5545]: keyboard-interactive postponed for the invalid user ' 10.216.1.143 class\\\Administrator'@vma1 port ssh2 40538 [preauth]

    2015 08-28 T 11: 59:04 + 02:00 vma1 sshd [5547]: pam_unix2(sshd:auth): unknown option: 'try_first_pass '.

    2015 08-28 T 11: 59:04 + 02:00 vma1 sshd [5547]: pam_tally2(sshd:auth): pam_get_uid; no user of this type

    2015 08-28 T 11: 59:08 + 02:00 vma1 sshd [5545]: error: PAM: user knows do not for the underlying authentication module for illegal user ' 10.216.1.143 class\\Administrator'@vma1

    2015 08-28 T 11: 59:08 + 02:00 vma1 sshd [5545]: failure of keyboard-interactive/pam for invalid user ' 10.216.1.143 class\\Administrator'@vma1 40538 ssh2 port

    2015 08-28 T 11: 59:08 + 02:00 vma1 sshd [5545]: keyboard-interactive postponed for the invalid user ' 10.216.1.143 class\\\Administrator'@vma1 port ssh2 40538 [preauth]

    Messages to /var/log/auth.log

    2015 08-28 T 11: 57:49 + 02:00 vma1 sshd [5538]: invalid user ' 10.216.1.143 class\\Administrator'@vma1

    2015 08-28 T 11: 57:49 + 02:00 vma1 sshd [5538]: invalid user ' 10.216.1.143 class\\Administrator'@vma1

    2015 08-28 T 11: 57:49 + 02:00 vma1 sshd [5538]: input_userauth_request: invalid user ' class\\\Administrator'@vma1 [preauth]

    2015 08-28 T 11: 57:49 + 02:00 vma1 sshd [5538]: input_userauth_request: invalid user ' class\\\Administrator'@vma1 [preauth]

    2015 08-28 T 11: 57:49 + 02:00 vma1 sshd [5538]: keyboard-interactive postponed for the invalid user ' 10.216.1.143 class\\\Administrator'@vma1 port ssh2 40528 [preauth]

    2015 08-28 T 11: 57:49 + 02:00 vma1 sshd [5538]: keyboard-interactive postponed for the invalid user ' 10.216.1.143 class\\\Administrator'@vma1 port ssh2 40528 [preauth]

    2015 08-28 T 11: 57:53 + 02:00 vma1 sshd [5540]: pam_unix2(sshd:auth): unknown option: 'try_first_pass '.

    2015 08-28 T 11: 57:53 + 02:00 vma1 sshd [5540]: pam_tally2(sshd:auth): pam_get_uid; no user of this type

    2015 08-28 T 11: 57:57 + 02:00 vma1 sshd [5538]: error: PAM: user knows do not for the underlying authentication module for illegal user ' 10.216.1.143 class\\Administrator'@vma1

    2015 08-28 T 11: 57:57 + 02:00 vma1 sshd [5538]: error: PAM: user knows do not for the underlying authentication module for illegal user ' 10.216.1.143 class\\Administrator'@vma1

    2015 08-28 T 11: 57:57 + 02:00 vma1 sshd [5538]: failure of keyboard-interactive/pam for invalid user ' 10.216.1.143 class\\Administrator'@vma1 40528 ssh2 port

    2015 08-28 T 11: 57:57 + 02:00 vma1 sshd [5538]: failure of keyboard-interactive/pam for invalid user ' 10.216.1.143 class\\Administrator'@vma1 40528 ssh2 port

    2015 08-28 T 11: 57:57 + 02:00 vma1 sshd [5538]: keyboard-interactive postponed for the invalid user ' 10.216.1.143 class\\\Administrator'@vma1 port ssh2 40528 [preauth]

    2015 08-28 T 11: 57:57 + 02:00 vma1 sshd [5538]: keyboard-interactive postponed for the invalid user ' 10.216.1.143 class\\\Administrator'@vma1 port ssh2 40528 [preauth]

    already tried different combinations with similar results

    ' class\Administrator'@vma1

    class\\Administrator@VMA1

    class\\Administrator@VMA1

    [email protected]

    Administrator@class@VMA1

    Administrator/class

    class/administrator

    class\\Administrator@local

    ' class\\Administrator'@local

    tomsmig - just like akarydas2 said, you need to comment out the line 'That the groups' in the sshd_config file.  This is mentioned in the original vMA 6.0 release notes.  You can do this by logging in first at the VMAs as the user vi-admin and then running the following command:

    sudo vim/etc/ssh/sshd_config

    Once in the file, arrow down to the line letter and press "Allow wheel groups' 'I' and then place a"#"at the beginning of the line.  The line will turn blue when it is commented out.

    To save it, press "ESC" then enter a colon ":" and then type "wq" (write + quit)

    Then, type: sudo reboot followed by the password admin-vi.

    After the vMA has restarted, you can SSH via PuTTy using your [email protected] credentials.  There is no need to add "@vma1" to the end.  I hope this helps!

  • vim.fault.HttpFault during the sorting of virtual machines in vSphere Client after update 5.1

    Hello. I recently completed an upgrade to vCenter 5.0 > 5.1. I came across some problems common to the teeth with SSO, but things look ok at the moment. I have a problem I would really in trouble - when you try to sort virtual machines in the vSphere client, I see the following error message:

    Impossible to connect to the web service to run the query. Check that the service 'VMware VirtualCenter Management Webservices' works https://vcenter_server_fqdn: 10443 vim.fault.HttpFault

    It is reproducible on multiple systems running the VI client. The Viclient log shows:

    [viclient:SoapTran:P:43] 10:25:30.193 07-01-2013 invoke 4283 finishing on SessionManager:SessionManager [vcenter_server_fqdn] AcquireSessionTicket - series: 0.000, server: 001.425 [ERROR]

    Vmomi.Fault.SystemError: vim.fault.HttpFault

    to VirtualInfrastructure.ManagedObject.InvokeMethod (MethodName, Object [])

    at Vmomi.SessionManager.AcquireSessionTicket (String)

    at VmomiSupport.Services.AuthenticationTicketSource.Next)

    at VMware.VimServices.Query.Impl.LoginByTicketQueryCommand.CreateWebQuery)

    at VMware.VimServices.Query.Impl.WebCommandBase.Execute)

    at VMware.VimServices.Query.QueryServiceBase.Login)

    at VMware.VimServices.Query.Impl.QueryCommandBase.PreProcess)

    at VMware.VimServices.Query.Impl.WebCommandBase.Execute)

    at VMware.VimServices.Query.QueryServiceImpl.ExecuteQuery (QueryWebCommand)

    at VMware.VimServices.Query.QueryServiceImpl.Query (String, Int32, LanguageId)

    at VMware.VimServices.Search.Impl.Utils.NewResults (ResultsInternal)

    to VMware.VimServices.Search.ResultsImpl.RetrievePage (Nullable'1)

    to VMware.VimServices.Search.FilterOrderObjectSetProviderImpl'1.GetObjectSet)

    to VirtualInfrastructure.ObjectSetPoller'1.DoPoll)

    to VirtualInfrastructure.ObjectSetPoller'1. < survey > b__2 (Object)

    ...

    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback (Object)

    [viclient:SoapMsg: P:43] 07-01-2013 10:25:30.193 Vmomi.SessionManager.AcquireSessionTicket of application of RMI - 4283

    " <: containing soap envelope = ' http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance "xmlns:soap =" " http://schemas.xmlsoap.org/SOAP/envelope/ ">

    < soap: Header >

    < operationID > 4C83B7E2-000010BB < / operationID >

    < / soap: Header >

    < soap: Body >

    < AcquireSessionTicket xmlns = "urn: internalvim25" >

    < _This xsi: type = "ManagedObjectReference" type = "SessionManager" serverGuid = "3089D6D0-307C-4B0D-8BD8-94606298C034" > SessionManager < / _this >

    < serviceKey > 1b27d894-3e47-4431-9d7b-c8cb2fd457aa / VIMWEBSVC < / serviceKey >

    < / AcquireSessionTicket >

    < / soap: Body >

    < / envelope soap: >

    Invocation of method error Vmomi.SessionManager.AcquireSessionTicket - 4283

    Message: vim.fault.HttpFault

    XML server:

    " < = xmlns:soapenc soapenv:Envelope ' http://schemas.xmlsoap.org/SOAP/encoding/ "xmlns:soapenv =" " http://schemas.xmlsoap.org/SOAP/envelope/ "container =" " http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">

    < soapenv:Body >

    < soapenv:Fault >

    ServerFaultCode < faultcode > < / faultcode >

    vim.fault.HttpFault < faultstring > < / faultstring >

    < detail >

    < HttpFaultFault xmlns = "urn: internalvim25" xsi: type = 'SystemError' >

    < reason > invalid problem < / reason >

    < / HttpFaultFault >

    < / details >

    < / soapenv:Fault >

    < / soapenv:Body >

    < / soapenv:Envelope >

    [viclient:Error: P:43] 07-01-2013 10:25:30.193 RMI error Vmomi.SessionManager.AcquireSessionTicket - 4283

    < type = "Vmomi.Fault.SystemError error" >

    < message > vim.fault.HttpFault < / Message >

    vim.fault.HttpFault < DetailedMessage >

    < / DetailedMessage >

    lack of < reason > disabled < / reason >

    < / error >

    [viclient:Error: M: 4] 01-07-2013 10:25:30.193 System.Exception: unable to connect to web services to run the query.

    Verify that the 'VMware VirtualCenter Management Web services' service is running on https:// vcenter_server_fqdn: 10443

    to VMware.VimServices.Search.FilterOrderObjectSetProviderImpl'1.GetObjectSet)

    to VirtualInfrastructure.ObjectSetPoller'1.DoPoll)

    Vmomi.Fault.SystemError: vim.fault.HttpFault

    to VirtualInfrastructure.Soap.SoapServiceWrapper.DoInvokeSync (ManagedObject mo, MethodName, methodName, Object [] parameters, Int32 timeoutSecs)

    to VirtualInfrastructure.Soap.SoapTransport.VirtualInfrastructure.Transport.InvokeMethod (pars ManagedObject mo, MethodName, methodName, object [])

    to VirtualInfrastructure.ManagedObject.InvokeMethod (MethodName, methodName, Object [] leave)

    at Vmomi.SessionManager.AcquireSessionTicket (String serviceKey)

    at VmomiSupport.Services.AuthenticationTicketSource.Next)

    at VMware.VimServices.Query.Impl.LoginByTicketQueryCommand.CreateWebQuery)

    -End of the exception stack trace internal-

    [: Sink: M: 4] 01-07-2013 10:25:30.240 error: unable to connect to web services to run the query.

    Verify that the 'VMware VirtualCenter Management Web services' service is running on https:// vcenter_server_fqdn: 10443

    vim.fault.HttpFault

    Stack trace:

    at VirtualInfrastructure.Utils.Log.Trace (String, String, traceCategory)

    at VpxClientCommon.Util.Dialogs.Trace (String, String, String, traceCategory)

    to VpxClientCommon.Util.Dialogs.ShowError (IWin32Window, String, String)

    at VpxClientCommon.ListViewData.OnDisplayMessage)

    at VMware.CustomControls.ListViewEx.DoDisplayMessage)

    at VMware.CustomControls.ListViewEx.WndProc(Message&)

    ...

    at System.Windows.Forms.Application.Run)

    Any ideas/suggestions would be welcome

    My apologies for not updating this post - I completely forgot

    I ended up spending a call with VMware and the resolution in my case was to add my user account in domain directly to the vCenter administrator group - before I had been a member of a group of ESX-Admins who was a member of the Administrators group. I hope this helps...

  • Vim property. UserSession, found ipAddress

    Hello

    I'm trying to convert a stand alone Server 2008 Standard SP2.

    I logged on as local admin and installed the converter stand alone.  When I run the wizard, I set up to convert the local computer.  I put the destination system as the IP address of my server vCenter.  I also provide my login details that need.  I put the Virtual Machine of destination for the cluster of Pilsen and the Destination location for the data store proper, all recounting to convert the diskt to think provisioned.  When I click on complete my vcenter in a virtual machine is created, and then automatically deleted.  I get the error "a general error has occurred: unknown internal error."

    If I look at the newspaper that following result.

    2013 05-28 T 11: 04:23.436 - 05:00 [04716 verbose ' Default'] [VimApi] version local vim.version.version8 is compatible with the remote version vim.version.version7; using the remote version

    2013 05-28 T 11: 04:23.436 - 05:00 [04716 info "Default"] internal\tdisalvo user authentication

    2013 05-28 T 11: 04:23.436 - 05:00 [verbose 04716 ' HttpConnectionPool-000025' '] HttpConnectionPoolImpl created. maxPoolConnections = 1; idleTimeout = 900000000; maxOpenConnections = 1; maxConnectionAge = 0

    In this case above, he accepts my login

    2013 05-28 T 11: 04:23.468 - 05:00 [error 04716 "Default"] vim [VimResultFilter] property. UserSession, found ipAddress

    2013 05-28 T 11: 04:23.468 - 05:00 [error 04716 "Default"] vim [VimResultFilter] property. UserSession, userAgent not found

    2013 05-28 T 11: 04:23.468 - 05:00 [error 04716 "Default"] vim [VimResultFilter] property. UserSession callCount not found


    Here it is said he cannot well the IP address, but I'm not sure who he's talking about, one local on the computer that is being converted?


    2013 05-28 T 11: 04:23.468 - 05:00 VimConnectionStore [04716 verbose "Default"] stop keepalive

    2013 05-28 T 11: 04:23.468 - 05:00 [04716 info "Default"] scheduled timer cancelled, succeeds StopKeepAlive

    2013 05-28 T 11: 04:23.483 - 05:00 [info 04716 ' vmomi.soapStub [24]'] adapter heel of reset for server < cs b 6828 p:037, TCP:192.168.1.90:443 >: closed

    2013 05-28 T 11: 04:23.483 - 05:00 [info 04716 'wizardController"] FillPage()

    2013 05-28 T 11: 05:00.794 - 05:00 [info 04756 "ThreadPool"] Thread has enlisted

    2013 05-28 T 11: 05:05.505 - 05:00 [04964 'wizardController' error] unable to submit work: vmodl.fault.SystemError

    2013 05-28 T 11: 05:05.521 - 05:00 [01524 error 'ConversionState'] Submit job failed: a general error occurred: unknown internal error

    2013 05-28 T 11: 05:05.521 - 05:00 [01524 error 'ConverterWizardWindow'] next / finish failed: a general error occurred: unknown internal error

    2013 05-28 T 11: 06:13.178 - 05:00 [01524 info "ConverterSession"] data converter provider created.

    I have disabled the firewall on both computers and it has not yet solved the problem.  I don't understand what IP he needs.

    As always, help is greatly appreciated.

    The worker logs are more informative. But got this error:

    2013 05-28 T 10: 28:10.560 - 05:00 [02496 WARNING 'Default'] [diagnosticManager, 487] CRC mismatch in the source of workers associated newspapers. Newspapers of worker will not be added to the package of server log.

    Can you please get it manually and upload it? It can be found in vCenter Converter Standalone\logs %ALLUSERSPROFILE%\VMware\VMware. Glance for vmware-converter-worker - xxx.log.

  • Get VIM object by reference using plugin vCloud

    Hello, any suggestions on how to recover a VIM oppose in reference to a host vCloud?  I am looking for resource support provider TDC pools.  Here's what I'm trying that produces a null result:

    for each (var in {VclHostManager.getHostList () vcdInstance)}

    vcdInstance.login ();

    for each (var in {vcdInstance.toAdminObject () .toAdminExtensionObject () .getVMWProviderVdcs () pvdc)}

    for each (var rp in {pvdc.getResourcePools ()})

    var rpVimObj = vcdInstance.getEntityByReference (VclFinderType.VIM_RESOURCE_POOL, rp.resourcePoolVimObjectRef);

    rpVimObj is null

    }

    }

    }


    I also tried some variations of types of finder as VclVimObjectTypeEnum.RESOURCE_POOL but also using rp.resourcePoolRef as parameters to getEntityByReference.  The vCloud host/plugin version is 1.5, with vCO 5.1.

    Hello

    There is a way! First, you must get the MoRef of the providerVdc to identify the resourcepool in a VC. But beware, in environments with multiple vCenter servers the MoRef is perhaps not unique (see here and here).

    I think this code will fit your needs:

    //A Moref is a VC-Identifier
    var rpMorefs = new Array();
    
    //do this for all vcdHosts
    for each (var vcdInstance in VclHostManager.getHostList()) {
    
         vcdInstance.login();
         //get all Provider-vDCs from vcdHost
         for each ( var providerVdc in vcdInstance.toAdminObject().getProviderVdcs())
         {
            //Prepare query - getProviderVdc by name
            var expression = new VclExpression(VclQueryProviderVdcResourcePoolRelationField.NAME, providerVdc.name, VclExpressionType.EQUALS);
            var filter = new VclFilter(expression);
            var params = new VclQueryParams();
            params.setFilter(filter);
    
            while (resultSet != null)  {
                // retrieve ProviderVdcResourcePoolRelationRecord record
                var records = resultSet.getRecords(new VclQueryResultProviderVdcResourcePoolRelationRecord());
    
                for each (var record in records) {
                    //get all resourcePoolMorefs
                    rpMorefs.push(record.resourcePoolMoref);
                }
                resultSet = resultSet.getNextPage();
                }
         }
    }
    
    var resourcePools = VcPlugin.getAllResourcePools();
    
    //get the vCenter-resourcePoolObject by Moref
    for each (var moref in rpMorefs){
    
        for each (var resourcePool in resourcePools) {
            if ( moref == resourcePool.id) {
                System.log("Resourcepool of the providerVdc: " + resourcePool.name);
            }
        }
    
    }
    

    Another way to retrieve the MoRef is to extract the XML providerVdc (providerVdc.toXml ()).

    See you soon,.

    Thomas

  • / usr/bin/useradd obsolete - vim - cmd replacement

    Develop a version esxi5 and I noticed that ' usr/bin/useradd - M s/sbin/nologin user "does not work anymore. It is said to use the vim - cmd command.

    Does anyone know what could be this command?

    Thank you

    Jeff

    It is not in the $PATH, doesn't mean it isn't there. adduser is now located at:

    ~ # / usr/lib/vmware/auth/bin/adduser

    BusyBox v1.20.2 (2012-12-11 11:54:28 PST) multi-call binary.

    Use: adduser [OPTIONS] USER

    Add a user

    Base directory of DIR h

    g GECOS GECOS field

    s shell Login SHELL

    G - GRP add a user to existing group

    S create a system user

    D do not assign a password

    H do not create directory

    u UID user ID

    I could create a local user, the connection via the client vSphere with success and add permissions that worked like a charm. Confirmed the 5.1 (1312873) and 5.5 (1331820)

    Hope this helps,

  • A general error occurred: could not connect with the password of administrator of vim cannot configure VIM account on the host

    Community salvation.

    Story: I was called to look at the configuration of vSphere for a customer. When I started looking, I noticed several problems in the environment of the person who has put in place initially. I've been noting but have done nothing to fix these up to the...

    A question that I've seen is that the server vSphere does not apper communicate properly on ESX 3.5 servers. The error message is similar to a post on this forum ( http://communities.vmware.com/message/1450789?tstart=0) however the same method of solution did not work.

    Currently I have two ESX hosts connected to a console vSphere. The Console displays the disconnected hosts and the error points to the problems with the VPXUSER account. I found

    I searched and found several articles with similar questions, so I chose a course of action

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 1007132

    http://communities.VMware.com/message/1168241

    As a note - vSphere client connections toESX welcomes also directly works very well - don't show no problems and everything seems fine.

    So - my first actions were to disconnect and reconnect one of the hosts.  The operation failed with the error "a general error has occurred: unable to connect with the password of administrator of vim cannot configure VIM account on the host. After that, I followed the elimination of the VPXUSER process, restarted the agents and you reconnect the server for vSphere - to the same result. I then deleted the ESX host, removed the VPXUSER, restarted the agents and added that the host ESX back once again - but no change - the same exact error message. I don't see the VPXUSER ID are re-created by this process - so I guess that ESX and vSphere should know the ID and the password.

    Nothing shows up in the var for this - but one of the articles above explains that as a result of the use of the PAM modules.

    Just for fun, I also tried using the ROOT password and reallowing ROOT to connect via SSH - but I got the same failures. I also tried lifting the VPXUSER ID privleges but - same questions.

    If - goes here - any ideas? I can give other details or screen caputres

    ESX3:

    #%PAM-1.0

    1. Automatically generated by esxcfg-auth

    /lib/security/$ISA/pam_unix.so account required

    AUTH required /lib/security/$ISA/pam_env.so

    AUTH sufficient /lib/security/$ISA/pam_unix.so likeauth nullok

    AUTH required /lib/security/$ISA/pam_deny.so

    attempts at password required /lib/security/$ISA/pam_cracklib.so = 3

    shadow md5 password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok

    /lib/security/$ISA/pam_deny.so password required

    session required /lib/security/$ISA/pam_limits.so

    session required /lib/security/$ISA/pam_unix.so

    ESX4

    #%PAM-1.0

    account required pam_per_user.so /etc/pam.d/login.map

    AUTH required pam_per_user.so /etc/pam.d/login.map

    /etc/pam.d/login.map pam_per_user.so password required

    /etc/pam.d/login.map pam_per_user.so sign in required

    -KjB

  • VMware-vim-cmd: waiting for orders to be completed?

    Hi all, I adapt a backup script I made for VMware Server 1.x to VMware Server 2.x and I'm having trouble doing ordinary things like 'suspend' or "create a snapshot" "a VM from starting.

    There are several ways to do the same thing in a certain way does not require any authentication, others indeed require authentication, for example, to create a snapshot, you can:

    VMware-vim-cmd vmsvc/snapshot.create 'id of the virtual machine.

    or

    vmrun-h https://127.0.0.1:8333 / sdk u user-p password of snapshot "[datastore] /vm_path/vmx_name.vmx '

    The problem with vmware-vim-cmd approach is that it does not wait for the command to complete, and is not a welcome feature in a script.

    Instead, the vmrun command wait until the end, but to use it in a script, you must also include the identification of the user and password information in the script, and it is not welcome.

    So the question (as shown in the topic) is: is it possible to make orders of vim-vmware-cmd to wait until the end?

    If someone knows how to do that I would be very grateful

    Thank you for reading,

    10nico

    The vimsh and the vimsh wrapper vmware-vim-cmd is not officially supported by VMware, that being said, I agree that it should allow you to check the situation, etc. It can be a pro/con and depending on how the call command, the wrappers actually communicate to the VI API server, and if you look at the VI API there are all both blocking and non call.

    Vmware-vim-cmd, the command is executed and returns to the shell for most. You might be able to monitor the tasks that is created and ensure that it is completed, but I have not played too much with it.

    [root@himalaya scripts]# vmware-vim-cmd vimsvc
    Commands available under vimsvc/:
    auth/             login             task_cancel       task_list
    connect           logout            task_description
    license           property_dump     task_info
    

    Again, these are undocumented, unsupported and the behavior will vary =)

    I advise to use the VI API (Powershell or VI Perl Toolkit) to accomplish your tasks, and you can even take a look at some of the utilities that are available with the VI Perl Toolkit Utilities: http://www.vmware.com/support/developer/viperltoolkit/viperl15/doc/perl_toolkit_utilities_idx.html

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • default login name

    I'm running on a server ESXi VIMA. I was talking with a colleague when I assigned the password and missed the default login name which I suppose was root.

    noob question, at the login prompt, which is the user name?

    The default user name is admin-vi.

    Chris

  • Login screen hangs

    Hello.  Since I upgraded to macOS Sierra, my early 2015 MacBook Pro freezes on the login screen.  I tried clean install, reinstall, SMC reset, reset the NVRAM.  Nothing seems to help.  I can finally drag the cursor to the button stop, but it takes a while.  Once it starts up again it is fine... until I have restart or stop again.  Any thoughts?  Thank you.

    Try to start in safe mode (hold down the key of the SIFT when starting) once or twice. The login screen freezes?

  • After Malware that my login is disabled cannot start in safe mode

    Hi if anyone can help.

    A friend tried to watch movies online, I'm not sure of the site they visited, but were asked to install MacKeeper and I believe that they did, as I noticed it was to download and installed the following day and I asked them why they did this and they said it was the only way to watch movies!

    Anyway to cut a long story short my friend then called me to say they received a "pop" window to say that my computer has a virus and call a number of 1800... I told them to do nothing certainly not call the number and I would like to sort.

    So basically since then that then I can not connect to my main account at the start, the section where you type your password won't let me type into it and there is a symbol of the brand of 'question' next to it. If I hold my mouse over the question mark I get a dialog box stating "Please enter your password to iCloud as... as well as the date. I can only login as a guest and I cannot connect in 'safe' mode by holding down the SHIFT key.

    I deleted the MacKeeper Application (and also another OS player application that is newly installed the same day!) and empty the memory cache of my browsers and also now upgraded to 10.11.6

    I also run disk utilities, but still I'm getting this problem trying to connect to my main user account!

    I think that it is some kind of malware, does anyone have ideas how to solve at least the connection problem?

    If I could stamp out to see if there is any malware stuff going on behind the scenes it would be too great!

    All suggestions welcome.

    Thanks, Ciaran

    How did you uninstall the MacKeeper application? Please be as specific as possible, unless you have followed the steps, I suspect that your system has installed to uninstall. If this is the case then you will need to re-install and uninstall immediately by following the instructions of developers. Otherwise, the best thing to do is to do a wipe and installing OS X and then manually install your applications and restore your data from your Time Machine backup.

    I'm sure you probably learned to not let this 'friend' enter the 100' of your computer.

Maybe you are looking for

  • Do I need to activate the iPhone, that I move my content to before making the content switch?

    I pass from a rating of 4 on the iPhone 5 and I was wondering if I need to activate my phone service before transferring the content from one phone to another?

  • Install Firefox OS on TT101

    Hello! How can I install Firefox OS on Huawei TT101? Is it good? And will it be upgraded by WiFi? Is italian available? Is it faster than CyanogenMod 7? I have just a problem: after I installed CyanogenMod 7, my tablet can not be accessed soon after

  • I get alerts from Norton about "updater.exe". Is Firefox updated itself?

    Recently, I decided to use Firefox instead of IE9, so I am new to how it operates. I noticed that whenever I use it for the first time in a session, I get an alert from Norton to the effect that "updater.exe" has been downloaded and that it is safe a

  • Z book 15: cannot access settings of the UEFI.

    When I restart Windows start-up advanced (bottom of menu/settings/chance pc settings screen to the right (under power) / update and recovery/restore/advanced startup; or simply shift + click on restart/power) and go to the fix/change uefi settings (o

  • Drivers for HP PSC 500 for Windows 7.

    I could not install my printer HP PSC 500 on my new HP computer that uses Windows 7 (64-bit), because Idrivers there is apparently no... even if the documentation says drivers are not necessary... ie. already in Windows 7. Is it true that the drivers