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 #56

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

Conversation

votdev
Copy link
Member

@votdev votdev commented Nov 14, 2024

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

  • Shorten the image display name from <VMName>-<VMName>-<DiskIndex> to the name of the disk <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]>
... to ensure the resulting name of the `VirtualMachineImage` will match the 63 characters limit.

- Shorten the image display name from `<VMName>-<VMName>-<DiskIndex>` to the name of the disk `<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]>
Signed-off-by: Volker Theile <[email protected]>
@votdev votdev self-assigned this Nov 14, 2024
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