Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to connect to a vSphere cluster using the information from the libvirt documentation.

$ virsh -c "vpx://root@10.51.4.11/dc1/dc1-cluster-e01/dc1-vsphere-e04/?no_verify=1"
Enter root's password for 10.51.4.11: 
error: internal error HTTP response code 400 for call to 'Login'
error: failed to connect to the hypervisor

I seem to be able to establish a connection, but it fails with a "HTTP code 400". If I provide the incorrect password it fails with a 'login credentials' error, so it looks like I am getting a connection, but it's failing for another reason.

Wireshark is no help as it's all done over SSL/TLS.

Any thoughts folks?

SOLUTION: jump to my answer below about special characters.


UPDATE: 15:21 28/02/11

FYI - I'm running libvirt-0.8.3 (the Ubuntu package recompiled with the ESX flag enabled).

When I put virsh into debug mode it returns this:

[snip]
Enter root's password for 10.51.4.11: 
15:19:09.011: debug : do_open:1249 : driver 3 ESX returned ERROR
15:19:09.011: debug : virUnrefConnect:294 : unref connection 0x98aa8f8 1
15:19:09.011: debug : virReleaseConnect:249 : release connection 0x98aa8f8
error: internal error HTTP response code 400 for call to 'Login'
error: failed to connect to the hypervisor

I've watched the vmware hostd.log file whilst trying to login, and it reports this error:

UPDATE: 10:26 02/03/11

[2011-03-02 10:24:16.415 26AF8B90 verbose 'Proxysvc Req16870'] New proxy client SSL(TCP(local=10.4.100.26:34001, peer=10.51.4.103:443))
[2011-03-02 10:24:16.430 26933B90 error 'SoapAdapter'] Client sent us an invalid SOAP request: at line number 8, not well-formed (invalid token)
share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

I posted my problem on the libvirt mailing list and got a quick reply.

It turns out libvirt doesn't escape special characters in passwords currently, and as it would happen, the password had an & in it.

I can now login by using & instead of &. There is a patch in the works for it to fix this.

share|improve this answer
add comment

Run command(without last slash):

$ virsh -c "vpx://root@10.51.4.11/dc1/dc1-cluster-e01/dc1-vsphere-e04?no_verify=1"

Try:

$ virsh -c "vpx://root@10.51.4.11?no_verify=1"

or:

$ virsh -c "vpx://10.51.4.11?no_verify=1"
$ virsh -c "esx://10.51.4.11?no_verify=1"
share|improve this answer
    
Nope, no luck. It still responds exactly the same. FYI, I've updated my question with some more information. –  Coops Feb 28 '11 at 15:22
    
Still no luck, the shortened vpx:// version complains it needs to know the resource, and the shortened esx:// version returns HTTP 400 too. –  Coops Mar 1 '11 at 10:57
add comment

Maybe this link will help? He's running 0.8.6 on Ubuntu...

share|improve this answer
    
I'll try it out when I'm back in the office tomorrow, however looking it at it the article doesn't do much different from what I do already, but worth a go. –  Coops Mar 1 '11 at 20:30
    
I'm thinking the version difference is enough to try it. A 400 status code seems to indicate that virsh is sending bad data, so possibly a bug? –  JakeRobinson Mar 1 '11 at 20:52
    
Nope - recompiled from source using the newest version and the error returned is the same. I've updated my question with details of the vmware logs though. –  Coops Mar 2 '11 at 10:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.