Commit Graph

19 Commits

Author SHA1 Message Date
Volker Theile
8d4b8a01d9
Make use of strings.EqualFold for case-insensitiv string comparison (#79)
Signed-off-by: Volker Theile <vtheile@suse.com>
2025-05-07 09:18:09 +02:00
Volker Theile
4659913073 Make sure the label harvesterhci.io/imageDisplayName is valid
If it gets longer than 63 characters, then replace the label value by a hash to do not abort the VM import. The origin value is still used as `VirtualMachineImageSpec.DisplayName`. The label is currently used to search for the `VirtualMachineImage` object during the reconciliation phase.

Related to: https://github.com/harvester/harvester/issues/6463

Signed-off-by: Volker Theile <vtheile@suse.com>
2025-02-17 17:37:44 +08:00
Volker Theile
29629c75f8
Enhance importer to handle several issue (#42)
- 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 error and log messages
- Fix typos
- Add comments

Related to: https://github.com/harvester/harvester/issues/6500
Related to: https://github.com/harvester/harvester/issues/6505

Signed-off-by: Volker Theile <vtheile@suse.com>
2025-02-04 07:42:42 +01:00
Volker Theile
39daa82266 Make timeout during waiting for uploadImage configurable
Add the fields `UploadImageRetryCount` and `UploadImageRetryDelay` to `OpenstackSourceSpec`.

Related to: https://github.com/harvester/harvester/issues/6675

Signed-off-by: Volker Theile <vtheile@suse.com>
2025-01-24 15:40:03 +08:00
Volker Theile
d7f05cece9 Bump go to v1.23.4
Related to: https://github.com/harvester/harvester/issues/7336

Signed-off-by: Volker Theile <vtheile@suse.com>
2025-01-17 13:33:34 +08:00
Volker Theile
ea161c2fc1
Validate the network mapping configuration (#46)
- A new `apiGroups` is added to the `ClusterRole` to be able to list `network-attachment-definitions`.
- The `network-attachment-definitions` CRD has to be generated in the test env.

Related to: https://github.com/harvester/harvester/issues/6491

Signed-off-by: Volker Theile <vtheile@suse.com>
2024-10-09 11:39:48 +02:00
Gaurav Mehta
03a8ef08e9 address openstack network duplication when interface may have both ipv6 and ipv4 addresses and add preflight check to identify duplicate source network definitions 2024-10-07 11:09:01 +08:00
Volker Theile
409740f6f9 Do more logging during the import
Add log messages to better track what the importer is doing and to better isolate errors if necessary.

Related to: https://github.com/harvester/harvester/issues/6512

Signed-off-by: Volker Theile <vtheile@suse.com>
2024-09-11 13:27:51 +10:00
Gaurav Mehta
acd5fce6e7 include feedback from pr review
fix up typos
2024-08-02 12:23:45 +10:00
Gaurav Mehta
bb1cef97a5 added debug logging and also change behaviour of controller when vm export from source fails to stop rather than keep trying
added more debug info

close lease earlier

stage vmware migration improvements

improve openstack migration to check uefi/tpm/secureboot from associated image

improve firmware lookup for openstack, and add ability to specify custom storage classes

fix storage class caching issue

drop need for sync

fix imports
2024-08-02 12:23:45 +10:00
Moritz Röhrich
5e03d6d864 logs: Log errors when client fails verification
Log errors in the OpenStack and VMWare import controllers when the
client fails to verify.

The client for VMWare and OpenStack VM import are constructed and then
verified in an additional step. Instead of just indicating that there
was an error with the status conditions, this change adds a log message
to the controllers logs, which gives an indication why the verification
failed.

related-to: https://github.com/harvester/vm-import-controller/issues/26

Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
2024-04-18 12:23:48 +10:00
PoAn Yang
148cec8766 fix: golangci-lint error
Signed-off-by: PoAn Yang <poan.yang@suse.com>
2024-01-12 10:55:44 +08:00
Gaurav Mehta
40948a8ba9
work around to reconcile vm images more effectively (#16)
simplify disk condition checks

convert disk image status reconcile into a wrapper

move VM reconcile to a wrapper method

move preflight checks to a wrapper

more wrappers
2023-08-04 13:04:29 +08:00
Gaurav Mehta
ceddfa8247 add annotations to pvc for ui to work 2022-10-16 23:51:10 +00:00
Gaurav Mehta
88b5df8ae6 Additional validation to skip import jobs without disks or invalid vm names
bumped up harvester/harvester to v1.1.0-rc2

changed vmware client to check VM state before attempting poweroff, add closure for ovf client to fix Operation timed out errors

fine tuned integration tests

changed logging message
2022-10-11 19:05:38 +11:00
Gaurav Mehta
f1873b1d4e minor tweaks to vm reconcile 2022-08-29 11:10:40 +10:00
Gaurav Mehta
0ac976b4cc reorg groups and some reconcile logic 2022-08-26 16:41:47 +10:00
Gaurav Mehta
fddce7d565
Openstack reconcilliation (#1)
* openstack source reconilliation

* tmp staging for openstack migration

* openstack import working and integration tests

* updated readme
2022-08-16 09:25:16 +10:00
Gaurav Mehta
112008bb81 initial commit for vm-import-controller 2022-08-10 11:08:50 +10:00