Thursday, January 18, 2007

Problems upgrading ESX 3.0 to 3.0.1

Hi,

Upgrading ESX 3.0 to ESX 3.0.1 with a remote repository is not really working for me.
Found a very helpfull post on http://www.vmug.nl/

Seems that it's better to upgrade yum-2.0.7-3vmw.noarch.rpm and VMware-esx-scripts-3.0.1-32039.i386.rpm manually first and then do the esxupdate. Vmware-Esx-Scripts contains the esxupdate script itself, and that script seems to use yum.

The way to do it : Go into the 32039 directory, as root and type :
1) rpm -Uvh yum-2.0.7-3vmw.noarch.rpm
2) rpm -Uvh VMware-esx-scripts-3.0.1-32039.i386.rpm
3) esxupdate -f update

Tuesday, January 16, 2007

Vmware ESX 3 patch updates through FTP ...

Hi,

Allthough we only have four ESX-servers for the moment I tried to make a ftp-repository for all ESX-patches. I put the FTP-server on my virtual center server. But it didn't work proporly, I allways got this error :

# esxupdate -r ftp://172.28.247.223/dslib/ESX-1006511 update
INFO: Configuring...
INFO: Preparing to install VMware ESX Server ESX-1006511...
ERROR: Error (1) executing [yum info] retrygrab() failed for: ftp://172.28.247.223/dslib/ESX-1006511/headers/header.info
Executing failover method failover: out of servers to try Error getting file ftp://172.28.247.223/dslib/ESX-1006511/headers/header.info[Errno 6]
ERROR: Url Return no Content-Length - something is wrong
Gathering header information file(s) from server(s) Server:
Esxupdate-compatible repository for VMware ESX Server ESX-1006511

After some google-ing I found this procedure:

  • Login to the service console as root
  • Change directory to /usr/share/yum
  • Make a backup copy of urlgrabber.py (IMPORTANT) cp urlgrabber.py urlgrabber.py.BAK
  • Edit urlgrabber.py and find the following lines:

    if have_urllib2 or scheme != 'file':
    # urllib does not provide content-length for local files
    if not hdr is None and not hdr.has_key('Content-Length'):
    raise URLGrabError(6, _('ERROR: Url Return no Content-Length - something is wrong'))
  • Comment them out (Add a '#' at the beginning of the line):

    # if have_urllib2 or scheme != 'file': #
    # urllib does not provide content-length for local files
    # if not hdr is None and not hdr.has_key('Content-Length'):
    # raise URLGrabError(6, _('ERROR: Url Return no Content-Length - something is wrong')) Try the esxupdate command again..

  • Then try the esxupdate again

Friday, January 12, 2007

ESX 3.0 can use datastores on NFS and Windows R2 is NFS-capable out of the box ...

Hi,

Yesterday I had the idea to make an NFS-share on my Virtual Center server. I would like to use it as a repository for ISOs and VM-Templates to make it easier for Windows Admins to upload ISOs to a Virtual Infrastructure. If this works they only need to copy their ISOs to the right location on the Virtual Center server and all ESX's have automatically access to the ISOs, floppies, ... No hassle with sftp, accounts on the ESX, ...

As my VC is a Windows 2003 R2 I could just install NFS by using "Add/Remove Windows Components". It's a build-in feature now.

First try :
I installed the NFS components, shared a folder, with NFS's standard settings, and made the NFS-links in Virtual Center on every ESX-box.
Everything looks good but the connection wasn't really stable. Copying large files always failed.

Second try :
I found some info on the web to adjust a few settings on the windows side :
  • Anonymous UID: 2 (instead of the std -2)
  • Anonymous GID: 0 (instead of the std -2)

Next step for me will be to secure this, although everything is in a private VLAN, I would like to have some access control ...

Sunday, January 7, 2007

Change TSprofile for a lot of users ...

Recently I had to change a lot of user's TS-profile settings, I wasn't able to do it with GPO's because I had to deal with W2k Citrix Servers so I tried to use the TSprof.exe-tool but that didn't work also because I had a %-sign in the TS-profile. The %value% was directly translated and only the result was saved in the user property, so I made a little VB-program using Visual Basic Express Ed. to do the job, ... (code and .exe included)

You can use it this way :

Changes tsprofilepaths of users listed in file.
Usage : UpdateTSprofile -s:[servername] -f:[path/file] -p:[tsroamingprofilepath]

-h help, shows this info
-s:[servername] domaincontroller to connect to
-f:[path/file]
file path with users to update format should be one domain\user a line

-p:[tsroamingprofilepath]
path to tsroamingprofilepath if this contains % replace % with ?

Caution : Existing TS-profile Value's will be replaced

Saturday, January 6, 2007

My first article ...

My first article ... Not sure where this will go but we will see what the future brings. I will try to put some professional experiences here ...
For example last week I was confronted with a few ESX-servers installed with tiny partitions, and no separate partition for /var/log ...
A best practice should be to provide a separate partition for /var or /var/log.But of course if it's installed this way you have to live with it ...
I used a standard feature of most Linux/Unix machines that is also included in ESX 2.5/3.0 : "logrotate" ...
Here the procedure :


On ESX servers there should be separate partitions for /var and/or /var/log, if those partitions are to small or integrated in to the "/"-partition it can destabilize the ESX-server.

To adjust the automatic logrotate/Cleanup please use this procedure :

  1. SSH-logon to the ESX-server
  2. su to get root permissions
  3. vi /etc/logrotate.conf --> changes are in red

    # see "man logrotate" for details
    # rotate log files weekly
    weekly
    # keep 4 weeks worth of backlogs
    rotate 2
    # create new (empty) log files after rotating old onescreate
    # uncomment this if you want your log files compressed
    compress
    # RPM packages drop log rotation information into this directoryinclude /etc/logrotate.d
    # no packages own lastlog or wtmp -- we'll rotate them here
    /var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
    }
    # system-specific logs may be also be configured here.

  4. vi /etc/logrotate.d/vmkernel --> changes are in red

    /var/log/vmkernel {
    missingok
    compress
    # keep a history over 3 years.
    weekly
    rotate 2

    # max log size of 200k (thus limiting total disk usage to under 8megs)
    size 100k
    sharedscripts
    postrotate
    /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null true
    endscript
    }

  5. run this command : "/usr/sbin/logrotate -f /etc/logrotate.conf"
  6. go to the /var/log dir and cleanup, a last time manually, all log-files with an extension greater or equal then .2
  7. exit