GeneralTech.Info
BLOG.GENERALTECH.INFO

VMware ESXi 4 in a Box

Check out this video from Duane Davis' Site.   Its a great video.   Here is the link:

http://www.vmwarevideos.com/running-vmware-esxi-4-vsphere-in-vmware-workstation-video.

EasyVMX and VMware Player

EasyVMX is another low cost method of creating the necessary files to run a virtual machine.   All you need is the iso file and vmware player to begin evaluating another product.  

Mount a VMDK File in Linux

VMware has a method to mount a VMDK File in Linux.   This is an executable called vmware-mount.   Its located in the /usr/bin.   It allows you to modify VMDK File after you mount it into a filesystem within Linux.     Here is the information about the utility and the options:

VMware DiskMount Utility version 6.5.2, build-156735

Usage: ./vmware-mount diskPath [partition num] mountPoint
       ./vmware-mount [option] [opt args]

There are two modes for mounting disks.  If no option is
specified, we mount individual partitions from virtual disks
independently.  The filesystem on the partition will be
accessible at the mount point specified.

The -f option mounts a flat representation of a disk on a
user-specified mount point.  The user must explicitly unmount
the disk when finished.  A disk may not be in both modes at once.

diskID is an identifier of the form username@hostname:/path/to/vm
for remote disks and just the path for local disks.  Options that
mount a remote disk also require -h -u -F and optionally -v options.
The -v option is required when connecting to a Virtual Center.

Options: -p <diskID>      list all partitions on a disk
         -l <diskID>      list all mounted partitions on a disk
         -L               list all mounted disks
         -d <mountPoint>  cleanly unmount this partition
                          (closes disk if it is the last partition)
         -f <diskPath> <mountPoint> mount a flat representation of the disk
                          at "mountPoint/flat."
         -k <diskID>      unmount all partitions and close disk
         -K <diskID>      force unmount all partitions and close disk
         -x               unmount all partitions and close all disks
         -X               force unmount all partitions and close all disks
Options for remote disks:
         -v                inventory path of the vm
         -h                hostname of remote server
         -u                username for remote server
         -F                file containing password
         -P                optional TCP port number (default: 902)

VMware Workstation Technology Beta

If you were one of the lucky few to get an invite.   VMware Workstation gives some new features to look forward to when its released.   It will be worth the upgrade.    I have been running it in a Production environment for a while now.   For a beta, its a very stable product.    I hope they will release it soon so that everyone will enjoy the new features.

Have you ever wanted to speed up Boot-up Times in VMware Workstation

I found the following vmx parameter off of Ulli's website (http://sanbarrow.com).   The vmx parameter is bios.bootDelay = "5000".  The lower the number the faster it boots.  It's a fantastic site and highly recommended it to anyone.  I am quite sure it will work in VMware ESX as well.

  


Low Cost iSCSI Target on Ubuntu Linux

The reason I called it low cost is because you still have to pay for the hardware.   Here are the steps creating an iscsitarget.   It works with Windows XP.    I will have to test it with ESX, Linux, Windows 2003 and Windows 2008.   Here are the steps:

1) Install Ubuntu 9.04 onto your workstation
2) Partition your drive according:

      first primary partition         -  /boot filesystem 200MB
      second primary partition  - 1GB Swap
      third primary parition        -  /        filesystem 20GB
  
      Of course the partitioning of your drive is completely at your discretion.

3) Open a terminal session and login as root (su -).
4) Type fdisk -l
5) Type fdisk /dev/<your disk>
     Use the following options:
            n <enter> - create new partion
            p <enter> - set partition type to primary
            4 <enter> - set partition number to 4
            Hit <enter> twice to accept the default for the beginning and ending of the drive or cylinder.   Whichever you choose.
            w <enter> - write the partition table.
6)  Type partprobe - this will reinitialize the partition table without rebooting
7)  Type pvcreate /dev/sda4 - Creates the LVM Partition Volume on the physical drive
8)  Type vgcreate vg1 /dev/sda4 - Creates the LVM Volume Group
9)  Type lvcreate  -L 100GB -n data1 vg1 - Creates a Logical Volume on the drive
10)  Go To System > Synaptic Package Manager
11)  Type in the sudo user
12)  Search for iscsitarget and install
13)  Type in sudo gedit /etc/default/iscsitarget.   Enable the iscsi target by changing the first line to ISCSITARGET_ENABLE=true
14)  Of course you can change the other options if your environment calls for it.  Type in sudo gedit /etc/ietd.conf.                                                  Change the following lines:
                 Lun 0 Path=/dev/vg1/sandata,Type=fileio - You can have multiple luns and change the path
                 MaxConnections        3 -  You can change the number to any number
15) Restart the iSCSI Target - /etc/init.d/iscsitarget restart

You should now able able to cluster using any using Linux, Windows 2003/2008, Netware and VMware ESX.

Enjoy!!!!!

Companies such as Starwind and Datacore still have there place.   They make really good products but they are costly.



              


         

VI3 in a box for Practice

If you taken the course and need to practice, check out the Sid Smith's site.   His site is called the daily hypervisor (http://dailyhypervisor.com).   With his assistance,  I was able to get this configured.   I used the following software packages:
VMware Workstation 6.5.2 for Linux, Windows XP, Windows 2003, VMware ESX 3.5 Update 3, VMware Virtual Center and Starwind's iSCSI Target Software.   It was easy after looking at his instructions and its quite cool.   Just remember, before you launch ESX Virtual Machines use the chmod linux command to grant enough permissions to make the virtual networks run correctly.   Everything else should be quite easy.   I will have more details in future postings.

eDirectory Mass Change Scripts

Sorry its been so long, but its been quite busy of late.   However, recently I was tasked with the disablement of accounts in eDirectory.   I wrote a Perl Script that accomplished that goal.   Considering it was my first Perl Script, it went quite well.   You must use a Linux Box to do this.   Make sure you get the right certificate from the CA.    You need both the Public\Private key not the self signed certificate from the CA

Here it is:

#!/usr/bin/perl -w

$server = "192.168.1.100";
$port = "389";
$admin = "cn=admin,o=montefiore";
$pw = "password";

use Net::LDAP;
use Net::LDAPS;
use Net::LDAP::Entry;
use Net::LDAP::Util qw(ldap_error_name ldap_error_text);

$a = $server.$port; $a = $a;

$ldap = Net::LDAP->new('192.168.1.100', version => 3);

if (defined($ldap))
{
 print "ldap OK\n";
}
else
{
 die "Could not get ldap:$!\n";
}

$mesg = $ldap->start_tls(
   verify => 'require',
   cafile => 'monteca.pem',
#   clientcert => 'servercert.pem',
#   clientkey  => 'serverkey.pem',
#   keydecrypt => sub { 'simple';},
   capath => '/home/lturkin/scripts'
     );

if (defined($mesg))
{
 
 my $mcode = $mesg->code();
 if ($mcode)
 {
  my $merr = ldap_error_name($mcode);
  my $txtmsg = ldap_error_name($mcode) .":".ldap_error_text($mcode);
  die "Error with start_tls:$txtmsg\n";
 }
 else
 {
  print "start_tls seems OK\n";
 }
}
else
{
 print "mesg not defined\n";
}

print "Subject DN: " . $ldap->certificate->subject_name ."\n";

$mesg = $ldap->bind($admin, password => $pw);

if (defined($mesg))
{
 
 my $mcode = $mesg->code();
 if ($mcode)
 {
  my $merr = ldap_error_name($mcode);
  my $txtmsg = ldap_error_name($mcode) .":".ldap_error_text($mcode);
  die "Error with bind:$txtmsg\n";
 }
 else
 {
  print "bind seems OK\n";
 }
}
else
{
 print "mesg not defined after bind\n";
}

open (DATA, "attributes.txt") or die "an error occured: $!";

while (defined($line = <DATA>)
{
 chop $line;
 ($field1,$field2,$field3,$field4) = split'#', $line;
 print "$field1,$field2,$field3,$field4\n";
 $mesg = $ldap->modify("$field1",
   add => [
    "loginExpirationTime" => "$field2",
    "Description" => "$field4"]);

}
close (DATA);
          

if (defined($mesg))
{
 
 my $mcode = $mesg->code();
 if ($mcode)
 {
  my $merr = ldap_error_name($mcode);
  my $txtmsg = ldap_error_name($mcode) .":".ldap_error_text($mcode);
  die "Error with Modification:$txtmsg\n";
 }
 else
 {
  print "Modification seems OK\n";
 }
}
else
{
 print "mesg not defined after modification\n";
}

$mesg = $ldap->unbind;

Sharing Files between a MAC OS and a Windows PC

Last weekend, a friend of mine presented me with a challenge.   He wanted to share files between a MAC and a Windows PC.   He wanted a cheap solution.   He already had a PC with Pentium III, 512MB of RAM, 250GB HDD and a Intel NIC.   The answer was simple and told him that it was free.   He was pleased with the solution.   I told him that I would setup a Linux Samba Server.   He was excited.   I went to openSUSE.org and downloaded the lastest revision.   Within one hour, I had the solution implemented.   I used the following steps:

1)  Downloaded the ISO File and burned it to a DVD

2)  Installed openSUSE 11.1 as a file server

3)  Configured Samba on a separate mount point from the root partition.    Its important not to use the root partition because you never want to run out of space.

4)  Testing.

Of course,  I am just giving a simple installation guide, but I will give more details in the next posting.    Instead of throwing away an old PC, you can extend the life of it.
  

Welcome to GeneralTech.Info

The purpose of this blog is to discuss certain aspects of technology.  My postings will discuss operating systems, virtualization, mail servers, and scripting.   Please feel free to leave comments about my postings.    Hopefully, I will become friends with many of you.   I look forward to hearing from you soon.

 

Blog Software