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

Use network service client to query source network #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

votdev
Copy link
Member

@votdev votdev commented Jan 22, 2025

Problem:
During the preflight check the VM importer tries to make sure the specified spec.networkMapping[x].sourceNetwork in VirtualMachineImport exists for OpenStack imports.
The existing implementation seems not to work anymore with the latest OpenStack versions.

Solution:
Make use of the NewNetworkV2 ServiceClient to query for the specified source network.

Related Issue:
harvester/harvester#7432

Test plan:
Case 1
The test plan makes use of our internal OpenStack test environment.

  • Create the Secret and OpenstackSource resources to be able to access the test environment.
apiVersion: migration.harvesterhci.io/v1beta1
kind: OpenstackSource
metadata:
  name: devstack
  namespace: default
spec:
  endpoint: "http://xxx.xxx.xxx.xxx/identity"
  region: "RegionX"
  credentials:
    name: devstack-credentials
    namespace: default
  • Create the following manifest and apply it. Make sure the destination network default/vlan1 exists in Harvester.
apiVersion: migration.harvesterhci.io/v1beta1
kind: VirtualMachineImport
metadata:
  name: random-vm-test
  namespace: default
spec:
  virtualMachineName: "random-VM-test"
  networkMapping:
  - sourceNetwork: "shared"
    destinationNetwork: "default/vlan1"
  sourceCluster:
    name: devstack
    namespace: default
    kind: OpenstackSource
    apiVersion: migration.harvesterhci.io/v1beta1
  • The import should be successful.

@votdev votdev self-assigned this Jan 22, 2025
@votdev votdev changed the title Use network service client to fetch source network Use network service client to query source network Jan 22, 2025
@votdev votdev force-pushed the issue_7432_network_serviceclient branch from 6b2cc08 to 9144e4a Compare January 22, 2025 13:10
@votdev votdev force-pushed the issue_7432_network_serviceclient branch from 9144e4a to 4017ede Compare January 23, 2025 08:46
Copy link

mergify bot commented Jan 24, 2025

This pull request is now in conflict. Could you fix it @votdev? 🙏

Copy link
Member

@starbops starbops left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@votdev votdev force-pushed the issue_7432_network_serviceclient branch from 4017ede to 024f725 Compare January 27, 2025 07:43
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.

2 participants