Please login or register. October 18, 2019, 09:13:44 PM

Author Topic: Cloud-Init on AIX - no RPMs needed  (Read 11712 times)

0 Members and 1 Guest are viewing this topic.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Cloud-Init on AIX - no RPMs needed
« on: November 04, 2015, 11:32:43 AM »
Getting closer - here is space to give and receive feedback on Cloud-Init for AIX - which is important when working with PowerVC for deployment.

This is the initial setup - download cloud-init-0.7.6 from ...

Although - you can get a copy of setuptools, pip, and cloud-init as I used them from AIXTOOLS PYTHON TEST

From my post on the portal - updated a bit!:
Code: [Select]
# installp -d /data/aixtools/tools -aXc aixtools.python.rte
# export PATH=${PATH}:/opt/bin
# cd /data/prj/aixtools/python/setuptools
# python ./ez_setup.py
# cd ../pip/pip-7.1.2
# python ./setup.py install
# cd /data/prj/launchpad/cloud-init-0.7.6
# pip install nose
# pip install mocker
# pip install PyYAML
# pip install requests
# pip install httpretty
# pip install jsonpatch
# pip install configobj
# pip install pyserial
# installp -d /data/aixtools/gnu -aXc aixtools.gnu.make
# nohup /opt/bin/make
# egrep "^ImportError" nohup.out
ImportError: No module named oauth.oauth
# pip install oauth
# rm nohup.out; nohup /opt/bin/make


« Last Edit: November 04, 2015, 11:42:54 AM by Michael »

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #1 on: November 04, 2015, 12:37:27 PM »
I installed my packaging of bash and the results improved quite a bit:

Code: [Select]
----------------------------------------------------------------------
-Ran 344 tests in 13.285s
+Ran 344 tests in 13.990s

-FAILED (errors=31, failures=4)
+FAILED (errors=22, failures=4)
 Makefile:34: recipe for target 'test' failed

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #2 on: December 09, 2015, 09:05:17 AM »
I am getting started on this again. To my dismay the source control of cloud-init is not inclusive.
There is a version of cloudint (version 0.7.5) with additions for AIX, but the version I downloaded (says it is 0.7.6) does not have these included.

It seems that a "single-source" that everyone mirrors, patches, etc. does not exist.

So restarting again - taking the "source" chmod666 mentions in his blog at http://chmod666.org/index.php/tag/cloud-init/, i.e., more general info from https://github.com/transt/cloud-init-0.7.5.

The zip file containing cloud-init can be downloaded here : https://github.com/transt/cloud-init-0.7.5/archive/master.zip

This is what I shall be using as the basis for my restart!

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #3 on: February 18, 2016, 11:33:50 AM »
I want to say finished - as I finally got to work with someone on a PowerVC environment and could do my own debugging.

The files you need are available as a "bundle" at: http://download.aixtools.net/test/cloudinit/aixtools.python.cloudinit.bundle.tar.bz2

Quick article on cloud-init made easy is at: http://www.rootvg.net/content/view/758/114/

Morten

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #4 on: February 19, 2016, 05:28:46 AM »
Tested successfully on AIX 7.1 TL4 with PowerVC 1.3. At least the important bits works.

Will test on AIX 6.1 and 7.2 too. This is a great time saver and maybe most important, takes away the problem of keeping a Frankenstein RPM install patched and updated (with RPM requirements from multiple repositories that also have to fit with whatever else you have installed on the system).

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #5 on: February 19, 2016, 08:57:05 AM »
Thanks for the feedback!


Morten

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #6 on: February 19, 2016, 09:32:17 PM »
Tested AIX 6.1 TL9 and 7.2 and they both seems to work. Configured network as it should be, ip address, DNS config.

So far so good!

If anyone wonders if they should give this bundle a try, just do it. Recommended!

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #7 on: February 21, 2016, 07:44:48 PM »
BTW: If you have requests, rather suggestions, for better defaults (e.g., in /etc/cloud/cloud.cfg) - let me know. I can certainly modify defaults so that it works even better out of the box!

dean

  • Registered
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #8 on: May 10, 2016, 12:22:54 AM »
I'm eager to test this out in our environment after too long grappling with RPMs - this could be a life saver. However I'm getting a 403 access denied when attempting to download the bundle, and I'm getting the same error when trying to download other packages via download.aixtools.net (e.g. python, git). I'm pretty sure last time I downloaded a package from here I didn't need credentials, has this changed?

PS thanks Michael for your work which has saved me many hours, if only IBM would follow your lead and provide an up-to-date installp repository of open source tools...!

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #9 on: May 10, 2016, 07:50:58 AM »
I'll check the file permissions.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #10 on: May 10, 2016, 08:07:43 AM »
And discover that
chmod -R o-rwx /var/httpd/htdocs
closes directories that are not owned by the group/user httpd/httpd.

Thanks for pointing this out.

p.s. Will be coming with a new and improved python real soon (python is also coming with a newer version).

Note: my (python) packaging does not include Tcl support. If you need that, let me know and I shall investigate packaging it separately.

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #11 on: May 10, 2016, 04:11:59 PM »
Found - HOW - it happened. New NAS settings had revoked all other settings - and there were a few that did not have the correct group setting.

Thanks again.

joeh

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #12 on: August 10, 2016, 06:13:37 PM »
Hi, I tried to use the AIX cloud-init installer, seemed to install ok but i am getting these errors just trying to manually run cloud-init, are there other pre-reqs i am missing?

bash-4.3# ./cloud-init
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/opt/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/opt/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/opt/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/opt/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/opt/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/opt/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "./cloud-init", line 4, in <module>
    __import__('pkg_resources').run_script('cloud-init==0.7.5', 'cloud-init')
  File "/opt/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 742, in run_script
  File "/opt/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 1667, in run_script
  File "/opt/lib/python2.7/site-packages/cloud_init-0.7.5-py2.7.egg/EGG-INFO/scripts/cloud-init", line 43, in <module>
    from cloudinit import netinfo
  File "/opt/lib/python2.7/site-packages/cloud_init-0.7.5-py2.7.egg/cloudinit/netinfo.py", line 23, in <module>
    import cloudinit.util as util
  File "/opt/lib/python2.7/site-packages/cloud_init-0.7.5-py2.7.egg/cloudinit/util.py", line 59, in <module>
    from cloudinit import url_helper
  File "/opt/lib/python2.7/site-packages/cloud_init-0.7.5-py2.7.egg/cloudinit/url_helper.py", line 27, in <module>
    import requests
  File "/opt/lib/python2.7/site-packages/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/opt/lib/python2.7/site-packages/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/opt/lib/python2.7/site-packages/requests/compat.py", line 7, in <module>
    from .packages import chardet
  File "/opt/lib/python2.7/site-packages/requests/packages/__init__.py", line 29, in <module>
    import urllib3
ImportError: No module named urllib3

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #13 on: August 11, 2016, 03:55:17 PM »
Not sure what the issue is.

a) what level of AIX (oslevel -s).

b) what level of openssl is installed?

c) I have a newer version of python - I have not tested it with that (as I do not have a platform to test it with, sadly O only own POWER6 - so getting this packaged meant I needed some time with someone who had access to both POWERVC and POWER8 (although POWER7 will also work I expect).

FYI: I am nearly certain it does not work on AIX 5.3 - for many reasons. I did not worry as, afaik, POWERVC does not support AIX 5.3.

Lastly, I have learned "a bit" about python. Besides the "hash" problem - it is also not finding a module named urllib3(.py)(c).

Check both lslpp -f output for the urllib3.* files and I shall try, asap, to replicate your issue.

Michael

joeh

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #14 on: August 11, 2016, 04:25:20 PM »
This was a fresh install of an older aix from an iso file

# oslevel -s
7100-02-02-1316
# lslpp -L | grep openssl
  openssl.base            0.9.8.2400    C     F    Open Secure Socket Layer
  openssl.license         0.9.8.2400    C     F    Open Secure Socket License
  openssl.man.en_US       0.9.8.2400    C     F    Open Secure Socket Layer
# lslpp -L | grep urllib3
#

# find / -name urllib* -print
/opt/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3
/opt/lib/python2.7/site-packages/requests/packages/urllib3
/opt/lib/python2.7/urllib.py
/opt/lib/python2.7/urllib.pyc
/opt/lib/python2.7/urllib.pyo
/opt/lib/python2.7/urllib2.py
/opt/lib/python2.7/urllib2.pyc
/opt/lib/python2.7/urllib2.pyo

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #15 on: August 11, 2016, 05:28:33 PM »
The problem is your openssl. It needs to be openssl.1.*

I am amazed at your level - considering that you have AIX 7.2 installed.

In any case: go to this link: https://www-01.ibm.com/marketing/iwm/iwm/web/reg/pick.do?source=aixbp&lang=en_US and get the latest OpenSSL - which today is: with FIPS support (as you have) is:
OpenSSL Install images v20.11.101.501 (OpenSSL 1.0.1e with OpenSSL FIPS 2.0.11) for AIX

OpenSSL Images openssl-fips-20.11.101.501.tar.Z  (30291653 B)

Readme Readme-20.11.101.501.txt  (13341 B)

There is also non-FIPS at level 1.0.2.X

That should fix it. I recall python was impossible to package with openssl-0.9.8.*

If it does not work, please let me know.

joeh

  • New Member
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #16 on: August 12, 2016, 02:20:39 PM »
Michael, that was it, thanks for the quick turn-around!  I guess my one question is why did the installp complete successfully with the old openssl level?

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #17 on: August 15, 2016, 01:01:34 PM »
Because I did not check that your openssl was high enough - I assumed. My bad.

I shall update that with my next packaging - thx for the comment.
« Last Edit: August 16, 2016, 07:14:18 AM by Michael »

Michael

  • Administrator
  • Hero Member
  • *****
  • Posts: 1155
  • Karma: +0/-0
Re: Cloud-Init on AIX - no RPMs needed
« Reply #18 on: September 07, 2016, 06:47:18 PM »
Cloud-init now has it's own page in the aixtools wiki style info: See: http://www.aixtools.net/index.php/cloudinit for the latest bundle.