-
Notifications
You must be signed in to change notification settings - Fork 12
[FEATURE] Add option to select network interface model while importing VM #78
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
Conversation
4cf59e8
to
17576f8
Compare
17576f8
to
165aa7e
Compare
165aa7e
to
4f1231d
Compare
51554a2
to
19ef681
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
result = append(result, source.NetworkInfo{ | ||
NetworkName: obj.DeviceInfo.GetDescription().Summary, | ||
MAC: obj.MacAddress, | ||
Model: migration.NetworkInterfaceModelPcnet, | ||
}) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there default case to process? if above cases are all not hit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because the processed list of devices can contain other hardware/devices than NICs.
Name: "pod-network", | ||
Model: defaultNetworkInterfaceModel, | ||
InterfaceBindingMethod: kubevirt.InterfaceBindingMethod{ | ||
Masquerade: &kubevirt.InterfaceMasquerade{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason not using the bridge interface here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I can't say anything here as I have adopted the code 1:1.
@ibrokethecloud added the origin code. Could you tell use more please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is no valid source to destination mapping we default to adding the masquerade network which is the current default behaviour of harvester during vm creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Thanks for clarifying. I was just considering what might be the most compatible configuration :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
…rvester using the vm-import-controller Add the field `DefaultNetworkInterfaceModel` to `VirtualMachineImportSpec` and `NetworkInterfaceModel` to `NetworkMapping`. With this new fields it is possible to customize the interface models of the VM NICs. Related to: harvester/harvester#7999 Signed-off-by: Volker Theile <[email protected]>
3d9b2f6
19ef681
to
3d9b2f6
Compare
Problem:
The network interface model of an imported VM is set to "VirtIO" by default.
Solution:
Add the field
DefaultNetworkInterfaceModel
toVirtualMachineImportSpec
andNetworkInterfaceModel
toNetworkMapping
. With this new fields it is possible to customize the interface models of the VM NICs.The
DefaultNetworkInterfaceModel
field is always used when:It defaults to "virtio".
Related Issue:
harvester/harvester#7999
Test plan:
Case 1
Case 2
Virtual Machines
in the UI and chooseEdit YAML
. The following code should exist:The interface
migrated-0
with modele1000
should be configured.Case 3
Case 4
Virtual Machines
in the UI and chooseEdit YAML
. The following code should exist:The interface
pod-network
with modele1000e
should be configured.