Microstack libvirt how to enable TCP listening mode

Microstack was setup as cluster with 2 computing nodes.

Version: microstack ussuri 222 latest/beta canonical✓ devmode

But libvirtd is default shipped only with sockets.

Change the configuration file:

/var/snap/microstack/common/libvirt/libvirtd.conf

to

listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
LIBVIRTD_ARGS="--listen"
unix_sock_rw_perms = "0770"
unix_sock_dir = "/var/snap/microstack/common/run/libvirt"
auth_unix_ro = "none"
auth_unix_rw = "none"
auth_tcp = "none"

and restart the service did not help. How TCP listening can be enabled that remote connections are possible in this specific snapd environment ?

Error Message:

virsh -c qemu+tcp://node1/system list
error: failed to connect to the hypervisor
error: unable to connect to server at 'node1:16509': Connection refused

Hi thomas, i answered your question on stackoverflow but thought for visibility i would post it here as well. The resolution is available here:

https://stackoverflow.com/questions/66312006/microstack-libvirt-how-to-enable-tcp-listening-mode/67222001#67222001

1 Like

As an FYI, this is fixed in the latest update for Microstack in the beta channel. Libvirt will now startup in listening mode.

1 Like

Hi Micheal, thanks a lot to check this issue. But still now luck, trying to do live migration from node1 to node2.

Thomas

May 3 21:31:53 node1 microstack.horizon-uwsgi[5258]: DEBUG keystoneauth.session REQ: curl -g -i -X POST http://192.168.0.31:8774/v2.1/servers/99a95c84-9e95-4743-a457-8839eeebc848/action -H “Accept: application/json” -H “Content-Type: application/json” -H “User-Agent: python-novaclient” -H “X-Auth-Token: {SHA256}98f1f969abdc21c46edaf4a21fc0f6143e441925090c9abdb2c1144bf040fa42” -d ‘{“os-migrateLive”: {“host”: “node2”, “block_migration”: true, “disk_over_commit”: true}}’
May 3 21:31:57 node1 nova-compute[863]: 2021-05-03 21:31:57.591 863 INFO nova.compute.manager [-] [instance: 99a95c84-9e95-4743-a457-8839eeebc848] Took 2.02 seconds for pre_live_migration on destination host node2.
May 3 21:31:57 node1 nova-compute[863]: 2021-05-03 21:31:57.684 863 ERROR nova.virt.libvirt.driver [-] [instance: 99a95c84-9e95-4743-a457-8839eeebc848] Live Migration failure: internal error: Attempt to migrate guest to the same host 86754f14-cdce-b34e-8f4a-cf799d48ef85: libvirt.libvirtError: internal error: Attempt to migrate guest to the same host 86754f14-cdce-b34e-8f4a-cf799d48ef85
May 3 21:31:57 node1 microstack.nova-compute[863]: File “/snap/microstack/222/lib/python3.8/site-packages/nova/virt/libvirt/driver.py”, line 9000, in _live_migration_operation
May 3 21:31:57 node1 microstack.nova-compute[863]: LOG.error(“Live Migration failure: %s”, e, instance=instance)
May 3 21:31:57 node1 microstack.nova-compute[863]: File “/snap/microstack/222/lib/python3.8/site-packages/nova/virt/libvirt/driver.py”, line 8988, in _live_migration_operation
May 3 21:31:57 node1 microstack.nova-compute[863]: guest.migrate(self._live_migration_uri(dest),
May 3 21:31:58 node1 nova-compute[863]: 2021-05-03 21:31:58.140 863 ERROR nova.virt.libvirt.driver [-] [instance: 99a95c84-9e95-4743-a457-8839eeebc848] Migration operation has aborted
May 3 21:31:58 node1 nova-compute[863]: 2021-05-03 21:31:58.159 863 INFO nova.compute.manager [-] [instance: 99a95c84-9e95-4743-a457-8839eeebc848] Swapping old allocation on dict_keys([‘338f3c5b-6be6-4dec-95d8-90ab04b0713d’]) held by migration 171eac7b-8aa4-46bd-8f56-6dee55824c3b for instance

Hi Billy, thankls I will try to update the microstack environment.

Thomas

FWIW, this live migration looks like it failed b/c it was trying to migrate to itself?

I’m curious the command you used for the live migration. FWIW, I’m able to live migrate on my machines with microstack.openstack server migrate --live-migration --block-migration <instance> --wait