RetriesExhaustedError on connecting to HPE iLO 5 through Python iLO REST client












1














Following is a Python based RESTful library client (recommended by HP https://developer.hpe.com/platform/ilo-restful-api/home) that uses Redfish REST API (https://github.com/HewlettPackard/python-ilorest-library) to connect to the remote HPE iLO5 server of ProLiant DL360 Gen10 based hardware



#! /usr/bin/python
import redfish

iLO_host = "https://xx.xx.xx.xx"
username = "admin"
password = "xxxxxx"

# Create a REST object
REST_OBJ = redfish.redfish_client(base_url=iLO_host,username=username, password=password, default_prefix='/redfish/v1')

# Login into the server and create a session
REST_OBJ.login(auth="session")

# HTTP GET request
response = REST_OBJ.get("/redfish/v1/systems/1", None)

print response

REST_OBJ.logout()


I am getting RetriesExhaustedError when creating REST object. However, I can successfully do SSH to the server from the VM (RHEL7.4) where I am running this script. The authentication details are given correctly. I verified that the Web Server is enabled (both port 443 and 80) in the iLO Security - Access settings. Also, in my VM box the Firewalld service has been stopped and IPTables is flushed. But still connection could not be established. What other possibilities I can try yet?










share|improve this question





























    1














    Following is a Python based RESTful library client (recommended by HP https://developer.hpe.com/platform/ilo-restful-api/home) that uses Redfish REST API (https://github.com/HewlettPackard/python-ilorest-library) to connect to the remote HPE iLO5 server of ProLiant DL360 Gen10 based hardware



    #! /usr/bin/python
    import redfish

    iLO_host = "https://xx.xx.xx.xx"
    username = "admin"
    password = "xxxxxx"

    # Create a REST object
    REST_OBJ = redfish.redfish_client(base_url=iLO_host,username=username, password=password, default_prefix='/redfish/v1')

    # Login into the server and create a session
    REST_OBJ.login(auth="session")

    # HTTP GET request
    response = REST_OBJ.get("/redfish/v1/systems/1", None)

    print response

    REST_OBJ.logout()


    I am getting RetriesExhaustedError when creating REST object. However, I can successfully do SSH to the server from the VM (RHEL7.4) where I am running this script. The authentication details are given correctly. I verified that the Web Server is enabled (both port 443 and 80) in the iLO Security - Access settings. Also, in my VM box the Firewalld service has been stopped and IPTables is flushed. But still connection could not be established. What other possibilities I can try yet?










    share|improve this question



























      1












      1








      1







      Following is a Python based RESTful library client (recommended by HP https://developer.hpe.com/platform/ilo-restful-api/home) that uses Redfish REST API (https://github.com/HewlettPackard/python-ilorest-library) to connect to the remote HPE iLO5 server of ProLiant DL360 Gen10 based hardware



      #! /usr/bin/python
      import redfish

      iLO_host = "https://xx.xx.xx.xx"
      username = "admin"
      password = "xxxxxx"

      # Create a REST object
      REST_OBJ = redfish.redfish_client(base_url=iLO_host,username=username, password=password, default_prefix='/redfish/v1')

      # Login into the server and create a session
      REST_OBJ.login(auth="session")

      # HTTP GET request
      response = REST_OBJ.get("/redfish/v1/systems/1", None)

      print response

      REST_OBJ.logout()


      I am getting RetriesExhaustedError when creating REST object. However, I can successfully do SSH to the server from the VM (RHEL7.4) where I am running this script. The authentication details are given correctly. I verified that the Web Server is enabled (both port 443 and 80) in the iLO Security - Access settings. Also, in my VM box the Firewalld service has been stopped and IPTables is flushed. But still connection could not be established. What other possibilities I can try yet?










      share|improve this question















      Following is a Python based RESTful library client (recommended by HP https://developer.hpe.com/platform/ilo-restful-api/home) that uses Redfish REST API (https://github.com/HewlettPackard/python-ilorest-library) to connect to the remote HPE iLO5 server of ProLiant DL360 Gen10 based hardware



      #! /usr/bin/python
      import redfish

      iLO_host = "https://xx.xx.xx.xx"
      username = "admin"
      password = "xxxxxx"

      # Create a REST object
      REST_OBJ = redfish.redfish_client(base_url=iLO_host,username=username, password=password, default_prefix='/redfish/v1')

      # Login into the server and create a session
      REST_OBJ.login(auth="session")

      # HTTP GET request
      response = REST_OBJ.get("/redfish/v1/systems/1", None)

      print response

      REST_OBJ.logout()


      I am getting RetriesExhaustedError when creating REST object. However, I can successfully do SSH to the server from the VM (RHEL7.4) where I am running this script. The authentication details are given correctly. I verified that the Web Server is enabled (both port 443 and 80) in the iLO Security - Access settings. Also, in my VM box the Firewalld service has been stopped and IPTables is flushed. But still connection could not be established. What other possibilities I can try yet?







      python rest






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 7:02

























      asked Nov 19 '18 at 13:53









      Ibrahim Quraish

      1,20021319




      1,20021319
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I found the root cause. The issue is with SSL Certificate verification being done by the Python code.
          This can be turned off by setting the environment variable PYTHONHTTPSVERIFY=0 before running the code solved the problem.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376129%2fretriesexhaustederror-on-connecting-to-hpe-ilo-5-through-python-ilo-rest-client%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I found the root cause. The issue is with SSL Certificate verification being done by the Python code.
            This can be turned off by setting the environment variable PYTHONHTTPSVERIFY=0 before running the code solved the problem.






            share|improve this answer




























              0














              I found the root cause. The issue is with SSL Certificate verification being done by the Python code.
              This can be turned off by setting the environment variable PYTHONHTTPSVERIFY=0 before running the code solved the problem.






              share|improve this answer


























                0












                0








                0






                I found the root cause. The issue is with SSL Certificate verification being done by the Python code.
                This can be turned off by setting the environment variable PYTHONHTTPSVERIFY=0 before running the code solved the problem.






                share|improve this answer














                I found the root cause. The issue is with SSL Certificate verification being done by the Python code.
                This can be turned off by setting the environment variable PYTHONHTTPSVERIFY=0 before running the code solved the problem.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 7 '18 at 9:09

























                answered Dec 7 '18 at 7:33









                Ibrahim Quraish

                1,20021319




                1,20021319






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376129%2fretriesexhaustederror-on-connecting-to-hpe-ilo-5-through-python-ilo-rest-client%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                    SQL update select statement

                    'app-layout' is not a known element: how to share Component with different Modules