VIX example

Version 2
    Task Name
    VIX sample workflows
    1. Tested on
    ComponentsvSphere 5.x
    User Inputs
    1. User ID
    2. Password
    3. VIX command

    Instructions for Regular Workflow Use:

    1. Download the attached .ZIP file below to your computer. *Remember the location of the saved file on your computer.
    2. Unzip the file on your computer. Should end up with a .WFD file.
    3. Log in to UCS Director as a user that has "system-admin" privileges.
    4. Navigate to "Policies-->Orchestration" and click on "Import".
    5. Click "Browse" and navigate to the location on your computer where the .WFD file resides. Choose the .WFD file and click "Open".
    6. Click "Upload" and then "OK" once the file upload is completed. Then click "Next".
    7. Click the "Select" button next to "Import Workflows". Click the "Check All" button to check all checkboxes and then the "Select" button.
    8. Click "Submit".
    9. A new folder should appear in "Policies-->Orchestration" that contains the imported workflow. You will now need to update the included tasks with information about the specific environment.


    Linux example script






    # script used by UCSD to change the hostname and IP of either a solaris

    # or linux host.



    # if 3 arguments are not passed to the script, exit

    if [ $# != 3 ]; then

            echo "usage: / <ip> <netmask> <gateway>"

            echo "arguments passed to $1, $2, $3" > /vix.out




    # set variables to change server identity

    HOSTNAME=`hostname | awk -F. '{print $1}'`





    # set parsed out variables

    LOCATION=`echo $HOSTNAME | cut -c1-4`

    NETWORK=`echo $IP | awk -F. '{print $1"."$2"."$3".0"}'`

    OS=`uname -s`


    # configure DNS

    if [ $LOCATION == "vacu" ]; then

            echo "search" > /etc/resolv.conf

            echo "nameserver" >> /etc/resolv.conf

            echo "nameserver" >> /etc/resolv.conf

            echo "nameserver" >> /etc/resolv.conf

    elif [ $LOCATION == "casc" ]; then

            echo "search" > /etc/resolv.conf

            echo "nameserver" >> /etc/resolv.conf

            echo "nameserver" >> /etc/resolv.conf

            echo "nameserver" >> /etc/resolv.conf



    if [ "$OS" == "SunOS" ]; then


    # change crash directory name

    rm -rf /var/crash/*

    mkdir /var/crash/$HOSTNAME

    chmod 700 /var/crash/$HOSTNAME

    dumpadm -s /var/crash/$HOSTNAME


    # change hostname in /etc/hosts

    #echo "#" > /etc/hosts

    #echo "# Internet host table" >> /etc/hosts

    #echo "#" >> /etc/hosts

    #echo "::1     localhost" >> /etc/hosts

    #echo "       localhost" >> /etc/hosts

    #echo "$IP      ${HOSTNAME}      $HOSTNAME" >> /etc/hosts

    sed '/192.168.254/d' /etc/hosts > /tmp/hosts

    cp /tmp/hosts /etc/hosts

    echo "$IP       ${HOSTNAME}      $HOSTNAME" >> /etc/hosts


    # change nodename

    echo $HOSTNAME > /etc/nodename


    # change interface

    echo $HOSTNAME > /etc/hostname.e1000g0


    # change netmask

    grep '^#' /etc/netmasks > /tmp/netmasks

    cp /tmp/netmasks /etc/netmasks

    echo "$NETWORK  $NETMASK" >> /etc/netmasks


    # change gateway

    echo $GATEWAY > /etc/defaultrouter


    # clean up

    rm -rf /.ssh/*

    rm -rf /.bash_history




    # change hostname in /etc/hosts

    #echo "   localhost localhost.localdomain localhost4 localhost4.localdomain4" > /etc/hosts

    #echo "::1         localhost localhost.localdomain localhost6 localhost6.localdomain6" >> /etc/hosts

    #echo "$IP       ${HOSTNAME}      $HOSTNAME" >> /etc/hosts

    sed -i '/192.168.254/d' /etc/hosts

    echo "$IP       ${HOSTNAME}      $HOSTNAME" >> /etc/hosts


    # add hostname to /etc/sysconfig/network

    #echo "NETWORKING=yes" > /etc/sysconfig/network

    #echo "HOSTNAME=$HOSTNAME" >> /etc/sysconfig/network


    # build /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "DEVICE=eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "BOOTPROTO=static" >> /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "IPADDR=$IP" >> /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "NETMASK=$NETMASK" >> /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "GATEWAY=$GATEWAY" >> /etc/sysconfig/network-scripts/ifcfg-eth0

    echo "ETHTOOL_OPTS=\"autoneg on\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0

    chmod 644 /etc/sysconfig/network-scripts/ifcfg-eth0


    # remove persistent udev

    rm -rf /etc/udev/rules.d/70-persistent-net.rules




    # remove script used to wipe host

    rm -rf /


    # reboot VM

    # init 6



    The following is the  windows cmd file. 

    This is copy to notepad and saved as c:\vix.cmd


    echo "%1 %2 %3" > c:\vix.out


    c:\\Windows\\System32\\netsh.exe interface set interface name="Local Area Connection" newname="%1"


    c:\\Windows\\System32\\netsh.exe interface ip set address "%1" static %1 %2 %3





    Screen Shot 2015-03-19 at 5.51.33 PM.png


    Screen Shot 2015-03-19 at 12.03.54 PM.png


    Screen Shot 2015-03-19 at 1.00.51 PM.png