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

Check image name length in preflight phase #63

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

Conversation

votdev
Copy link
Member

@votdev votdev commented Jan 29, 2025

Requires the following PRs to be merged first:

Afterwards a rebase is needed to condense the changes that are related to the issue to be solved.


... to ensure the resulting name of the VirtualMachineImage will match the 63 characters limit.

  • Shorten the image display name from vm-import-<VMName>-<VMName>-<DiskIndex> to the name of the disk import-<VMName>-<DiskIndex> to safe characters. This allows the import of VM with longer names.

Signed-off-by: Volker Theile [email protected]

Problem:
There's no way for users to know if VM import is failing due to exceeding naming character limit.

Solution:
Check if the expected image name is not exceeding the linit during the preflight phase.

Related Issue:
harvester/harvester#6463

Test plan:
ToDo...

- Import OpenStack server by UUID
- Import OpenStack server with upper case characters in its name

The following improvements have been done:
- Sanitize the configured `VirtualMachineName` field, e.g. convert upper case to lower case to make it RFC 1123 compliant.
- Convert UUID to real name for OpenStack imports
- Reduce waiting time to recheck if created VM is running from 5min to 2min
- Rename variable `uuid` to `serverUUID` in the OpenStack client code to do not collide with the imported uuid module
- Improve log messages
- Fix typos
- Add comments

Related to: harvester/harvester#6500
Related to: harvester/harvester#6505

Signed-off-by: Volker Theile <[email protected]>
(cherry picked from commit 6e6b619)
Signed-off-by: Volker Theile <[email protected]>
Related to: harvester/harvester#7432

Signed-off-by: Volker Theile <[email protected]>
(cherry picked from commit 024f725)
Signed-off-by: Volker Theile <[email protected]>
@votdev votdev self-assigned this Jan 29, 2025
@votdev votdev force-pushed the issue_6463_chk_diskname_len_v2 branch from eddc5ef to 4aa4195 Compare January 30, 2025 15:29
... to ensure the resulting name of the `VirtualMachineImage` will match the 63 characters limit.

- Shorten the image display name from `vm-import-<VMName>-<VMName>-<DiskIndex>` to the name of the disk `import-<VMName>-<DiskIndex>` to safe characters. This allows the import of VM with longer names.

Related to: harvester/harvester#6463

Signed-off-by: Volker Theile <[email protected]>
@votdev votdev force-pushed the issue_6463_chk_diskname_len_v2 branch from 4aa4195 to 0999eaf Compare January 30, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant