Bug #1425
Cannot add ESX host vai "onehost create" but /var/lib/one/remotes/im/run_probes vmware runs correctly under oneadmin account
Status: | Closed | Start date: | 08/22/2012 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | - | |||
Resolution: | Pull request: | |||
Affected Versions: | OpenNebula 3.4 |
Description
When adding an ESX host to OpenNebula 3.4.1 using the CentOS appliance the host produces log similar to:
Monitoring host labhost (8)
Tue Aug 21 14:42:48 2012 [InM][I]: Command execution fail: /var/lib/one/remotes/im/run_probes vmware 8 labhost
Tue Aug 21 14:42:48 2012 [InM][E]: vmware.rb: Error executing: virsh -c 'esx://labhost/?no_verify=1&auto_answer=1' --readonly nodeinfo err: ExitCode: 1
Tue Aug 21 14:42:48 2012 [InM][I]: out:
Tue Aug 21 14:42:48 2012 [InM][I]: error: internal error curl_easy_perform() returned an error: Couldn't connect to server (7) : Failed to connect to X.X.X.X: Permission denied
Tue Aug 21 14:42:48 2012 [InM][I]: error: failed to connect to the hypervisor
Tue Aug 21 14:42:48 2012 [InM][E]: Error executing vmware.rb
Tue Aug 21 14:42:48 2012 [InM][I]: ExitCode: 1
Tue Aug 21 14:42:48 2012 [InM][E]: Error monitoring host 8 : MONITOR FAILURE 8 Error executing vmware.rb
HOWEVER, when running the command from the shell it completes without error:
[oneadmin@ONE341 ~]$ /var/lib/one/remotes/im/run_probes vmware 8 labhost
HYPERVISOR=vmware TOTALCPU=800 FREECPU=800 CPUSPEED=2612 TOTALMEMORY=33550332 FREEMEMORY=26840265
History
#1 Updated by stephen howell almost 9 years ago
ESX host is ESX 4.1 update 1, SSH access for oneadmin is enabled, with passwords correctly added and SSH keys imported into the host.
#2 Updated by Tino Vázquez almost 9 years ago
Since the command executes correctly under the shell, I can only think of environmental variables. Could you compare the variables accesible from the vmware.rb script when ran directly on the shell compared with the ones available when ONE runs the script?
Also, are you running any sort of HTTP proxy?
#3 Updated by stephen howell almost 9 years ago
Not familiar with ruby, could you provide a code snippet to show how I can show those environment variables?
No proxy here, direct connection although the system did have http_proxy set I have removed that and rebooted and symptoms remain unchanged.
Thanks
#4 Updated by Tino Vázquez almost 9 years ago
Add the following in line 46 of vmware.rb
`env > /tmp/vmware_env_vars`
Run it once from the shell, backup the file, make ONE monitor the host, and compare both files.
#5 Updated by stephen howell almost 9 years ago
Thanks for the assistance, this is the difference between the version called via "onehost create" and the one run from the shell:
[oneadmin@ONE341 ~]$ diff /tmp/vmware_env_vars /tmp/vmware_env_vars_shell
1a2,3
SELINUX_ROLE_REQUESTED=
TERM=xterm
3d4
< TERM=linux
5c6,7
< PRIORITY=19
---
SSH_CLIENT=169.66.210.159 58446 22
SELINUX_USE_CURRENT_RANGE=
7a10
SSH_TTY=/dev/pts/0
8a12
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
13a18
SELINUX_LEVEL_REQUESTED=
15c20
< SHLVL=5
---
SHLVL=3
19a25
SSH_CONNECTION=169.66.210.159 58446 169.82.112.252 22
22d27
< ONE_MAD_DEBUG=
#6 Updated by stephen howell almost 9 years ago
Please let me know if you need further information or if this bug is known to you and could be fixed by upgrading to a newer release. I have also noticed that I am unable to login to Sunstone, log error is " [E]: Error initializing authentication system" Perhaps the two are linked somehow.
#7 Updated by Tino Vázquez almost 9 years ago
- Status changed from New to Closed
I would suggest an email to the support list describing the monitorization problem, and a second one for the sunstone problem. This way other members of the community can help. I am closing this bug as it is not clear wether this is a bug or a problem with configuration. We will reopen it if we find out in the mailing list that there is indeed a bug.