Additional configuration > Configuring Moab Cloud Suite for quoting

Configuring Moab Cloud Suite for quoting

Quoting allows you to view the price of a potential service before it is actually submitted to Moab.

Quoting in Moab Cloud Suite is meant to be enabled by the Adaptive Computing Professional Services team. It is recommended that you contact that department to set up this feature.

To configure Moab Cloud Suite for quoting

Before you configure Moab Cloud Suite for quoting, make sure that you have configured NAMI in Moab. For more information, see "Charging a Workflow" in the Moab Workload Manager Administrator Guide.

  1. First, ensure all required dependencies are installed to run the bank.quote.viewpoint.pl script (located in your Moab install directory).
  2. When you run bank.quote.viewpoint.pl, you should see:

    [root]# /opt/moab/tools/mam/bank.quote.viewpoint.pl
    usage: bank.quote.viewpoint.pl <xml>
  3. Make sure that bank.quote.viewpoint.pl is owned by root and that the SUID bit is on. For example:
  4. [root]# cd /opt/moab/tools/mam
    [root]# ls -l
    [root]# -rwsr-xr-x. 1 root root 3658 Oct  5 17:37 bank.quote.viewpoint.pl
  5. Edit the /opt/moab/etc/nami.cfg file to ensure that the Moab Accounting Manager user can write the NAMI logs. Do the following:
    1. If you followed the MAM installation documentation, the user running MAM should be named "moab." However, if you are not sure what the user is called, you can run the following command:
    2. [root]# ps -ef | grep gold
      moab      2203     1  0 20:43 pts/0    00:00:00 /usr/bin/perl -w /opt/mam/sbin/goldd
    3. Now that you know the MAM user, edit the nami.cfg file:
    4. [root]# nano /opt/moab/etc/nami.cfg
    5. Edit the line for LOG[config]:
    6. LOG[config]                         path=/tmp/nami.log
  6. To test that your log configuration worked, you can run bank.quote.viewpoint.pl with some sample text as the MAM user. For example:
  7. The script will throw an error for not passing in XML, but you should be able to see lines output to the nami.log file.

    [root]# /opt/moab/tools/mam/bank.quote.viewpoint.pl someTestText
    :1: parser error : Start tag expected, '<' not found
    someTestText
    ^

    Now if you examine the nami.log file, you should see the sample text. For example:

    [root]# tail /opt/moab/log/nami.log
    2012-10-13 21:10:36,863 [3086] INFO Quote main::  - INPUT: someTestText
  8. Verify that the mam.secretKey parameter in the mws-config.groovy file matches the token.value in /opt/mam/etc/site.conf. If it doesn't match, do the following:
    1. Edit the mws-config.groovy file:
    2. [root]# nano /opt/mws/etc/mws-config.groovy
    3. Set the mam.secretKey parameter. For example, if site.conf has the line token.value = nIoyzXVi2iiSoybthygQEJsa, then edit (or add) this line to the mws-config.groovy file:
    4. mam.secretKey = "nIoyzXVi2iiSoybthygQEJsa"
  9. Configure the "billing" section of the ViewpointConfig.groovy file so that quoting_enabled is set to "true" and that the key points to the bank.quote.viewpoint.pl script. For example:
  10. billing {
       quoting_enabled="true"
       quote="/opt/moab/tools/mam/bank.quote.viewpoint.pl"
    }
  11. Also in the ViewpointConfig.groovy file, create a new "ssh" section. For example:
  12. ssh {
       host="moabserverhostname"
       username="root"
       password="secret"
       key_path="/username/.ssh/privatekeyfile"
       key_passphrase="keyfilepassword"
       port="22"
       run_as_sudo="true"
    }

    Make the following specifications:

    Field Description
    host Moab server host name. Required.
    username Username used to connect to the Moab server. Required.
    password Password used to authenticate on Moab server. Required if no key file.
    key_path Path on the server to the key file. Optional.
    key_passphrase Path on the server to the password file (if you have a password set on the key file). Optional.
    port The SSH port used to connect to Moab. Required.
    run_as_sudo

    "true" or "false". Runs "sudo" with MAM script calls if you are not using "root" user. Defaults to "false".

    The user must be set up to have "sudo" rights without requiring a password.

  13. Save your changes to the ViewpointConfig.groovy file.
  14. Restart Tomcat.
  15. [root]# service tomcat6 restart
  16. Validate that you configured quoting correctly by doing the following:
    1. Log in to Viewpoint as a user that exists in LDAP and in Moab Accounting Manager.
    2. Request a service and navigate to the Cart Details page (for more information, see "Using the cart" in the Viewpoint Management and User Guide).

If you have configured quoting correctly, you should see billing information on the shopping cart page.