How to manage iSCSI targets with PowerCLI part 2


In part 2 of this series I will show how to remove iSCSI targets with PowerCLI.

But first, let’s see which targets are configured on vSphere host esx2.ict-freak.local:

$esx = Get-VMHost "esx2.ict-freak.local"
Get-IScsiHbaTarget -IScsiHba ($esx | Get-VMHostHba -Type iScsi | Where {$_.Model -eq "iSCSI Software Adapter"})

The following targets are configured:

image

In this post I want to show you how to remove the target with PowerCLI. So I opened the vSphere PowerCLI Cmdlets Reference and searched for the Remove-IScsiHbaTarget. On this page you’ll find the following examples:

————– Example 1 ————–

Get-IScsiHbaTarget -Address 10.23.84.73 -Type Send | Remove-IScsiHbaTarget

Retrieves and removes the targets of type Send on the specified address.

————– Example 2 ————–

Remove-IScsiHbaTarget -Target (Get-IScsiHbaTarget -Address 10.23.84.73)

Removes the specified iSCSI HBA targets.

Unfortunately this example doesn’t work because the –Address parameter doesn’t exist in VMware vSphere PowerCLI 4.1 build 264274.

Continue reading

How to manage iSCSI targets with PowerCLI part 1


In part 1 of this series I want to show some basic reporting and how you can add a single target and multiple targets to your vSphere hosts. Let’s start with a simple script to report all the targets on all your vSphere hosts:

$esxHosts = Get-VMhost
foreach($esx in $esxhosts){
$hba = $esx | Get-VMHostHba -Type iScsi 
    Write-Host "=========================================="
    Write-Host "iSCSI Targets on $esx"
    Write-Host "=========================================="
    Get-IScsiHbaTarget -IScsiHba $hba -Type Send | Sort Address
    Write-Host " "
}

The following output will be generated:

image

Continue reading

CentOS: How To Create a Local VMware Repository


image_thumb1[1] image_thumb[1]

The first step is to configure the repository server. Before you can start, you have to install the createrepo package. Just run the following command:

yum install createrepo

If you didn’t already, also install Apache on the Server that’s hosting the repository.

Let’s create a folder structure so we can place the rpm’s on the server. In case you want create a repository for 32 bit and 64 bit CentOS. You have to create a i386 and a x86_64 directory.

i368:

/var/www/html/repo/centos/5/i386/vmware

Upload your rpm files to the vmware directory and run the createrepo command:

createrepo /var/www/html/repo/centos/5/i386/vmware/

x86_x64

/var/www/html/repo/repo/centos/5/x86_64/vmware

Upload your rpm files to the vmware directory and run the createrepo command:

createrepo /var/www/html/repo/centos/5/x86_64/vmware/

The next step is to test the repository. Just open your favorite web browser and browse to the url. In my case this is: http://distribution.ict-freak.local/repo/centos/5/i386/vmware.

image

If this works, your local vmware repository is ready for action. But first we need to add the repository on the client side.

Open the following file in your favorite text editor

/etc/yum.repos.d/vmware_local.repo

Add the following lines and edit the baseurl so it will match your environment.

[vmware_local]
name=Uniserver CentOS-$releasever-$basearch
baseurl=http://distribution.ict-freak.local/repo/centos/$releasever/$basearch/vmware/
gpgcheck=0
enabled=1

Save the vmware_local.repo file and run the yum update command.

image

Now you’re ready to install packages from the vmware_local repository. Let’s install VMware server 2.0.2-203138 by running the following command:

yum install VMware-server

The install process will start:

image

When you also upload the VMware Tools rpm file, you can install or update the package with the following commands:

Install:

yum install VMwareTools

Update:

yum update VMwareTools

When you need to upgrade de VMware Tools, the only thing you have to do is upload the new rpm file and run the yum update command. The finals step is to run the vmware-config-tools.pl script. But this step can be replaced by the check-vmware-tools script. More info about this script can be found here: http://bit.ly/97fpcD

How To: Install VMware Tools on CentOS 5.3


image image

The first step after a fresh install of a CentOS 5.3 server is too install the packages gcc and kernel-devel. When these packages are installed, update them and reboot of the VM:

yum install gcc kernel-devel –y
yum update –y
reboot

Now we have to create a new folder so we can mount the VMware Tools cd-rom.

mkdir /media/cdrom –p

Start the VMware Tools Installer via the GUI:

image

Mount the cd-rom:

mount /dev/cdrom /media/cdrom

create a folder and copy the tar.gz file from the cd-rom to the folder:

mkdir /root/tarz –p
cp /media/cdrom/VMwareTools-4.0.0-xxxxxx.tar.gz /root/tarz/

Open the folder and extract the tar.gz file:

cd /root/tarz
tar zxvf VMwareTools-4.0.0-xxxxxx.tar.gz

Open the vmware-tools-distrib folder and start the installer:

cd vmware-tools-distrib
./vmware-install.pl

You can change the vnic to vmxnet via the following commands:

/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start

The final step is to reboot the VM.

How To: Create an ESXi USB Key


image

In this short tutorial you’ll learn how to create an ESXi USB Key.

Before we start you need the following tools:

  • 7-Zip
  • Winimage
  • VMware ESX 3i installer CD

After installing the tools we need to extract the *.dd file. Open the VMware-VMvisor-InstallerCD-3.5.0_UpdateX-XXXXXX.i386.iso with 7-Zip. Right click on install.tar and press Open Inside. Remember the Ctrl+PgDn shortcut.

image

Open usr\lib\vmware\installer. Select VMware-VMvisor-big-3.5.0_Update_4-153875.i386.dd.bz2 and press Ctrl+PgDn again.

Extract the VMware-VMvisor-big-3.5.0_Update_4-153875.i386.dd file.

 

Now we have the *.dd file and we can write it back to an USB Key.

Open WinImage and pres Disk followed by Restore Virtual Hard Disk image on physical drive…

image

Select the USB Key. In my case it’s a SanDisk Cruzer.

image

Open de *.dd file and answer Yes on the LAST WARNING.

image

When the wizard completes without an error. The USB Key is ready to use.

 

Update:

if you’re running Windows Vista or Windows 7 x64 you might get an error like this:

image

If someone knows a solution for this problem please leave a comment. If you run this tutorial on a Windows XP machine, it will work as expected.

How To: Install Webmin on Ubuntu 8.04


image

This post is an upgrade to an earlier post from September 2006.

Before you can install Webmin, you have to install some other packages first:

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

Go to the /tmp dir

cd /tmp

Download the deb file via wget:

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.450_all.deb

The final step:

sudo dpkg -i webmin_1.450_all.deb

/tmp$ sudo dpkg -i webmin_1.450_all.deb
Selecting previously deselected package webmin.
(Reading database … 38179 files and directories currently installed.)
Unpacking webmin (from webmin_1.450_all.deb) …
Setting up webmin (1.450) …
Webmin install complete. You can now login to https://server:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

Open your favorite browser and go to: https://server:10000/

image

EMC: Celerra Virtual Appliance and VI3


image

De virtualgeek is bezig met een howto serie over het configureren van de Celerra Virtual Appliance. Deze appliance kun je impoprteren binnen VMware Workstation of ESX server. Hoe dit in zijn werk gaat lees je in de volgende posts:

In de toekomst gaat EMC meer Virtual Appliances aanbieden van haar overige producten. Let wel op deze  appliances zijn alleen bedoeld voor test en studie doeleinden.

VMware heeft ook een document uitgegeven. De pdf kun je hier vinden: VMware_VI3_and_EMC_Celerra_IP.pdf