nforgeio / neonKUBE

Public NeonKUBE Kubernetes distribution related projects
https://neonkube.io
Apache License 2.0
78 stars 13 forks source link

Investigate XVA import network dependencies #1014

Open marcusbooyah opened 3 years ago

marcusbooyah commented 3 years ago

It looks like when we import a VM, it tries to import the networks associated with it. In this case where I only had 1 NIC, the second network couldn't be created.

Oct 13 15:13:56 xcp3 xapi: [debug||2011 UNIX /var/lib/xcp/xapi|VDI.create R:631809e3d7a5|xapi] Unmarking SR after VDI.create (task=OpaqueRef:631809e3-d7a5-450d-9ad9-a0dfc0de8f33)
Oct 13 15:13:56 xcp3 xapi: [debug||2008 UNIX /var/lib/xcp/xapi|VM.import R:3df3ae362636|import] Importing 1 VM_guest_metrics(s)
Oct 13 15:13:56 xcp3 xapi: [debug||2008 UNIX /var/lib/xcp/xapi|VM.import R:3df3ae362636|import] Importing 1 VM(s)
Oct 13 15:13:56 xcp3 xapi: [debug||2037 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:VM.create D:09ff25a75c8e created by task R:3df3ae362636
Oct 13 15:13:56 xcp3 xapi: [ info||2037 UNIX /var/lib/xcp/xapi||taskhelper] task VM.create R:9eefe8155591 (uuid:46eb6b5d-cf9a-b77e-2f10-7a8d63406713) created (trackid=1d55fbe56916df5496ccd5ad0e8cdeb9) by task R:3df3ae362636
Oct 13 15:13:56 xcp3 xapi: [debug||2037 UNIX /var/lib/xcp/xapi|VM.create R:9eefe8155591|audit] VM.create: name_label = 'neon-ubuntu-20.04.latest' name_description = ''
Oct 13 15:13:56 xcp3 xapi: [debug||2008 UNIX /var/lib/xcp/xapi|VM.import R:3df3ae362636|import] Created VM: OpaqueRef:dd959623-5406-4747-be80-180b3379e8e7 (was Ref:48)
Oct 13 15:13:56 xcp3 xapi: [debug||2008 UNIX /var/lib/xcp/xapi|VM.import R:3df3ae362636|import] Importing 2 network(s)
Oct 13 15:13:56 xcp3 xapi: [ warn||946 INET :::80|event.from D:fc988f659d72|xapi] get_since_for_events: no in_memory_cache!
Oct 13 15:13:56 xcp3 xapi: [debug||2038 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:network.get_by_name_label D:6656ceefd51e created by task R:3df3ae362636
Oct 13 15:13:56 xcp3 xapi: [debug||2039 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:network.get_all_records_where D:8faad8d4188e created by task R:3df3ae362636
Oct 13 15:13:56 xcp3 xapi: [debug||2040 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:network.create D:0e319c1dd359 created by task R:3df3ae362636
Oct 13 15:13:56 xcp3 xapi: [ info||2040 UNIX /var/lib/xcp/xapi||taskhelper] task network.create R:351e6164f48e (uuid:410b8381-5c96-ed97-880d-4c6d46ea9728) created (trackid=1d55fbe56916df5496ccd5ad0e8cdeb9) by task R:3df3ae362636
Oct 13 15:13:56 xcp3 xapi: [debug||2040 UNIX /var/lib/xcp/xapi|network.create R:351e6164f48e|audit] Network.create: name_label = 'Pool-wide network associated with eth1'; bridge = 'xenbr1'; managed = 'true'
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] network.create R:351e6164f48e failed with exception Server_error(INVALID_VALUE, [ bridge; xenbr1 ])
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] Raised Server_error(INVALID_VALUE, [ bridge; xenbr1 ])
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 1/8 xapi Raised at file ocaml/xapi/xapi_network.ml, line 217
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 2/8 xapi Called from file lib/xapi-stdext-pervasives/pervasiveext.ml, line 24
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 3/8 xapi Called from file ocaml/xapi/rbac.ml, line 236
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 4/8 xapi Called from file ocaml/xapi/server_helpers.ml, line 83
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 5/8 xapi Called from file ocaml/xapi/server_helpers.ml, line 99
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 6/8 xapi Called from file lib/xapi-stdext-pervasives/pervasiveext.ml, line 24
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 7/8 xapi Called from file lib/xapi-stdext-pervasives/pervasiveext.ml, line 35
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace] 8/8 xapi Called from file lib/backtrace.ml, line 177
Oct 13 15:13:56 xcp3 xapi: [error||2040 UNIX /var/lib/xcp/xapi||backtrace]
Oct 13 15:13:56 xcp3 xapi: [error||2008 UNIX /var/lib/xcp/xapi|VM.import R:3df3ae362636|import] Import failed: failed to create Network with name_label Pool-wide network associated with eth1
Oct 13 15:13:56 xcp3 xapi: [error||2008 UNIX /var/lib/xcp/xapi|VM.import R:3df3ae362636|import] Caught exception in import: INVALID_VALUE: [ bridge; xenbr1 ]
Oct 13 15:13:56 xcp3 xapi: [debug||2041 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:session.slave_login D:fd897d37001d created by task R:9fa8d2606abe
Oct 13 15:13:56 xcp3 xapi: [ info||2041 UNIX /var/lib/xcp/xapi|session.slave_login D:3243ddc0cac9|xapi] Session.create trackid=1a64f31d70a3893b952110f77a71f211 pool=true uname= originator=xapi is_local_superuser=true auth_user_sid= parent=trackid=9834f5af41c964e225f24279aefe4e49
Oct 13 15:13:56 xcp3 xapi: [debug||2042 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:pool.get_all D:6b367f52ffe9 created by task D:3243ddc0cac9
Oct 13 15:13:56 xcp3 xapi: [debug||2043 UNIX /var/lib/xcp/xapi||dummytaskhelper] task dispatch:VM.destroy D:435f91075fe8 created by task R:9fa8d2606abe
Oct 13 15:13:56 xcp3 xapi: [ info||2043 UNIX /var/lib/xcp/xapi||taskhelper] task VM.destroy R:d91023782394 (uuid:9a3ef4e5-288e-0fc0-3723-4a9cfdaa56e7) created (trackid=1a64f31d70a3893b952110f77a71f211) by task R:9fa8d2606abe
Oct 13 15:13:56 xcp3 xapi: [debug||2043 UNIX /var/lib/xcp/xapi|VM.destroy R:d91023782394|audit] VM.destroy: VM = '09d690b9-f99a-6491-c95c-b6f063a2c71c (neon-ubuntu-20.04.latest)'
Oct 13 15:13:56 xcp3 xapi: [debug||2043 UNIX /var/lib/xcp/xapi|VM.destroy R:d91023782394|xapi_vm_helpers] VM.destroy: deleting DB records
marcusbooyah commented 3 years ago

After adding a new network manually, I could import the xva:

[15:15 xcp3 ~]# xe network-create name-label="Pool-wide network associated with eth1"
86b68a9f-d40f-dced-411e-17a3060af205
[15:15 xcp3 ~]# xe vm-import url=http://s3-us-west-2.amazonaws.com/neonkube/vm-images/xenserver/neon-ubuntu-20.04.latest.xva
[15:15 xcp3 ~]# xe network-list
uuid ( RO)                : bc351807-8076-f9b7-8d94-1369f20a6ecd
          name-label ( RW): Pool-wide network associated with usb0
    name-description ( RW):
              bridge ( RO): brusb0
uuid ( RO)                : 86e8dcb3-35f8-6832-9130-59b88791aeed
          name-label ( RW): Host internal management network
    name-description ( RW): Network on which guests will be assigned a private link-local IP address which can be used to talk XenAPI
              bridge ( RO): xenapi
uuid ( RO)                : 18729ffe-cae4-37f8-c58d-82961345724e
          name-label ( RW): Pool-wide network associated with eth0
    name-description ( RW):
              bridge ( RO): xenbr0
uuid ( RO)                : 86b68a9f-d40f-dced-411e-17a3060af205
          name-label ( RW): Pool-wide network associated with eth1
    name-description ( RW):
              bridge ( RO): xapi1
[15:15 xcp3 ~]# xe vm-import url=http://s3-us-west-2.amazonaws.com/neonkube/vm-images/xenserver/neon-ubuntu-20.04.latest.xva
3309bc27-1879-c040-a4d5-2cecea0ebe19