ManageIQ / manageiq-appliance-build

Scripts to build ManageIQ appliances
Apache License 2.0
10 stars 55 forks source link

Don't automatically initialize appliances #511

Closed agrare closed 2 years ago

agrare commented 2 years ago

For demo purposes it is nice to have an appliance which automatically initializes itself on boot, but this makes it quite difficult to use these images in a production deployment which requires multiple appliances.

This removes the auto-initialization on first-boot allowing the user to use appliance_console to connect the appliance to an existing region or create a new one.

Follow-up:

Fryguy commented 2 years ago

We use to use manageiq-initialize to initialize kafka as well. What would we do in that case in the future?

Fryguy commented 2 years ago

See also https://github.com/ManageIQ/manageiq-documentation/pull/1626

agrare commented 2 years ago

@Fryguy that was another "optimize for all-in-one deployment' step since it sets up every appliance as a kafka broker. The "right way" is for the user to plan out which appliance will be the message server (similar to how they plan which will be the database appliance)

Fryguy commented 2 years ago

Ok that's what I thought...we will just need to document these steps properly. Thinking ahead, this may also help us with database upgrades, which we've been having trouble with.

kbrock commented 2 years ago

Encouraging people to setup an external database would be huge for us. We do this anyways for most larger deploys, and in the container world, it is becoming more and more standard.

That and gem/python dependencies are among our last major hurdles for upgrades.

bdunne commented 2 years ago

If we're dropping the database partition, we can shrink the image sizes too. https://github.com/ManageIQ/manageiq-appliance-build/blob/a009066c9a528fefeca58bbc388e9565b7ad05f1/scripts/target.rb#L6-L14

Aside... I don't know why Azure is 5GB smaller than everything else.

agrare commented 2 years ago

@bdunne yup I have that in the TODO list above, Reduce the root disk size for the image builds

agrare commented 2 years ago

Testing appliance with the manageiq-initialize.service removed and a blank disk added to the appliance, appliance_console has the option of creating an internal database and using the attached disk

Screenshot from 2022-07-12 11-39-29

Screenshot from 2022-07-12 11-40-49

Screenshot from 2022-07-12 11-47-00

agrare commented 2 years ago

And immediately after the database is create, the evmserverd.service is activated and manageiq-db-ready.service runs

agrare commented 2 years ago

@bdunne in the install docs we state that we require 44GB of storage space (e.g. https://www.manageiq.org/docs/reference/latest/installing_on_aws/index.html#manageiq-requirements) Was this the old size of the root disk before we expanded it for the all-in-one database image?

(interestingly azure still says it requires 44GB :shrug:)

bdunne commented 2 years ago

I don't know where 44 came from. It looks like it's been 66 (61 for azure) for a long time upstream.

Fryguy commented 2 years ago

Commit message and PR title typo:

- Don't automatically initailize appliances
+ Don't automatically initialize appliances
agrare commented 2 years ago

So I did a little bit of digging on the disk_size issue.

The disk size was originally 40GB: https://github.com/ManageIQ/manageiq-appliance-build/commit/b605f054d71da90d3b822a5bbecd66f0fd957a98#diff-0d2bf1360c948bfb13e78918345353260ed0d447224e0210328f76b9b605f639R14

Then it was increased to 50G to account for the log volume: 3fb352885f3b5c3d96adbc4173d237adeab0353c

And then 66G for embedded ansible when it was using AWX: 911759d3779560814dc5f558bbdcd252ed56a045

Other downstream products also had the root disk size of 66G and those expected the database to be on a secondary disk.

I think we can probably drop back down to 50G (and update the docs accordingly) but the size doesn't appear to be correlated to having a database on the main disk so I think we can leave this for a follow-up, thoughts?

agrare commented 2 years ago

@bdunne this is why azure is smaller: https://github.com/ManageIQ/manageiq-appliance-build/pull/128

bdunne commented 2 years ago

The 8GB for the database was included in the original 40GB https://github.com/ManageIQ/manageiq-appliance-build/commit/b605f054d71da90d3b822a5bbecd66f0fd957a98#diff-fb329bbe17b199ccc8278c9f0f61b8aeb558a411c1095f7c989fb9c519468827R36-R37 so I think we should drop the disk size by that much if we're going to remove the lv.

agrare commented 2 years ago

@bdunne so do you want to drop it by 8GB here for the database then separately drop it by 16GB for the removal of AWX?

bdunne commented 2 years ago

@bdunne so do you want to drop it by 8GB here for the database then separately drop it by 16GB for the removal of AWX?

👍🏻 Sounds good

miq-bot commented 2 years ago

Checked commits https://github.com/agrare/manageiq-appliance-build/compare/9d8c93f18686bb8668d61a076196e91e94ec48ee~...479b539acf51af95cf86d80af34bf23541abfcf1 with ruby 2.6.9, rubocop 1.19.1, haml-lint 0.35.0, and yamllint 2 files checked, 2 offenses detected

scripts/spec/target_spec.rb

agrare commented 2 years ago

@bdunne done