BMC smart-proxy unauthorized issue

You will need to pass the credentials in the header as basic authentication.

try adding -u username:password' to your curl command

Thanks,

Corey Osman
corey@logicminds.biz

Green IT and Data Center Automation Specialist

··· On May 10, 2013, at 4:30 PM, Konstantin Orekhov wrote:

Hello, everyone!

Have anyone experienced the following issue with BMC smart-proxy?

I just tried stable (1.1) foreman-proxy on RHEL6 and getting the “unauthorized” no matter how I submit the API call - curl (GET or PUT), browser or Firefox RESTclient.
The host I’m trying to control through BMC proxy is available on the network, username/password do work - verified with ipmitool from the same host where BMC smart-proxy is.

$ curl -X GET http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status
unauthorized
$

curl -X PUT http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status
curl -X GET http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status -d ‘username=&password=’
curl -X PUT http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status -d ‘username=&password=’
curl -X GET http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status -d ‘username=’ -d ‘password=’ -d ‘bmc_provide=ipmitool’
curl -X PUT http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status -d ‘username=’ -d ‘password=’ -d ‘bmc_provider=ipmitool’
curl -X GET ‘http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status?username=&password=&bmc_provider=ipmitool’
curl -X PUT ‘http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status?username=&password=&bmc_provider=ipmitool’
curl -X GET ‘http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status?username=&password=’
curl -X PUT ‘http://bmc-proxy-host:8443/bmc/<bmc_ip>/chassis/power/status?username=&password=’

and the variations of the above in a browser and RESTclient.

At the same time, ipmitool from the bmc-proxy-host (and other locations) works just flawlessly:

bmc-proxy-host$ ipmitool -U -P -I lanplus -H <bmc_ip> power status
Chassis Power is on

bmc-proxy-host$ ipmitool -U -P -I lanplus -H <bmc_ip> chassis power status
Chassis Power is on

What am I missing?

Thanks!

Konstantin.

>
>
> try adding -u username:password' to your curl command
>
>
Yes, that worked, thanks!

One additional question - I noticed that 'reboot=true|false' has no effect
and as soon as I set a bootdev to pxe, bios or disk, the host reboots. Do I
run the command wrong?

curl -u root:console -X PUT

http://bmc-host:8443/bmc/<bmc-ip>/chassis/config/bootdevice/pxe -d
'reboot=false'
{"result":true,"action":"pxe"}

··· #

Running foreman-proxy-1.1stable-1.el6.noarch on RH6.1 with rubyipmi (0.5.1).

Thanks!

That should work. However, it may not work on all systems. IPMI standards
are often neglected from vendor to vendor. Ensure your BMC Firmware is up
to date. I'll need to document these isolated issues, but its most likely
got something to do with your BMC and ipmitool. Please send me your
hardware details in a personal email and maybe we can find a fix. You may
want to try switching to freeipmi if using ipmitool but don't expect a
complete solution from either. To switch bmc providers either change
default config in smart proxy or pass bmc_provider=freeipmi in the body.
Install freeimpi from source not rpm package.

#:bmc_default_provider: freeipmi

curl -u root:console -X PUT http://bmc-host:8443/bmc/<bmc-ip>/chassis/config/bootdevice/pxe -d 'reboot=false' -d bmc_provider=freeimpi

··· On Monday, May 13, 2013 1:01:57 PM UTC-7, Konstantin Orekhov wrote: > > >> try adding -u username:password' to your curl command >> >> > Yes, that worked, thanks! > > One additional question - I noticed that 'reboot=true|false' has no effect > and as soon as I set a bootdev to pxe, bios or disk, the host reboots. Do I > run the command wrong? > > # curl -u root:console -X PUT http://bmc-host:8443/bmc//chassis/config/bootdevice/pxe > -d 'reboot=false' > {"result":true,"action":"pxe"} > # > > Running foreman-proxy-1.1stable-1.el6.noarch on RH6.1 with rubyipmi > (0.5.1). > > Thanks! >

Sorry, but having worked with BMCs and ipmitool every day for last 2 years,
I can guarantee this issue is not inflicted by the FW version (which is up
to date, BTW) or ipmitool (which does NOT reboot systems after bootdev is
updated unless a separate "power" command is issued). Not on these systems
anyway.

Here's the interesting find - the following command does NOT reboots the
box for me, but sets the bootdev properly, so I have a feeling that
"reboot" option is not parsed properly?

curl -u root:console -X PUT http://bmc-host:8443/bmc/<bmc-ip>/chassis/config/bootdevice/pxe -d ''

What kind of the HW details do you need? ipmitool bmc info and fru list or
something else?

Thanks!

··· On Monday, May 13, 2013 10:34:06 PM UTC-7, Corey Osman wrote: > > That should work. However, it may not work on all systems. IPMI > standards are often neglected from vendor to vendor. Ensure your BMC > Firmware is up to date. I'll need to document these isolated issues, but > its most likely got something to do with your BMC and ipmitool. Please > send me your hardware details in a personal email and maybe we can find a > fix. You may want to try switching to freeipmi if using ipmitool but don't > expect a complete solution from either. To switch bmc providers either > change default config in smart proxy or pass bmc_provider=freeipmi in the > body. Install freeimpi from source not rpm package.