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

Generic Ubuntu VM script #269

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

irish1986
Copy link

@irish1986 irish1986 commented Nov 15, 2024

Note

We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.

Description

Create a new generic ubuntu-vm script that allows the user ot select which version of ubuntu should be installed.

Type of change

Please check the relevant option(s):

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts.)

Prerequisites

The following efforts must be made for the PR to be considered. Please check when completed:

  • Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
  • Testing performed (I have tested my changes, ensuring everything works as expected)
  • Documentation updated (I have updated any relevant documentation)

Additional Information (optional)

C&C are welcomed via PR comments.

Related Pull Requests / Discussions

If there are other pull requests or discussions related to this change, please link them here:

@irish1986 irish1986 requested a review from a team as a code owner November 15, 2024 17:46
@github-actions github-actions bot added breaking change This change is not backward compatible delete script This change deletes a script rename script This change renames a script documentation Improvements or additions to documentation labels Nov 15, 2024
@Mellowlynx
Copy link
Contributor

I don't see the need for this script, To choose a version I have to go to all the advanced options, there are separate scripts for this reason.
Currently, you run the script of the version you want, not extra options needed.
If the update was just a version question in the standard too, maybe.

@havardthom
Copy link
Contributor

Ubuntu focal has end of standard support april 2025, we do not want to add that option now. Oracular is not LTS.

I'm not totally opposed to having one Ubuntu VM script which defaults to noble and with the option to downgrade to jammy in advanced options. This would make it consistent with the Ubuntu LXC (where we should update default version to noble).

This is also a VM script so it should not be a breaking change to existing users.

@havardthom havardthom removed the breaking change This change is not backward compatible label Nov 15, 2024
@MickLesk
Copy link
Member

This is also a VM script so it should not be a breaking change to existing users.

What is your opinion? I've skimmed through it and am rather against a merge. That's what the advanced settings are for.

@@ -2,17 +2,18 @@

# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# irish1986 (irish1986)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# irish1986 (irish1986)
# Co-Author: irish1986 (irish1986)

@@ -21,6 +22,11 @@ echo -e "\n Loading..."
GEN_MAC=02:$(openssl rand -hex 5 | awk '{print toupper($0)}' | sed 's/\(..\)/\1:/g; s/.$//')
NEXTID=$(pvesh get /cluster/nextid)

ORACULAR="oracular"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ORACULAR="oracular"

ORACULAR="oracular"
NOBLE="noble"
JAMMY="jammy"
FOCAL="focal"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FOCAL="focal"

}

function advanced_settings() {
if RELEASE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu RELEASE" --radiolist "Choose Version" --cancel-button Exit-Script 10 58 3 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if RELEASE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu RELEASE" --radiolist "Choose Version" --cancel-button Exit-Script 10 58 3 \
if RELEASE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "UBUNTU VERSION" --radiolist "Choose Version" --cancel-button Exit-Script 10 58 2 \

consistent with LXC

}

function advanced_settings() {
if RELEASE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu RELEASE" --radiolist "Choose Version" --cancel-button Exit-Script 10 58 3 \
"${ORACULAR}" "oracular " OFF \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"${ORACULAR}" "oracular " OFF \

"${ORACULAR}" "oracular " OFF \
"${NOBLE}" "noble " ON \
"${JAMMY}" "jammy " OFF \
"${FOCAL}" "focal " OFF \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"${FOCAL}" "focal " OFF \

if RELEASE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Ubuntu RELEASE" --radiolist "Choose Version" --cancel-button Exit-Script 10 58 3 \
"${ORACULAR}" "oracular " OFF \
"${NOBLE}" "noble " ON \
"${JAMMY}" "jammy " OFF \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move jammy option above noble, to be consistent with LXC

fi
msg_ok "Completed Successfully!\n"
echo -e "Setup Cloud-Init before starting \n
More info at https://github.com/tteck/Proxmox/discussions/2072 \n"
More info at https://github.com/community-scripts/ProxmoxVE/discussions/268 \n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
More info at https://github.com/community-scripts/ProxmoxVE/discussions/268 \n"
More info at https://github.com/community-scripts/ProxmoxVE/discussions/272 \n"

VMID="$NEXTID"
FORMAT=",efitype=4m"
MACHINE=""
DISK_CACHE=""
HN="ubuntu"
HN="ubuntu-${NOBLE}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to hostname if you choose jammy in advanced settings? you have to manually fix it?

@NoirPi
Copy link

NoirPi commented Nov 16, 2024

Hello everyone,

Thank you for the discussion and the proposed changes, especially by @havardthom. I would, however, like to suggest an alternative approach:

Instead of having a single script for multiple versions, I’d prefer keeping separate scripts for each version.
This makes it easier to target the desired version by simply adjusting the URL accordingly, which is at the moment just 2 digits to change:

While I agree that the changes suggested by @havardthom make sense, they further reduce the need for a centralized script, especially since Ubuntu Focal will soon (Yes! 6 month is soon) reach its End of Standard Support and Oracular not being an LTS release.

This would again strip the script down to just 2 versions which is as shown above just a simple 2 digit change in the url.

For this reason, I would suggest not adding a unified script and instead sticking to separate scripts for each version.

@havardthom
Copy link
Contributor

Should the Ubuntu LXC also be multiple scripts then? For me both of the approaches works, but we should pick one and be consistent. The approach we choose should also apply to all OS scripts in the future.

@NoirPi
Copy link

NoirPi commented Nov 16, 2024

Should the Ubuntu LXC also be multiple scripts then? For me both of the approaches works, but we should pick one and be consistent. The approach we choose should also apply to all OS scripts in the future.

I would definitely suggest that we keep them separated.

The only thing that would be important now and in the future is the naming convention of the scripts themself for all OS Scripts this should also be consistent as you said.

@havardthom
Copy link
Contributor

Actually I just remembered that the ability to choose OS version is baked into advanced settings for all LXCs, so the discussion is not applicable there. With that in mind I'm leaning more to having it similar for the vm, with targeting version in advanced settings.

I get the URL point, but you can also argue that having a single URL for ubuntu which does not change every 2 years is more user friendly. Then I can run the same URL every time without having to consider what version I want beforehand, maybe I don't care and just want the recommended/default version. If I do care, I run advanced settings and choose my version, just like an LXC.

In 2026 it would be 3 ubuntu scripts. 3 scripts and 3 documentation sites that need to be considered and synchronized when changes are proposed.

@NoirPi
Copy link

NoirPi commented Nov 16, 2024

I understand the argument, but I see it differently. Once I care about the version, I have to go into the advanced settings to select it. Up until now, this hasn’t been necessary.

Now, if we switch to a shared script and the version is only selected through advanced settings, the simple process of creating an Ubuntu 22.04 LXC would be changed.

What could be considered in my opinion is building the consolidated script in such a way that you can directly pass an argument for the version when calling it.

The option with the advanced settings is surely not that bad. But forcing into Advanced Settings to choose the Version, i dont think should be the way to go!

@havardthom
Copy link
Contributor

Building a consolidated script would break the established conventions and patterns. Letting the user choose OS version without having to use advanced settings (and without having separate scripts for each version) is something we can consider in the future. As it stands today, all LXCs have OS version choice in advanced settings (like it has always been) and I think VMs should be the same until we choose to make that improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delete script This change deletes a script documentation Improvements or additions to documentation rename script This change renames a script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants