Wednesday, December 28, 2011

How to backup and restore Veeambackup database

 

At Veem forums you can find a .bat script that backups Veeambackup database I've made some changes to fit my own scenario:

Monday, December 26, 2011

Check if your mail server IP is blacklisted


If your mail server is blacklisted it not be able to send mails. There are several web pages that allows you to check this from one single click:
http://www.blacklistalert.org/
http://www.anonmails.de/blacklist.php?language=en
image

Thursday, December 15, 2011

Tuesday, November 29, 2011

VMware ESX 3.5 Update Manager Failure

This is a post from Roger Birong, esxupdate also fails from console not only from ssh:
If you are suddenly (June 2011) unable to Scan for Updates or Remediate VMware ESX 3.5 Hosts, you may be without

Friday, November 11, 2011

Block size limitations of a VMFS datastore

Here you can find a VMware's Knowledge Base article related to VMFS datastores:
VMFS Block Sizes
The block size on a VMFS datastore defines two things:

Wednesday, November 9, 2011

Registro de inicio y cierre de sesión en un W2003 con active directory

Para registrar el inicio y cierre de sesión en un entorno con windows 2003 y donde los puestos inician sesión validándose contra active directory hay que modificar la directiva de grupo del dominio, asique abre el programa Usuarios y equipos de Active Directory y en el dominio que tengas creado pincha con el botón de la derecha del ratón y selecciona propiedades:

Monday, November 7, 2011

Loading a saved configuration file to a new D-Link DGS-3627 switch

Connect with a browser to the default switch IP (10.90.90.90), the default user and password is blank, so press the OK button:
clip_image002

Tuesday, October 18, 2011

Performing a rescan of the storage on vSphere


Here you can find a VMware's Knowledge Base article that explains how to perform a rescan of the storage on vSphere.

Thursday, October 6, 2011

Reordering vmnics on vSphere 4.x

Today I've had an issue with a vSphere installation (esx 4.0 update 2). I've installed the esx server using a kikstart config file (ks.cfg) as usual, I've only one nic (integrated in the MoBo) so the service console (vswif0) was linked to my first nic (vmnic0) as usual.

Configuring networking from the ESX service console

Here you can find this VMware Knowledge Base that explains how to configure networking from the ESX service console command line.

Details

This article provides steps to configure networking for an ESX host when you only have access to the service console.

Solution

Wednesday, September 28, 2011

Linux rescan SCSI bus

If you add a new disk to a Linux VM system and you don't want to reboot it, you must rescan the SCSI bus to detect it.

Here you can find a bash script that will do this task for you:

http://www.garloff.de/kurt/linux/

Thanks to garloff.

image

Wednesday, September 21, 2011

Console access on esxi (3.x, 4.x)

This text is from www.yellow-bricks.com
By default this isn’t possible. But there’s a way to get this working, just do the following:
  1. Go to the ESXi console and press alt+F1
  2. Type: unsupported
  3. Enter the root password(No prompt, typing is blindly)
  4. At the prompt type “vi /etc/inetd.conf”
  5. Look for the line that starts with “#ssh” (you can search with pressing “/”)
  6. Remove the “#” (press the “x” if the cursor is on the character)
  7. Save “/etc/inetd.conf” by typing “:wq!”
  8. Restart the management service “/sbin/services.sh restart”
Done!
Here is a video that explains ssh access in esxi 3.x:
http://www.vm-aware.com/2008/07/enable-ssh-for-esxi/
Here is a video that explains how to modify the kernel in esxi v4.x to enable ssh access:
http://www.youtube.com/watch?v=FxB0IIpwZu





Wednesday, September 7, 2011

ESX host displays the message "Configuration changes were not saved successfully during previous shutdown"

From VMware Knowledge Base:

Details
  • When you log into the ESX 3.x host service console, you see the message:
    Configuration changes were not saved successfully during previous shutdown.
    Note: This message is stored in /etc/motd and is generated by the /etc/init.d/vmware script when esxcfg-boot -r returns an error when executed during a shutdown of the ESX host.

  • The log file /var/log/messages may show the following error messages:
    ERROR: Execution of '/sbin/vmware-mkinitrd -r -f -v /tmp/vmware.1.tmp '2.4.21-37.0.2.ELvmnix'' failed. See log messages above.
    ERROR: Could not write out new initrds.

  • initrd-2.4.21-37.0.2.ELvmnix.img in the /boot directory has a  size of zero
Solution

You need to recreate the initrd image file.

T o recreate the initrd image file:

  1. Start the system and select ESX troubleshooting mode.
  2. Log in as a user with administrative privileges.

  3. Run the commands:
    esxcfg-boot -b
    esxcfg-boot -p
    esxcfg-boot -r
    The message does not appear on the next ESX host reboot.

Mounting a Windows share from VMware esx 4

Mounting a windows share from VMware esx 4 can be useful for install updates.
First of all you must enable netbios ports on esx firewall, for this task you can run the following commands on your esx server

How to install/enable .Net 3.5 SP1 on Windows Server 2008 R2 for SQL Server 2008 and SQL Server 2008 R2

Here you can find a good article that explains how to enable .Net 3.5 on W2008:
http://blogs.msdn.com/b/sqlblog/archive/2010/01/08/how-to-install-net-framework-3-5-sp1-on-windows-server-2008-r2-environments.aspx
The .NET Framework 3.5 SP1 (also referred to as .NET Framework 3.5.1) is a prerequisite for SQL Server 2008. SQL Server 2008 Setup for standalone instance will install the .NET Framework 3.5 SP1 if it is not already installed. In Windows Server 2008 R2, the .NET Framework is a feature and installing it is different when compared to older versions of Windows Operating System. In previous versions, one could either download the .NET Framework 3.5.1 install binaries from Microsoft download site or use the install binaries from the redist folder of the SQL Server 2008 installation media. Starting with Windows Server 2008 R2, the method of installing .NET Framework 3.5.1 has changed. This document explains how to verify that .NET Framework 3.5.1 is installed and if it is not installed how you can add it.
How to verify if .NET Framework 3.5 SP1 is installed:
Here are the steps to verify that .NET Framework 3.5.1 is installed on Windows Server 2008 R2.
  1. Click the Start button in the lower left hand corner of the display.
  2. Highlight Administrative Tools and select Server Manager.
  3. In the Server Manager interface, click Features to display all the installed Features in the right hand pane. Verify that .NET Framework 3.5.1 is listed.
If .NET Framework 3.5.1 feature is not listed, you can use either of the following methods to install it:
Method 1: Using Server Manager Interface
  1. In the Server Manager interface, select Add Features to displays a list of possible features.
  2. In the Select Features interface, expand .NET Framework 3.5.1 Features.
  3. Once you expand .NET Framework 3.5.1 Features, you will see two check boxes. One for .NET Framework 3.5.1 and other for WCF Activation. Check the box next to .NET Framework 3.5.1 and click Next.
    Note: If you do not expand .NET Framework 3.5.1 Features and check it, you will get a pop-up titled Add Features Wizard  as shown below.
    Click Cancel and expand .NET Framework 3.5.1 Features and then check .NET Framework 3.5.1 check box below it.
    You cannot install .NET Framework 3.5.1 Features unless the required role services and features are also installed.



  4. In the Confirm Installation Selections interface, review the selections and then click Install.
  5. Allow the installation process to complete and then click Close.
Method 2: Using PowerShell
  1. Click the Start button in the lower left hand corner of the display.
  2. Highlight All Programs and select Accessories
  3. Expand Windows PowerShell and right click Windows PowerShell and select Run as administrator. Click Yes on the User Account Control box.
  4. At the PowerShell command prompt, type the following commands, and then press ENTER after each command:
    • Import-Module ServerManager
    • Add-WindowsFeature as-net-framework
Note: A screenshot is shown below:





Thursday, August 4, 2011

Get pressed key in bash, works in VMware esx

 
Here is my last bash script, it gets the pressed key in bash, enjoy.
#!/bin/bash
 
 
function identify_key {
 
local key="$@"
local printable=""
 
case "$key" in
   "1b") echo "ESC ($key)";;
   "09") echo "TAB ($key)";;
   "1b 1b") echo "DOUBLE ESC ($key)";;
   "7f") echo "BKS ($key)";;
   "1b 5b 41") echo "UP ($key)";;
 
   "1b 5b 42") echo "DOWN ($key)";;
   "1b 5b 43") echo "RIGHT ($key)";;
   "1b 5b 44") echo "LEFT ($key)";;
 
   "1b 5b 47") echo "NUM5 ($key)";;
   "1b 5b 50") echo "PAUSE ($key)";;
 
   "1b 5b 31 7e") echo "HOME ($key)";;
   "1b 5b 32 7e") echo "INS ($key)";;
   "1b 5b 33 7e") echo "DEL ($key)";;
   "1b 5b 34 7e") echo "END ($key)";;
   "1b 5b 35 7e") echo "PGUP ($key)";;
   "1b 5b 36 7e") echo "PGDN ($key)";;
 
   "1b 5b 5b 41") echo "F1 ($key)";;
   "1b 5b 5b 42") echo "F2 ($key)";;
   "1b 5b 5b 43") echo "F3 ($key)";;
   "1b 5b 5b 44") echo "F4 ($key)";;
   "1b 5b 5b 45") echo "F5 ($key)";;
   "1b 5b 31 37 7e") echo "F6 ($key)";;
   "1b 5b 31 38 7e") echo "F7 ($key)";;
   "1b 5b 31 39 7e") echo "F8 ($key)";;
   "1b 5b 32 30 7e") echo "F9 ($key)";;
   "1b 5b 32 31 7e") echo "F10 ($key)";;
   "1b 5b 32 33 7e") echo "F11 ($key)";;
   "1b 5b 32 34 7e") echo "F12 ($key)";;
 
   "1b 1b 5b 5b 41") echo "ALT+F1 ($key)";;
   "1b 1b 5b 5b 42") echo "ALT+F2 ($key)";;
   "1b 1b 5b 5b 43") echo "ALT+F3 ($key)";;
   "1b 1b 5b 5b 44") echo "ALT+F4 ($key)";;
   "1b 1b 5b 5b 45") echo "ALT+F5 ($key)";;
   "1b 1b 5b 31 37 7e") echo "ALT+F6 ($key)";;
   "1b 1b 5b 31 38 7e") echo "ALT+F7 ($key)";;
   "1b 1b 5b 31 39 7e") echo "ALT+F8 ($key)";;
   "1b 1b 5b 32 30 7e") echo "ALT+F9 ($key)";;
   "1b 1b 5b 32 31 7e") echo "ALT+F10 ($key)";;
   "1b 1b 5b 32 33 7e") echo "ALT+F11 ($key)";;
   "1b 1b 5b 32 34 7e") echo "ALT+F12 ($key)";;
   "") echo "SPACE or INTRO";;
   *) # check if it's ALT+xx
      if [ ${#key} -gt 2 ] && [ "${key:0:2}" == "1b" ]; then
         # if string length greather than 2 and starts by Escape (1b)
         printable="\x"${key:3}   # erases the starting '1b ' 
         printf "ALT+%b (%s)\n" "$printable" "$key"
      else
         printable="\x"$key
         printf "%b (%s)\n" "$printable" "$key"
      fi
      ;;
esac
}
 
 
 
function key_5b {
# process '1b 5b ...' keys and return values
 
  local key=$1
  local keyA=""
  local keyB=""
  local keyC=""
 
  keyA=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
  case "$keyA" in
     "31" | "32" | "33" | "34" | "35" | "36") # Must read the following key
             read -rsn1 -t 1 key   # Wait 1 second max for next key
             if [ "$key" == "" ]; then
                # 'ESC + [ + A|B|C|....F' keys pressed (very fast)
                 echo "$keyA"
             else
                 keyB=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
                 if [ "$keyB" == "7e" ]; then
                    # got '~', uses to be the last key so return "XX 7e" where XX is [31|32|33|34|35|36]
                    echo "$keyA $keyB"
                 else
                    read -rsn1 -t 1 key   # Wait 1 second max for next key
                    if [ "$key" == "" ]; then
                       # 'A|B|C|....F + XX' keys pressed (very fast)
                       echo "$keyA $keyB"
                    else
                       keyC=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
                       # max depth level, so return
                       echo "$keyA $keyB $keyC"
                    fi
                 fi
              fi
              ;;
        "5b") # read another key and return (uses to be F1 ... F5 keys) '1b 5b 5b [41|42|43|44|45]'
              read -rsn1 -t 1 key   # Wait 1 second max for next key
              keyB=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
              echo "$keyA $keyB"
              ;;
           *) # Uses to be UP or other arrow keys '1b 5b [41|42|43|44]' so return
              echo "$keyA"
              ;;
  esac
}
 
 
 
function getkey {
  local key=""
  local key1=""
  local key2=""
  local key3=""
  local key4=""
 
oldifs="$IFS"
IFS=" "
 
 
  read -rsn1 key
  key1=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
  if [ "$key1" == "1b" ]; then
     read -rsn1 -t 1 key   # Wait 1 second max for next key
     if [ ! "$key" == "" ]; then
        key2=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
        case "$key2" in
           "1b") # it could be a double ESC or an ALT+Fx key
                 read -rsn1 -t 1 key   # Wait 1 second max for next key
                 if [ "$key" == "" ]; then
                    # "1b 1b" 'ESC' key pressed 2 times (very fast)
                    echo "$key1 $key2"
                 else
                    # "1b 1b ..." Uses to be ALT+F? key pressed
                    key3=`echo -n "$key" |  hexdump -ve '1/1 "%.2x\n"'`; key=""
                    if [ "$key3" == "5b" ]; then
                       read -rsn1 -t 1 key   # Wait 1 second max for next key
                       if [ "$key" == "" ]; then
                          # "1b 1b 5b" 'ESC + ESC + [' keys pressed (very fast)
                          echo "$key1 $key2 $key3"
                       else
                          echo "$key1 $key2 $key3 $(key_5b $key)"
                       fi
 
                    else
                       # Unknown key '1b 1b XX' so return
                       echo "$key1 $key2 $key3"
                    fi
                 fi
                 ;;
           "5b") # Several posibilities "1b 5b ..."
                 read -rsn1 -t 1 key   # Wait 1 second max for next key
                 if [ "$key" == "" ]; then
                    # "1b 5b" 'ESC + [' keys pressed (very fast)
                    echo "$key1 $key2"
                 else
                    echo "$key1 $key2 $(key_5b $key)"
                 fi
 
                 ;;
              *) # ESC + Other key pressed (very fast) or ALT+xx
                 echo "$key1 $key2"
                 ;;
        esac
     else
        # ESC key pressed
        echo "$key1"
     fi
  else
     echo "$key1"
  fi
 
IFS="$oldifs"
  return 0
}
 
 
while true
do
  echo "----------------------------"
  tecla=$(getkey)
  identify_key $tecla
done