vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
789 stars 267 forks source link

Match network names for VM migration #782

Closed akiparuk closed 8 years ago

akiparuk commented 8 years ago

Have a look at XenCenter and XenOrchestra network migration details for same VM: https://gyazo.com/992e2742a7d772336856b5dd1c60ea0a https://gyazo.com/b60a0660195c66f4d40b62e5e6e0f6e9

I would like to see existing network connectivity this screen, not only MAC and VIF addresses (VIF is actually useless for end users, it would be nice to remove them from this screen). Also, XenCenter 'guess' network connectivity on destination host when network names are the same.

olivierlambert commented 8 years ago

I don't understand what you mean. Let's decompose the issue in multiple parts:

  1. what do you mean by "network connectivity"? I'm not a XenCenter expert, I'm not sure to understand the meaning. For me, the only interlocutor is the XAPI. So I need to make the link between names used in XenCenter and the XAPI to understand. So please give us the max amount of information you can :)
  2. Can you describe each field in the XenCenter screenshot? Eg. from where is from the "v135_Windows2012..."?
akiparuk commented 8 years ago

I have 3 networks in this VM. And i have about 12 networks on hosts Each lan has name corresponding to VLAN for example v135_Windows2012_for_XO - VLAN12 use network tagget to VLAN12 on vm which name is v135_Windows2012_for_XO and so on .

v135_Windows2012_for_XO may be superfluous, But VLAN12 is very needed.

BogdanRudas commented 8 years ago

Let me explain: by default, during cross-pool, XenCenter tries to match networking interfaces of source and destination hosts:

XenA, the source, have VIF "VLAN1" and VM v135 that have this VIF connected XenB, the destination, also have VIF with alias "VLAN1"

Expected behavior: XO scan both servers for network name. If VM on source server XenA uses network "VLAN1" and destination server XenB also have network "VLAN1" - it should be offered as default selection in "Network" dropdown menu on "VM migration" screen.

Current behavior: useless semi-random network "Pool-wide network associated with eth0" offered as default selection in dropdown menu. So when I move VMs - I have to think and choose proper network.

olivierlambert commented 8 years ago

Can you give me an output of a VIF which is on a "VLAN1", with xe vif-param-list uuid=<VIF_UUID>? It will be better for me to understand.

In fact my main problem is to know where are stored "VLAN1" or that kind of info in the XAPI. Same about the "v135_Windows2012_for_XO".

BogdanRudas commented 8 years ago
# xe  vif-list vm-uuid=e73d1411-2576-71b5-2d47-296efedb9379
uuid ( RO)            : b1df59c5-bbe3-221c-4ff0-ed64a8a1e6bb
         vm-uuid ( RO): e73d1411-2576-71b5-2d47-296efedb9379
          device ( RO): 1
    network-uuid ( RO): 894508a4-a521-6612-6e17-6a7c449fbca8

uuid ( RO)            : b39aeba6-b16e-e838-3b7e-6a84e52bd883
         vm-uuid ( RO): e73d1411-2576-71b5-2d47-296efedb9379
          device ( RO): 0
    network-uuid ( RO): 360f6534-b895-782e-3154-7962f206b8e3

uuid ( RO)            : 3c718f09-73e5-d575-5a2f-b731a3623379
         vm-uuid ( RO): e73d1411-2576-71b5-2d47-296efedb9379
          device ( RO): 2
    network-uuid ( RO): 1cab5cde-35b3-686d-3de1-98fc3f2fff75

# xe  vif-param-list  uuid=b1df59c5-bbe3-221c-4ff0-ed64a8a1e6bb 
uuid ( RO)                        : b1df59c5-bbe3-221c-4ff0-ed64a8a1e6bb
                     vm-uuid ( RO): e73d1411-2576-71b5-2d47-296efedb9379
               vm-name-label ( RO): v135_Windows2012_for_XO
          allowed-operations (SRO): attach; unplug
          current-operations (SRO): 
                      device ( RO): 1
                         MAC ( RO): 96:00:e9:82:f2:0e
           MAC-autogenerated ( RO): false
                         MTU ( RO): 0
          currently-attached ( RO): true
          qos_algorithm_type ( RW): 
        qos_algorithm_params (MRW): 
    qos_supported_algorithms (SRO): 
                other-config (MRW): 
                network-uuid ( RO): 894508a4-a521-6612-6e17-6a7c449fbca8
          network-name-label ( RO): VLAN10
                 io_read_kbs ( RO): 0.000
                io_write_kbs ( RO): 0.000
                locking-mode ( RW): network_default
                ipv4-allowed (SRW): 
                ipv6-allowed (SRW): 

# xe  vif-param-list  uuid=b39aeba6-b16e-e838-3b7e-6a84e52bd883
uuid ( RO)                        : b39aeba6-b16e-e838-3b7e-6a84e52bd883
                     vm-uuid ( RO): e73d1411-2576-71b5-2d47-296efedb9379
               vm-name-label ( RO): v135_Windows2012_for_XO
          allowed-operations (SRO): attach; unplug
          current-operations (SRO): 
                      device ( RO): 0
                         MAC ( RO): 3e:94:9e:96:a0:89
           MAC-autogenerated ( RO): false
                         MTU ( RO): 0
          currently-attached ( RO): true
          qos_algorithm_type ( RW): 
        qos_algorithm_params (MRW): 
    qos_supported_algorithms (SRO): 
                other-config (MRW): 
                network-uuid ( RO): 360f6534-b895-782e-3154-7962f206b8e3
          network-name-label ( RO): VLAN12
                 io_read_kbs ( RO): 0.374
                io_write_kbs ( RO): 0.038
                locking-mode ( RW): network_default
                ipv4-allowed (SRW): 
                ipv6-allowed (SRW): 

# xe  vif-param-list  uuid=3c718f09-73e5-d575-5a2f-b731a3623379
uuid ( RO)                        : 3c718f09-73e5-d575-5a2f-b731a3623379
                     vm-uuid ( RO): e73d1411-2576-71b5-2d47-296efedb9379
               vm-name-label ( RO): v135_Windows2012_for_XO
          allowed-operations (SRO): attach; unplug
          current-operations (SRO): 
                      device ( RO): 2
                         MAC ( RO): ae:d8:2f:1e:ec:5b
           MAC-autogenerated ( RO): false
                         MTU ( RO): 0
          currently-attached ( RO): true
          qos_algorithm_type ( RW): 
        qos_algorithm_params (MRW): 
    qos_supported_algorithms (SRO): 
                other-config (MRW): 
                network-uuid ( RO): 1cab5cde-35b3-686d-3de1-98fc3f2fff75
          network-name-label ( RO): VLAN1
                 io_read_kbs ( RO): 1.157
                io_write_kbs ( RO): 0.022
                locking-mode ( RW): network_default
                ipv4-allowed (SRW): 
                ipv6-allowed (SRW): 
BogdanRudas commented 8 years ago
# xe network-list name-label=VLAN10
uuid ( RO)                : 894508a4-a521-6612-6e17-6a7c449fbca8
          name-label ( RW): VLAN10
    name-description ( RW): 
              bridge ( RO): xapi2

# xe network-list name-label=VLAN1
uuid ( RO)                : 1cab5cde-35b3-686d-3de1-98fc3f2fff75
          name-label ( RW): VLAN1
    name-description ( RW): 
              bridge ( RO): xapi1

# xe network-list name-label=VLAN12
uuid ( RO)                : 360f6534-b895-782e-3154-7962f206b8e3
          name-label ( RW): VLAN12
    name-description ( RW): 
              bridge ( RO): xapi7
olivierlambert commented 8 years ago

And can you do the same for the target networks?

BogdanRudas commented 8 years ago

Sure!

On destination host:

# xe network-list name-label=VLAN10
uuid ( RO)                : 484f83dd-2129-9c2c-0ac9-9b540201bc62
          name-label ( RW): VLAN10
    name-description ( RW): 
              bridge ( RO): xapi3

# xe network-list name-label=VLAN1
uuid ( RO)                : dde9a0c0-09aa-4e77-2d90-280599ac72f3
          name-label ( RW): VLAN1
    name-description ( RW): Server network
              bridge ( RO): xapi1

# xe network-list name-label=VLAN12
uuid ( RO)                : d4791fea-4188-107e-0514-1c4617fe1733
          name-label ( RW): VLAN12
    name-description ( RW): VLAN12
              bridge ( RO): xapi6
olivierlambert commented 8 years ago

I don't understand why you got Pool-wide network associated with eth0 and not VLAN1 in the XO screenshot you sent.

olivierlambert commented 8 years ago

So, outside this strange naming stuff from screenshot, if I recap, this issue is about to try to match the same network name_label on source/destination networks to get it as default choice.

Am I correct?

Bogdar commented 8 years ago

@olivierlambert, yes

olivierlambert commented 8 years ago

Now it matches automatically the target network name if possible (or use the default network otherwise):

newmigra