[PATCH] esx: Change the default username when connecting to VCenter

Michal Privoznik mprivozn at redhat.com
Fri Mar 24 11:11:23 UTC 2023


While it's true that the default username is:

  administrator@${SSO-Domain}

in majority of cases the ${SSO-Domain} is "vsphere.local". But
our code (and what virsh displays then) says it's just
"administrator".

This is wrong also from a different POV: the username must
contain the suffix no matter what and our default suggests
otherwise.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2181234
Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/esx/esx_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 9dc5489411..2443e6e88a 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -701,7 +701,8 @@ esxConnectToVCenter(esxPrivate *priv,
     if (conn->uri->user) {
         username = g_strdup(conn->uri->user);
     } else {
-        if (!(username = virAuthGetUsername(conn, auth, "esx", "administrator",
+        if (!(username = virAuthGetUsername(conn, auth, "esx",
+                                            "administrator at vsphere.local",
                                             hostname)))
             return -1;
     }
-- 
2.39.2



More information about the libvir-list mailing list