4 Replies Latest reply on Aug 27, 2010 6:14 AM by Naveen Anne

    How to get a value of SystemInfo.System properties

      Hi there

       

      I'd like to store in a server property the information if a server is virtual or not. As I could see in the "SystemInfo.System" Server Object during a live browse in the model property the information "VMWare Virtual Platform" for each virtual server. So how can I use this information to store it?

       

      I checked the BLCLI guide but it is actually not a server object. How can I access it? Or is there an easier way to implement it?

       

      Many thanks

       

      Manuel

        • 1. Re: How to get a value of SystemInfo.System properties
          Bill Robinson

          There's a property called 'OS_VENDOR' that for VMware guest should show as 'VMware' - will that work as an identifier?

          • 2. Re: How to get a value of SystemInfo.System properties

            Hi Bill

             

            Unfortunately OS_VENDOR property shows me something like: { Windows, SuSE, Solaris } but I can't see if this server is virtual or not...

             

            Manuel

            • 3. Re: How to get a value of SystemInfo.System properties
              Bill Robinson

              Yeah, you're right, I was thinking about the bios vendor from something like a dmidecode.  I thought that if a server was virtual it would populate the 'is_virtual' property?  Maybe only if you have its esx host under Bladelogic management.

              • 4. Re: How to get a value of SystemInfo.System properties
                Naveen Anne

                I think this can be achived by a small shell script. Here is something you can start with:

                 

                =============================================================================

                SERVERGROUP="$1"
                echo $SERVERGROUP
                SERVERS=`blcli Server listServersInGroup "$SERVERGROUP"`
                echo $SERVERS

                 

                #Get Server's OS
                VIRTUAL="False"

                 

                for SERVER in $SERVERS
                do
                echo "about to call uname"
                cd //$SERVER
                if [ $? = 0 ]; then

                 

                OS=`uname -s`
                echo "Host is "$SERVER", OS is $OS"

                 


                #Set the options and connect using nsh performance commands
                if [ "$OS" = "AIX" ]; then
                    {
                    nexec $SERVER lparstat -i|grep 'Minimum Virtual'|grep 0
                    if [ $? = 0 ]; then
                        VIRTUAL="False"
                    else
                        VIRTUAL="True"
                    fi
                    blcli_execute Server setPropertyValueByName $SERVER VM_VIRTUAL_MACHINE $VIRTUAL
                    }
                elif [ "$OS" = "WindowsNT" ]; then
                    {
                    nexec $SERVER ipconfig /all|findstr VMware
                    if [ $? = 0 ]; then
                        VIRTUAL="False"
                    else
                        VIRTUAL="True"
                    fi
                    blcli_execute Server setPropertyValueByName $SERVER VM_VIRTUAL_MACHINE $VIRTUAL
                    }

                 

                else
                    echo "$SERVER is not Windows or AIX, skipping"
                fi
                else
                    echo "$SERVER - Host Unavailable"
                fi

                 

                ============================================================================

                 

                The above script checks all servers in a server group and determines if it is a virtual machine or not. If it is a virtual machine, then it populates a property called VM_VIRTUAL_MACHINE. I quickly wrote this for Windows and AIX. Include more OS types if you want. Also, you can change the property name to a custom property if you want.