Problems with the configuration of the ntp service application

Hi people,

I'm stuck at the configuration of the ntp service to start by default on an esxi server via perl.

That's what I'm doing:

My $hostServiceConfig = new HostServiceConfig (serviceId = > 'ntpd', startupPolicy = > 'on');

My $hsca = [];

Push (hsca @$, $hostServiceConfig);

My $hostConfigSpec = new HostConfigSpec (service = > $hsca);

My $taskRef = $hostProfileManager-> ApplyHostConfig_Task (host = > $host, context = > $hostConfigSpec);

When I ask the status of the command fails:

SOAP fault:

-----------

Error string: the operation is not allowed in the current state.

Lack of details: InvalidState

I guess I'm just missing some small detail. Maybe someone sees my mistake right now :-)

Hi eholtz,

Here's the code I added to hostServiceManagement.pl (IIRC!):

1. check the boot strategy:

sub checkServiceEnabled {
        my ($serviceSystem,$service) = @_;

        my $services = $serviceSystem->serviceInfo->service;

        foreach(@$services) {
                if($_->key eq $service) {
                        return $_->policy;
                }
        }
        return 0;
}

2 then disable the service:

my $policy = &checkServiceEnabled($serviceSystem,$service);
if($policy eq "on") {
        eval {
                $serviceSystem->UpdateServicePolicy(id => $service, policy => "off");
                print "\t" . color("cyan") . "Successfully disabled $service\n" . color("reset");
        };
        if($@) {
                print "\t" . color("red") . "Error: Unable to change startup policy on service \"$service\" due to: " . $@ . color("reset") . "\n";
        }
}elsif($policy eq "off") {
        print "\t" . color("yellow") . "$service is already disabled" . color("reset") . "\n";
} else {
        print "\t" . color("red") . "Error: Unknown startup policy \"$policy\"" . color("reset") . "\n";
}

And to allow:

my $policy = &checkServiceEnabled($serviceSystem,$service);
if($policy eq "off") {
        eval {
                $serviceSystem->UpdateServicePolicy(id => $service, policy => "on");
                print "\t" . color("cyan") . "Successfully enabled $service\n" . color("reset");
        };
        if($@) {
                print "\t" . color("red") . "Error: Unable to change startup policy on service \"$service\" due to: " . $@ . color("reset") . "\n";                     }

}elsif($policy eq "on") {
        print "\t" . color("yellow") . "$service is already enabled" . color("reset") . "\n";
} else {
        print "\t" . color("red") . "Error: Unknown startup policy \"$policy\"" . color("reset") . "\n";
}

P.s.: based on your current score, you should be able to PM me now...

Kind regards

--

Thomas

Tags: VMware

Similar Questions

  • Update Windows problem with the Bits Service and error 0 x 80070057

    The service status: problem with the Bits Service

    Error 0 x 80070057

    Original title: Windows Update problems

    Hi Dexter,

    Can I know the KB # the update fails?

    What is the question pertaining to a specific or all update updates?

    What antivirus software you use on your computer?

    To resolve this problem, see the following article:

    Difficulty errors Windows Update corruption as 0 x 80070002 and 0 x 80070057

    Hope the helps of information. Get back to us with more information to help.

  • Problem with the listening Service: Long delay beginning listener, intermittent connections

    I have problems to connect to my Oracle database.  I don't know what was the cause, but now when I connect to a database that has been working well for the past two years, I usually get an ORA-12541 error.

    I run lsnrctl status on the server and get a prinout like this:

    Copyright (c) 1991, 2010, Oracle.  All rights reserved.

    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=dqaswn02) (PORT = 1521)))
    AMT-12541: TNS:no listener
    AMT-12560: TNS:protocol adapter error
    AMT-00511: no listener
    Windows 64-bit error: 61: unknown error
    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521)))
    AMT-12541: TNS:no listener
    AMT-12560: TNS:protocol adapter error
    AMT-00511: no listener
    Windows 64-bit error: 2: no such file or directory

    I also tried to manually stop the service through services.msc, then by restarting via lsnrctl start, but when I do this I get a very long delay (10 + minutes) before he comes back with something like:

    TNS-01153: failed to process the string: 0i

    I'm quite lost as to what is wrong.  I've been messing around with listener.ora, but I don't see anything difficult in there.  Here's a copy:

    listener.ora # Network Configuration file: E:\app\myc0714\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = E:\app\myc0714\product\11.2.0\dbhome_1)
    (= Extproc PROGRAM)
    (ENVS = "EXTPROC_DLLS=ONLY:E:\app\myc0714\product\11.2.0\dbhome_1\BIN\OraClr11.dll")
    )
    )

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dqaswn02) (PORT = 1521))
    )
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1521))
    )
    )

    # ADR_BASE_LISTENER = E:\app\myc0714
    LOG_FILE_LISTENER = LISTEN PORT
    TRACE_LEVEL_LISTENER = SUPPORT
    TRACE_FILE_LISTENER = LISTEN PORT

    A few times during that time, I was able to connect to the server, via sqlplus, however, it took 10 minutes before the connection is online.  Once I'm connected, I can ask my paintings as expected, but I need an application to connect.

    If anyone has any ideas on what could be the problem, please let me know.

    In fact, there was another thing, I changed when I finally got it works, although I don't know if it was related or not.  In my folder with my track logs, I had a huge (> 4 GB) listener.log file.  I deleted this file right before that I ran the command netsh command to reset and then restarted.  This file was also a bit special, because it had not been updated since around the time that I first encountered this problem.  It seems to be updated on a minute by minute basis, now that I've removed the old.  Is there a problem with this file becomes too big?  My drive was not out of space, but it is very curious that this stopped file update on the same day as when I started having the problem and now works properly again.  I wish I had noted the exact time until I deleted it.

    Link:

    Problem of Listener.log & #8211; large file | Obtained & #039; s Blog

  • BlackBerry Smartphones Blackberry curve 9380 problem with the sos service

    Dear

    BBM

    I am from pakistan

    in 2013, I bought blackberry curve 9380 that it worked well without any problems.

    only 8 months before it shows the installation of the sos service fail.

    I updated a new os in it even it's show same problem so kindly give me the precise of the IDF solution so that I should use.

    model. 9380 curve

    PIN code. [removed personal information]

    BT MAC - 80 60 07 7 BB 20

    Made in Malasia

    It is a forum sponsored by BlackBerry user. I am a user like you.

    I do not understand "SOS service installation failed. What is installation of service in this context with SOS?

    I'm guessing that you mean that you are the only emergency service. I would have again assumed SIM card problem before the problem of the OS.

    Have you tried another SIM card in your BlackBerry and tried your SIM in another phone?

  • Service Windows wireless suddenly stopped working because of problem with the KeyIso service

    Description of the problem: Windows Wireless Services suddenly stopped working on my computer. What I have discovered so far that the problem is that the WLAN AutoConfig service does not work because of the failure of the function "KeyIso". The error message for the mentions "Error 126" KeyIso (the specified module could not be found). Any help to fix this would be appreciated. TDW

    Hello

    What is the antivirus installed on the computer program?

    KeyIso Description:

    The service provides insulation for private keys key processes and operations of such associated encryption required by the common criteria. The service stores and uses long term keys in a secure process in line with the requirements of the common criteria. It should normally be disabled, as otherwise, these cryptographic operations may fail.

    Looks like there could be a corruption with the wireless connection that you have added. You can perform the steps.

    Method 1:

    Try to manually start the wireless service, i.e. the WLAN AutoConfig service. To do this, connect to the computer as an administrator.

    a. Click Start, type services.msc and press enter.
    b. Locate the Autoconfiguration WLAN service, double-click to open its Properties window.
    c as. under the general tab, change the startup type to Automatic and click on the Start button.
    d. click on apply, then ok.

    Method 2:

    To resolve this problem, try using the tool (SFC.exe) System File Checker. To do this, follow these steps:

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833

    Method 3:

    You can uninstall and reinstall the network card and check.

    a. click Start, type Device Manager in the Start search box and press enter.
    b. locate the network adapters and expand the same.
    c. Select the Wireless connection, right click and choose Uninstall.
    d. restart the computer, if prompted.

    Drivers should settle automatically after the computer restarts.

    Now you can install the latest network card drivers and see if that fixes the problem.

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Windows wireless and wired network connection problems
    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    Hope this information helps. Response with status so that we can help you.

  • Problem with the search service on a Windows Server 2012 R2

    Hi all

    I'm having problems setting up my newly installed Server vCenter server.

    Everything seems to be installed properly, at least I got no error message and I am able to connect to the Web Client vSphere.

    However, I can't create a data center as the inventory does not display any server...

    Weird, isn't it?

    When I try to access to the https://localhost:7444 / lookupservice page, a message tells me that the service is not available.

    Is there something else to do here?

    Something else weird to me, a beginner in VMWare environments, is that although I'm loging as administrator, it seems that I have not at all privilege. For example, for roles see, access to licenses and so on.

    How I setting a user administrator 'real '?

    Do you think that my problem might be this question of privilege? And that I do not see any server in the inventory because my administrator user does not have the appropriate rights to view it?



    Thanks in advance for any help you can provide.


    Kind regards


    Jeremy

    OK Guyz... My bad.

    Actually, I connect with the user local administrator instead of the user [email protected].

    Now everything seems fine.

    Sorry for the inconvenience! ;-)

    Jeremy

  • Problem with the web service call

    I use ajax with json to call webservice but its not working with the localhost url in the emulator of the ripple. If I use an ip address or external url does not call the webservice.

    I also tried with BlackBerry, webservice does not.

    can someone guide me how to call the Web service?

    Thank you

    Sundaram

    Your file config.xml needs the ip address or the url in the "whitelist".  Use the access for that tag.  for example:

    
    

    The piece above is not secure because it whitelists ALL------* areas.  You can put your url in the uri.

  • Problem with the internet service of blackBerry Smartphones

    Hi, I had my BB curve less than a month, so I'm still learning.  I can access internet for most sites, but the one that I want - I can not go beyond the main connection.  I am an AVON representative and want to be able to access my AVON site but when I connect, it just reloads the same page - doesn't give me any error messages or anything.  AT first, he said I had to activate Java script - I went to options and enabled the Jave script - but still no luck.  Does anyone have any suggestions.  I have no problem with other sites, but I have not tried all the others I actually connect.

    Thank you

    Sorry I took so long.

    I don't have to connect that I was checking to see if he had all the elements that would keep the BB to access the site.

    I can't speak to the internals.

    I would recommend a third party FREE application. It is called opera mini, another type of browser. It shows the page of the entire site and you can zoom in on what you want on the page. I had the chance to connect to sites on this

    App. I guess that a second reason for you would be especially in the search for the pages of products etc.

    Sorry I couldn't be more helpful. If you could please take a moment to solve this thread using the green check mark in the post that is closest to you to answer your question, I would appreciate it.

    Here is the link for Opera mini, go on your BB and download, be sure to allow all connections. Try it and see if it helps. If you need help, just open a thread and we will help you with it.

    Thank you

    http://www.operamini.com/download/

  • Problems with the Hello service

    Can someone tell me for Win7 32 bit... As it is not working properly... The Hello service do not work properly... PLZ help me in this situation

    Separated from the:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/Bonjour-services-failed-to-start-verify-sufficient/98899444-8aa0-47A6-BA0F-fcd7375a6c58?page=2#LastReply

    Hi again,

    «Hello: frequently asked questions (FAQ)»

    http://support.Apple.com/kb/ht2250

    "Q: Why am I not Hello on my Windows system? ."

    If you install Windows Hello manually, the more likely reason is that it has been installed by an application that relies on the features of Hello. For example:

    • iTunes uses Hello looking for music libraries shared, to find AirPort Express devices to listen to music to and find the Apple TV. »
  • Problem with the creation and application of models

    For somrthing that seems so simple, I'm having a problem to create and apply a template to a page only.

    First, I created a template as follows:

    1. display a full page (index.html)

    2 choose an editable region by highting the content area of the page. This excluded the header, the menu high horozontal, right bar and footer.

    3. went to 'INSERT'-> model-> editable objects

    4 name of container box editable and click on OK

    5. FILE - > save all

    The purple line was shown around the editable and the tag is displayed in the upper left corner of the combo box.

    I assumed that the combo box has successfully been created.

    Then, I tried to apply the model to a new page by using the following steps:

    1 has opened a new blank page called about.html

    2. went to: EDIT-> model-> apply the page model

    3. selection of the Model dialog box displays and I chose the region to editible (1 illustrated)

    select-template-box.jpg

    4. After selecting the editable area, this displsays error:

    inconsistent-region-names.jpg

    Error message reads as follows:

    Some Uea this document have no corresponding regions in the new document

    I tried several times, but I know I have to do something by mistake.

    Can someone help me in learning this task properly. Models seem to be such a powerful thing to use in development with DW.

    Thank you in advance.

    boblan1042

    Try this method:

    * FILE | New > template Page > select model > Create.

    A step by step method that works every time.  Once you familiarize yourself with the help of models, come back and I'll tell you why you receive the path you showed above.

  • Problem with the transfer of applications to a new iphone

    My old 5s, new iPhone is 6 s. I got old and the other from backup restore. More than half of the applications do not appear on the new phone, nor do they appear in "not on this iPhone" appearing in the App Store. When I search a certain app I bought with my old phone, I suggested to BUY this new, even though I am connected with the same Apple ID. Is it possible to fix it?

    You can re - download previously purchased items in you log in to the App Store with the Apple ID used to make the purchase, then accessing the purchases tab.

    Due to the technology called App thinning, apps that have been uploaded to iPhone 5s are different from those needed for the iPhone 6 s, so they need to be downloaded again. This should be given automatically, unless you interrupted the process in some way, or does not give it enough time.

  • Problems with the Web Service using XML in Flex

    Hello

    I use a ColdFusion CFC, which is configured to generate an XML string. It runs on ColdFusion MX 6.1 and is configured as a remote web service. I tested the call and it returns the string XML fine when it is called from another method of Flex unfounded. My problem is this simple Flex application to call the same function via a service web, I wrote below. I cannot get to the exit results, keeps showing as NULL. I can't use the HTTP of Flex appeal for remote access because I'm not under MX7. Does anyone know what is wrong with my code? BTW, I would do the work of cross - domain.xml file to call the cfc, let me know if you want to test and I can add your domain name. Thank you!

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >

    <! - set Web Service to get the XML data of course catalog - >
    < mx:WebService
    ID = "cd".
    "WSDL =" http://training.wonderware.com/components/courses.cfc?wsdl "
    Load = "CD.getCourseCatalogXML.Send ()" "
    showBusyCursor = "true" fault = "Alert.show (event.fault.message), 'Error' ' result =" cdResult (event) ">"
    < mx:operation name = "getCourseCatalogXML" resultFormat = "e4x" >
    < mx:request >
    < IDCalendrier > 3 < / IDCalendrier >
    < / mx:request >
    < / mx:operation >
    < / mx:WebService >

    < mx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    Import mx.rpc.events.ResultEvent;
    Import mx.rpc.events.FaultEvent;

    [Bindable]
    public var outputString:String

    public void cdResult(event:ResultEvent):void
    {
    outputString = event.result as String
    }
    []] >
    < / mx:Script >

    < mx:Canvas horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >
    < mx:Text width = '100% ' paddingLeft = "4" paddingRight = paddingTop "4" = "4" >
    < mx:text > OUTPUT: {outputString} < / mx:text >
    < / mx:Text >
    < / mx:Canvas >

    < / mx:Application >

    Thank you very much! I do not have the notion that the HTTPService is indded just an HTTP call. So yes that it a much simpler way to call just ColdFusion to return the XML string to the application. No reason to use Flash Remoting or CFCS etc... and certainly not a web server. This made the turn that I called a HTTPService now what charges by coldfusion page that returns XML and bam, works well with e4x result etc... Thanks tracy!

  • problems with the connectivity services and ePrint 310a

    I just got a HP 310a as a replacement for what said HP was a 210 a defective. The 210 a would not stay connected to my network and support HP gives up and sent me a gift card to buy a replacement.

    I've set up the replacement. He also had the problem of connectivity but other features wireless everything has worked well. I could print by e-mail to a dedicated e-mail address and printing via my ipod using HP iprint app.

    While he was trying to use the previous suggestions of support to solve the problem of connectivity, the printer now has lost its ability to connect to web services and I can't activate the features of eprint. "" When I try to connect to web services, I get an error message indicating that "web server problem" "problem connecting to the web server.

    I set up the printer with a manual address and that is where the problem started.

    Please, any suggestions how to get this resolved.

    Here's what I recommend:

    1 set a static IP address, but make sure that it is outside the range of your router's DHCP.  If your router uses the range (.2 a.254, reduce the a.2 a.200 beach or something and then assign the printer apart from this, comme.220.)

    2 the gateway address goes into the field of the bridge and the first DNS entry.  Do not fill in the second.  The IP Address of the gateway usually ends par.1

  • Problems with the MSXML6 Service Pack

    You try to download an accounting program and receipt following in the accounting program error... Program could not download SQL Server 2005 Express, we should try to manually download from Microsoft. Tried and received the message that we didn't need to do that, because we have a more recent version. Contacted the software and has been said to see if whatever it is listed as MSXML6, if there is uninstall it and restart. Tried and received MSXML6 Service Pack 2 (KB973686) error fatal error during installation. Do you have any suggestions?

    Hi cowboynd,

    Yes. Try this automated correction.

    http://support.Microsoft.com/kb/968749

    Hope it will be useful.

  • Problem with the Lenovo A536 applications update.

    Hello, recently applications can not stretch. Can not update of applications like Facebook, Twitter, etc. I'm sorry for the bad English, use translate.google.com. Thanks in advance for your time.

    The problem is resolved. This is discussed in detail https://www.androidpit.com/forum/590684/google-play-store-how-to-fix-play-store-error-403

Maybe you are looking for

  • IOS 10 Notes too large font

    Why is that when I write a note in the Notes app in IOS 10 and then copy the note to the post office, the police is so huge compared to previous versions of IOS. Keep the notice I'm shouting at them and it's very annoying. Any suggestions?

  • How to activate Bluetooth on the satellite Pro M70-220

    Hi all! I need help on how to turn on bluetooth on my laptop Toshiba M70-220. Please, help me on this. After a search through the many features of this machine, I can't activate this thing, or maybe it is not yet installed, but then again there is a

  • NXT files (once removed how to recover)?

    Hello I use the LEGO Mindstorms NXT 2.0 brickI accidentally deleted the file my NXT RedData.dat, and I need one of my programs. Even when I say the program "write into the Red data file", it does not recreate the file, so I find myself with no data t

  • Search feature in Windows Explorer does not

    When I open Windows Explorer, I see all my files and documents but I lost my search function.  (I'm on Windows XP Pro version 5.1 Service Pack 3)When I click on the search button or select a file, right click and click search, or go to start and clic

  • Screen goes black after 1 hour

    Since I updated the latest drivers intel 945g chipset intel web site.  In about 1 hour, without mouse or keyboard entry operator plug-and-play monitor turns black I like it or not?  Even if I have a screen saver running monitor will go black like it