Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud-Init Support #3218

Open
SchoolGuy opened this issue Jul 29, 2022 · 10 comments · May be fixed by #3293
Open

Cloud-Init Support #3218

SchoolGuy opened this issue Jul 29, 2022 · 10 comments · May be fixed by #3293
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@SchoolGuy
Copy link
Member

Is your feature request related to a problem?

At the moment it is only possible to boot the legacy images of Ubuntu due to the missing cloud-init support.

Provide a detailed description of the proposed feature

We should have an easy way for users to provision cloud-init. I have no detailed ideas how to approach this except for the bits named below by @heroin-moose.

Cloud-Init further information:

Alternatives you've considered

It is not feasible to not support cloud-init.

Additional information

This is a dedicated issue that has been split out of:

@heroin-moose already proposed a way to support this here

@SchoolGuy SchoolGuy added the enhancement New feature or request label Jul 29, 2022
@SchoolGuy SchoolGuy added this to the v3.5.0 milestone Jul 29, 2022
@SchoolGuy SchoolGuy self-assigned this Nov 21, 2022
@SchoolGuy SchoolGuy modified the milestones: v3.5.0, v3.4.0 Nov 21, 2022
@SchoolGuy
Copy link
Member Author

SchoolGuy commented Nov 22, 2022

@SchoolGuy
Copy link
Member Author

Since I want to get rid of Cheetah long term I will use Jinja templates for this feature. This means validating that #1605 is no longer valid or fix it.

@SchoolGuy
Copy link
Member Author

SchoolGuy commented Nov 22, 2022

We should be able to make use of the new URL structure in a backwards compatible way with **rest parameter that is currently unused. The dict is filled by __fillup_form_dict.


Credit to @heroin-moose for creating the overview here

Preseed:

https://cobbler.example.com/cblr/svc/op/autoinstall/system-or-profile/NAME/preseed.cfg

Kickstart:

https://cobbler.example.com/cblr/svc/op/autoinstall/system-or-profile/NAME/ks.cfg

AutoYAST:

https://cobbler.example.com/cblr/svc/op/autoinstall/system-or-profile/NAME/autoinst.xml

cloud-init:

https://cobbler.example.com/cblr/svc/op/autoinstall/system-or-profile/NAME/user-data
https://cobbler.example.com/cblr/svc/op/autoinstall/system-or-profile/NAME/meta-data
https://cobbler.example.com/cblr/svc/op/autoinstall/system-or-profile/NAME/vendor-data

Further adjustments need to be done to:

  • AutoinstallManager:generate_autoinstall: We need to add the filename and the installer type to the method signature.
  • AutoinstallationGen: This should be refactored into per-installer type classes/modules with a base class that aggregates common functionality.
  • AutoinstallManager: This should be moved under the AutoinstallGen module.
  • Systems and Profiles need to be able to handle more then one autoinstall template. For this is would be reasonable to do Promote templates to first-level objects #3267, however since we can do it also without it, we should try to do so.
  • We need a data migration that handles that a profile/system can have more then one autoinstall template assigned.
  • Moving to multiple templates per distro requires an adjustment in the signatures.json format.
  • Buildiso Needs to be able to handle this as well.
  • We need to extend cobbler validate-autoinstalls to work with cloud-init: https://cloudinit.readthedocs.io/en/latest/topics/cli.html#schema

@SchoolGuy
Copy link
Member Author

XML-RPC has no concept of kwargs. This makes adding the options as optional arguments really verbose.

Details see here: https://stackoverflow.com/a/120291

@SchoolGuy SchoolGuy linked a pull request Dec 3, 2022 that will close this issue
12 tasks
@easpeagle
Copy link

Hey @SchoolGuy, where is this one? Still making progress?

@SchoolGuy
Copy link
Member Author

@easpeagle You can see that there is a WIP PR linked. In the merge order, this is in the fourth place. Progress is there but not very fast due to atm only me working on all the four PRs.

@easpeagle
Copy link

easpeagle commented May 15, 2023

@SchoolGuy, I checked out your PR branch to build and test the RPMs. That all built and worked. However, after trying to add and setup ubuntu focal for cloud-init autoinstall, I get this error when trying to start cobblerd now:

Seems like maybe it can't find a validator for cloud-init autoinstall files?

May 15 20:51:31 gca-cobbler01 cobblerd[33732]: Traceback (most recent call last):
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/items/item.py", line 897, in from_dict
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     setattr(self, lowered_key, dictionary[key])
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/items/profile.py", line 503, in autoinstall
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     self.api.autoinstall_mgr.validate_autoinstall_template_file_path(
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: AttributeError: 'CobblerAPI' object has no attribute 'autoinstall_mgr'
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: The above exception was the direct cause of the following exception:
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: Traceback (most recent call last):
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/cobbler_collections/manager.py", line 195, in deserialize
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     self.__serializer.deserialize(collection)
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/serializer.py", line 115, in deserialize
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     self.storage_object.deserialize(collection, topological)
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/modules/serializers/file.py", line 116, in deserialize
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     collection.from_list(datastruct)
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/cobbler_collections/collection.py", line 206, in from_list
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     item = self.factory_produce(self.api, item_dict)
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/cobbler_collections/profiles.py", line 33, in factory_produce
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     new_profile.from_dict(item_dict)
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/items/profile.py", line 128, in from_dict
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     super().from_dict(dictionary)
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/items/item.py", line 901, in from_dict
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     ) from error
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: AttributeError: Attribute "autoinstall" could not be set!
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: The above exception was the direct cause of the following exception:
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: Traceback (most recent call last):
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/bin/cobblerd", line 111, in main
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     execute_settings_automigration=options.automigration,
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/api.py", line 127, in __init__
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     self.deserialize()
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/api.py", line 2173, in deserialize
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     return self._collection_mgr.deserialize()
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:   File "/usr/lib/python3.6/site-packages/cobbler/cobbler_collections/manager.py", line 200, in deserialize
May 15 20:51:31 gca-cobbler01 cobblerd[33732]:     ) from error
May 15 20:51:31 gca-cobbler01 cobblerd[33732]: cobbler.cexceptions.CX: 'serializer: error loading collection profile: Attribute "autoinstall" could not be set!.Check your settings!'

@SchoolGuy
Copy link
Member Author

@easpeagle It is very nice to see your interest in the Pull Request. However, it is not in a state where you could test it sadly. The current merge order is:

So I will need to rebase the PR multiple times before you will be able to see things working. I will gladly notify you once I am that far if you desire.

@easpeagle
Copy link

Ah... fair enough, @SchoolGuy ... yeah, I'm more than a little interested. Thanks for continuing to work on this!

@NileshChandekar
Copy link

#3573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants