vmware / photon-os-installer

Photon OS Installer
Other
12 stars 18 forks source link

Integrate change initial password #27

Closed dcasota closed 5 months ago

dcasota commented 5 months ago

Is your feature request related to a problem? Please describe.

Created a minimal.ova with ./photon-os-installer/create-image-util --raw-image minimal.img --config-file minimal_ks.yaml --local-repo-path /mnt/local/root/photon-5.0-x86_64/ --poi-path ~/photon-os-installer/ --flavor ova --ova-config minimal.yaml --ova-name minimal

Provisioned a new vm with minimal.ova. The new vm didn't ask for changing the initial password. How can this be accomplished by the build process of ./create-image-util?

Describe the solution you'd like

difficult to say that change initial password should be an option and not mandatory.

Describe alternatives you've considered

No response

Additional context

btw. poi is nice!

oliverkurth commented 5 months ago

In the ks file, for the password setting, set age to 0. See https://github.com/vmware/photon-os-installer/blob/master/docs/ks_config.md , search for "password".

dcasota commented 5 months ago

Thanks @oliverkurth!

As suggested, I modified ./photon-os-installer/examples/ova/minimal_ks.yaml by adding "age" in section "password" like this

password:
    crypted: false
    text: changeme
   "age": 0

and restarted create-image-util. Success! A new vm from the fresh minimal.ova now asks to change the initial password. Boom - this has been accomplished in less than half an hour!

Here some other findings fyi

oliverkurth commented 5 months ago

Thank you for feedback, much appreciated!

password: crypted: false text: changeme "age": 0

No need for the quotes - the doc still uses json format (I know, can be improved), in yaml you can just do:

password:
    crypted: false
    text: changeme
    age: 0

(you can still use the old json format since json is just a subset of yaml - but for humans, I prefer yaml).

offline functionality: POI comes with a few python dependencies. I think it's doable to install python packages and dependencies offline, as well. Actually, the builder vm used went online to install them properly.

I am not understanding what you mean here. Can you elaborate? Not sure what you are referring to with "builder vm". In theory, once you have built the container image, everything can operate offline, if you give it a full repository, for example in a Photon ISO image.

create-image-util finishes with the following error when arch: aarch64 is specified, but bootmode not.

Thanks, we can fix that. Note that for aarch64 only efi boot is supported. But we should catch this error earlier, and give a better error message.

dcasota commented 5 months ago

Sorry for the delay.

„builder vm“ is a simple understanding of a Photon OS vm on which the make-image-iso/ova/… process for a newer custom Photon OS release is handled. Very classic.

A new definition would be a Photon OS vm, on which mass exported/imported commits from Github are offline-replayed, or, predicted code/commits for new releases of vendor packages are auto-created and tested. Through ML training, the Photon OS model learns writing spec files and the builder vm stores the validated, photonos’ified new vendor packages.
Most spec files have python requirements and replaying commits is in dependency to versions though. Actually there is no progress on this.