pellaeon / bsd-cloudinit Goto Github PK
View Code? Open in Web Editor NEWcloud-init scripts for BSD
License: Apache License 2.0
cloud-init scripts for BSD
License: Apache License 2.0
Hi,
We've prepared a FreeBSD 10.3 image to run bsd-cloudinit during boot and have setup the image so that a root password is offered by the Openstack environment .
"Everything" seems to work ok except for the password provided by openstack nog being set correctly.
The error displayed is :
Nov 15 11:09:27 freebsd-template kernel: 2016-11-15 11:09:27.026 682 ERROR cloudbaseinit.init [-] plugin 'SetUserPasswordPlugin' failed with error 'HTTP Error 500: Internal Server Error'
The same openstack environment has no trouble setting the root password in other images as far as I can tell.
We've modified the default behaviour of the .sh script to include a configfile like this:
$PYTHON $BSDINIT_DIR/run.py --config-file /etc/cloudinit.conf --log-file /tmp/cloudinit.log $BSDINIT_SCRIPT_DEBUG_FLAG
config file contents:
cat /etc/cloudinit.conf
[DEFAULT]
username=root
Any thought on how to troubleshoot this issue?
Kind regards,
Fuxjezz
Thanks for this tool. I'm getting em0 in rc.conf, and when I boot in openstack I'm getting vtnet0. Perhaps this is soemthing unique to my environment? Causes host to fail to get an ip and consequently fail cloud init.
Currently, we hard codeed the vtdb0
as the harddisk.
Hi,
Is the actual resize work live, in one go?
No matter what I do, I still have to reboot the machine until I can "growfs /" to max.
Hi,
The script tries to perform a chown to root:root somewhere during its execution.
Shouldn't this be "root:wheel"?
Kind regards,
Fuxjezz
2016-11-15 11:09:28.040 682 ERROR cloudbaseinit.init [-] plugin 'SetUserSSHPublicKeysPlugin' failed with error 'Command 'chown -R root:root /root' returned non-zero exit status 1'
2016-11-15 11:09:28.040 682 ERROR cloudbaseinit.init [-] Command 'chown -R root:root /root' returned non-zero exit status 1
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init Traceback (most recent call last):
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init File "/root/bsd-cloudinit/cloudbaseinit/init.py", line 67, in _exec_plugin
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init shared_data)
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init File "/root/bsd-cloudinit/cloudbaseinit/plugins/freebsd/sshpublickeys.py", line 60, in execute
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init osutils.chown(username, username, user_home)
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init File "/root/bsd-cloudinit/cloudbaseinit/osutils/freebsd.py", line 187, in chown
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init shell=True
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init File "/usr/local/lib/python2.7/subprocess.py", line 541, in check_call
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init raise CalledProcessError(retcode, cmd)
2016-11-15 11:09:28.040 682 TRACE cloudbaseinit.init CalledProcessError: Command 'chown -R root:root /root' returned non-zero exit status 1
Since I'm using this bsd-cloudinit, I would like to know if there is any plan to support mounting swap drive and ephemeral disk? I could my some effort trying to add this but I don't know how nova gets the metadata information about the disks in the first place. Having an option to add ZFS customization from user-data on ephemeral disk would also be something good to have. Can you share any information and thoughts regarding this matter?
When i wrote those code, i'm not quite understand programming in python. :(
So i will do some code refine now; comment welcomed! ๐
Working list:
Class FreeBSDUtils
reboot
user_exists
create_user
set_host_name
set_user_password
add_user_to_local_group
get_user_home
get_network_adapters
set_static_network_config
set_dhcp_network_config
set_timezone
adj_sys_time
_add_comment
_add_rc_conf
chown
Also, the naming of those functions (set_
and get_
) are really non-pythonic style.
Maybe we should use property
.
Hi, I'm using Public Cloud from OVH.com. It uses OpenStack but I'm having issues with FreeBSD 10.2 and BSD Cloudinit. The system boots at the first time but the second partition (freebsd ufs mounted in /) is not resized, the NIC controller bounds the IP from DHCP pool, but not the gateway and if I try to reboot, the boot sequence freezes at "Timecounter tick every 1.000 msec" every time. The image used was made in QEMU and I tryied the experimental pre-built image from your website too, with the same behavior.
Do you plan to implement sudo/sudoers any soon?
Hi,
I tried to run this with Nocloud ConfigDrive but it thorows the error "ConfigDrive is not supported on this platform: freebsd10"...when it should be available.. ??
Or is there anybody can suggest the workaround for it..
Weird logic...
I can not recall why i wrote this...
FreeBSDUtils().create_user('bsdtest', 'pw')
/root/bsd-cloudinit/cloudbaseinit/osutils/freebsd.py in create_user(self, username, password, invite_group, password_expires)
29
30 assert not invite_group or isinstance(invite_group, list), "param invite_group must be a list."
---> 31 assert invite_group, "invite_group cannot be empty."
32 for i in invite_group:
33 grouplist += i+','
AssertionError: invite_group cannot be empty.
Currently, the function handling gpart ouput pattern only wokrs on GPT.
If user using MBR, we need to handle freebsd slice.
Do you have any plans to support user-data? I need to set root password and install ssh keys for root.
See discussion in #9.
When cloudbaseinit run, python crash with this log stack.
Starting local daemons:2018-11-22 00:02:29.890 673 CRITICAL cloudbaseinit [-] AttributeError: Undefined symbol "ERR_load_crypto_strings"
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit Traceback (most recent call last):
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/run.py", line 3, in
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit shell.main()
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/cloudbaseinit/shell.py", line 29, in main
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit init.InitManager().configure_host()
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/cloudbaseinit/init.py", line 107, in configure_host
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit plugins = plugins_factory.load_plugins()
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/cloudbaseinit/plugins/common/factory.py", line 45, in load_plugins
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit plugins.append(cl.load_class(class_path)())
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/cloudbaseinit/utils/classloader.py", line 28, in load_class
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit module = import(parts[0], fromlist=parts[1])
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/cloudbaseinit/plugins/freebsd/setuserpassword.py", line 25, in
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit from cloudbaseinit.utils import crypt
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/root/bsd-cloudinit/cloudbaseinit/utils/crypt.py", line 89, in
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit openssl.ERR_load_crypto_strings.restype = ctypes.c_int
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/usr/local/lib/python2.7/ctypes/init.py", line 379, in getattr
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit func = self.getitem(name)
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit File "/usr/local/lib/python2.7/ctypes/init.py", line 384, in getitem
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit func = self._FuncPtr((name_or_ordinal, self))
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit AttributeError: Undefined symbol "ERR_load_crypto_strings"
2018-11-22 00:02:29.890 673 TRACE cloudbaseinit
loader.conf:
comconsole
More investigation is needed.
Hi!
I would be interested to add support for CloudStack. Would it be accepted? I see there is already support for EC2 so this does not seem an Openstack only project.
In the DigitalOcean cloud we have found that if a snapshot image is created from a vm with FreeBSD + cloud-init, instances created using that image will fail to use the hostname provided in ConfigDrive resulting in the hostname from the original system continuing to be used.
It appears that if a prior run is found, changes to the ConfigDrive configuration are not read and used.
We do not see this from other ports of cloud-init on Linux distributions.
The link in the README of this project does seem to be broken: http://images.openstack.nctu.edu.tw/bsd-cloudinit/ -- does not seem to point anywhere
So far, we have to install "iso8601" because "bsd-cloudinit" depends on "openstack-common" and "openstack-common" depends on "iso8601" -- which looks not neccessary.
Maybe newer version "openstack-common" doesn`t need "iso8601".
Feature:
I have some errors when i try to launch the installer.sh on pfsense 2.2.1 (freebsd 10.1). it seems some libraries are missing. Someone can help me, please? I'm trying to build a pfsense image for openstack.
Errors -> http://pastebin.com/9QcPFbFe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.