Archive

Posts Tagged ‘Virtualisation’

Purging old data from the database used by vCentre Server 4.x (2.5 also included)

February 14, 2011 Leave a comment

We had a failed VC today – seems our client managed to fill the SQL database and fill the storage.
It is a physical host, so expanding the disk is not so easy.

Time to clear the VC database up . .

Luckily, VMware have posted the how-to for this one (as they did before for 2.5)

The details are pretty thorough . . just watch out to make sure you stop your VC service before running this (and if you can, back up your database as you’ll be purging data from the database)

Linky here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1025914

Note: Do not run the scripts attached to this article against a VirtualCenter 2.x database. For information about purging data in VirtualCenter 2.x, see
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000125

Categories: VMWare Tags: ,

VMUG London Lowdown

February 11, 2011 Leave a comment

So,

I attended the VMUG in London yesterday. Unfortunately I missed the Enterprise round table, to sit on Alan Renouf’s PowerCLi session.
the session was pretty handy in terms of getting me to revert to the PowerCli again, but an hour is just not enough time to get your teeth fully stuck in – his focus was reporting (which I guess makes sense, as he’d hardly want us, deleting, configuring and moving things round in his lab – which he generously shared)
Either way, the hands on labs were a good opportunity to network with other local professionals.

Alaric did a great job of entertaining us as MC – (ask him about his juvenile moment and variable names next time you see him)

Warren Oliver from Veeam really lives and breathes his product. I had a chat with him at break time and have had him in my office a few times. he really is an asset to the company – I like what Veeam do, I like their product and like their attitude. You’ll have seen several references to their tools in my previous bloggings . .and you will see more as we currently rolling Veeam vPower out at a big client site (see you in 2 weeks Warren)

either way, the presentation was humorous, but professional and entertaining – the product looks amazing (I guess we know it is . . considering all the awards they have received at VMworld etc?)

As sponsors, they did a great job too – including donating an iPad as a prize (the usual business card draw . . I need to get myself some business cards . .)

Scott’s chat on certification was very handy – saved me doing a bunch of web trawling. (I will be going for a VCDX later this year . . though not because I want the certification, but rather because I like the appeal of building a design for something then having to defend it – thus testing my own knowledge) – I will post as I get on – I have an idea for my design though – and I need to find out whether I will be allowed to publish details of this once I have completed my VCDX (it is info that I want the community to be able to use . . so a certain aspect of the VCDX design I’d like to have publicly shared)
Either way – thanks Scott.

I enjoyed Gabrie’s Budget DR talk. Oddly, it is something I have done myself before, using PowerCli and some Netapps replication. His approach is almost identical to the one I used (though my design was active/active and used a VC hosted on a VM on the non-production site) -= I’ll explain later, as I will blog my scripts in a thread call ‘DR on a shoestring’ – it will no doubt be similar to what Gabe presents, but at least give those of you who would like to try it an alternative approach (speaking of which . . I’ll need some ‘test pilots’ with alternative storage technologies to test drive my revised scripts once complete)

Steve’s cloud discussion (11th hour step in for an automation session that I was looking forward to) caught me off guard – I have been a little slow to get hooked on the cloud side of things, so it was a good eye opener – looking forward to ‘clouds’ at the next VMUG.

To finish, Chris Dearden (in a nice subtle, slightly off pink shirt) presented a humorous account of Transatlantic Data centre migration and how to (or not to) actually get it done.
Seems like they had a big project on their hands and did a reasonable job of getting it completed, considering the rather tight constraints that they had – good effort! – The last slot of the day is always the hardest (the iPad had already been given away and the morning caffeine worn off, but at the end of his presentation it seemed everyone was still awake . . an achievement in itself)

I missed the drink up afterwards (had no choice – one day family visit from the states!) – either way, once I have done DR on a shoestring . .who knows, I may present at a VMUG?

Thanks to everyone who helped organise and played apart . . looking forward to the 12th of May when we convene again.

 

#LONVMUG @LONVMUG

Categories: VMWare Tags: , , ,

VMWare user Group London

February 10, 2011 Leave a comment

The blog will be dead today – I am off to the VMWare User Group in London. – http://communities.vmware.com/message/1687182#1687182

our schedule is as follows:

10.00 – 12.00 Roundtable Strategy Session with Martyn Storey and Mark Stockham; Enterprise Management – optional (spaces limited)
11:00 – 12:00 PowerCLI session with Alan Renouf – optional
12:30 – 13:00 Arrive & Refreshments
13:00 – 13:20 Welcome & News (Alaric)
13:20 – 14:00 Sponsor presentation (Veeam Systems)
14:00 – 14:30 VMware Certification – Preparing for Success (Scott Vessey)
14:30 – 15:00 Cheap Disaster Recovery using PowerShell scripts (Gabrie van Zanten http://www.gabesvirtualworld.com/)
15:00 – 15:20 Refreshment break
15:30 – 16:00 Advanced vCenter Alarming and Automation (Simon Long, VMware)
16:00 – 16:30 Transatlantic Datacentre migration (Chris Dearden, JFVI)
16:30 – 16:45 Close
17:00 Pub

I’ll be attending the PowerCli session with Alan renouf . . though I am slightly grumpy that that means I’ll miss the RoundTable strategy meeting,

Of course I will feed back here with anything I learn (which no doubt will be a whole lot)
These VMUGs are a great opportunity to find out what is upcoming in the virtual world and to offer your 2 cents worth – check the VM communites, there is bound to be one near you : http://communities.vmware.com/community/vmug/findgroup

Categories: VMWare Tags: ,

Adding Datastores to ESXi Hosts that have already been built

February 9, 2011 Leave a comment

DAS

Datastore addition when other DAS already exists

When attaching storage such as a MSA70 to an ESX3i host, ESX will not

automatically format it or create the relevant partitions automatically.

This

can however be done from an SSH connection – using the following

instructions.

1. Log on to the console or use putty to connect to the ESX host remotely. If

you have not created a user for yourself you will not be able to log in through

putty.

2. SU to root. This must be done using the su

root command. If you do not use the – then you will not get root’s path and thus

get error messages that say that commands cannot be found.

3. Run fdisk -l. This will give you a list of all of your current partitions.

This is important because they are numbered. If you are using SCSI you should

see that all partitions start with /dev/sda# where # is a number from 1 to what

ever. Remember this list of number as you are going to be adding at least one

more and will have to refer to the new partition by it’s number.

4. Run fdisk /dev/sda. This will allow you to create a partition on the the

first drive. If you have more than one SCSI drive (usually the case with more

than one RAID container) then you will have to type the letter value for the

device you wish to create the partition on (sdb, sdc, and so on).

5. You are now in the fdisk program. If you get confused type "m" for menu.

This will list all of your options. There are a lot of them. You will be

ignoring most of them.

6. Type "n". This will create a new partition. It will ask you for the

starting cylinder. Unless you have a very good reason hit "enter" for default.

The program will now offer you a second option that says ending cylinder. If you

press enter you will select the rest of the space. In most cases this is what

you want.

7. Once you have selected start and end cylinder you should get a success

message. Now you must set the partition type or it’s ID. This is option "t" on

the menu.

8. Type "t". It will ask you for partition number. This is where that first

fdisk is useful. You need to know what the new partition number is. It will be

one more than the last number on fdisk. Type this number in.

9. You will now be prompted for the hex code for the partition type. You can

also type "L" for a list of codes. The code you want is "fb". So type "fb" in

the space. This will return that the partition has been changed to fb (unknown).

That is what you want.

10. Now that you have configured everything you want to save it. To do so

choose the "w" option to write the table to disk and exit.

11. Because the drive is being used by the console OS you will probably get

an error that says "WARNING: Re-reading the partition table failed with error

16: device or resource busy." This is normal. You will need to reboot.

12. To reboot the server type "reboot" at the prompt.

13. Once you have rebooted you can now format the partition VMFS. DO NOT do

this from the GUI. You must once again log into the console or remote in through

putty.

14. Once you have su’d to root you must type in "vmkfstools -C vmfs3

/vmfs/devices/disks/vmhba0:0:0:#" Were # is the number of the new partition. You

shoulder now get a "successfully created new volume" message. If you get an

error you probably chose the wrong partition. Do an fdisk – l and choose the

number with the "unknown" partition type. Note: IF you have more than one SCSI

disk or more than one container the first 0 may need to be a 1 as well.

15. Go to the GUI and in configuration/storage select refresh. You should now

see your new VMFS volume.

Categories: VMWare Tags: ,

Enabling SSH on ESXi

February 8, 2011 Leave a comment

Info below copied from : http://www.vm-help.com

By default SSH is not enabled on ESXi – though every time you log a call with VMWare, the first thing that they do (of course) is ask you to enable it?

To enable SSH, do the following:

1) At the console of the ESXi host, press ALT-F1 to access the console window.
2) Enter unsupported in the console and then press Enter. You will not see the text you type in.
3) If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4) You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5) Find the lines that begins with #ssh and remove the #. Then save the file. If you’re new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file. Note: there are two lines for SSH with ESXi 4.0 now – one for regular IP and the other for IPv6. You should
6) Once you’ve closed the vi editor, you can either restart the host or restart the inetd process. To restart inetd run ps | grep inetd to determine the process ID for the inetd process. The output of the command will be something like 1299 1299 busybox inetd, and the process ID is 1299. Then run kill -HUP <process_id> (kill -HUP 1299 in this example) and you’ll then be able to access the host via SSH.

Tip – with some applications like WinSCP, the default encryption cipher used is AES. If you change that to Blowfish you will likely see significantly faster transfers.

Changing the port for SSH

To change the port for SSH, edit the file /etc/services and change the SSH port listed in the file. Save the file and repeat step 6 above.

Enable Telnet

The steps are the same as with SSH, but you’ll remove the # from the 2 telnet entries in /etc/inetd.conf. Enabling telnet is not recommended if security is a concern.

Enable SSH access for a non-root account

Use the following process to enable SSH access for a non-root account
1) Access SSH or the console with a root account.
2) Create a new account with the command useradd <account_name> -M -d/ . This will set the home directory to / instead of requiring a /home directory.
3) Use the command passwd <account_name> to set the password for your new login.
4) Edit the passwd file with vi /etc/passwd. For the entry for your new account, change the /bin/sh part to /bin/ash. Save the file and exit. See the example for the test1 user below.

root:x:0:0:Administrator:/:/bin/ash
nobody:x:99:99:Nobody:/:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/:/sbin/nologin
dcui:x:100:100:DCUI User:/:/sbin/nologin
daemon:x:2:2:daemon:/:/sbin/nologin
vimuser:x:12:20:vimuser:/sbin:/sbin/nologin
test1:x:500:500:Linux User,,,:/:/bin/ash

You should now be able to connect with SSH using this new account.

Disable SSH access for the root account

If you have created non-root accounts for SSH access you can also disable root access via SSH. Edit the /etc/inetd.conf file using the initial process on this page and add the option -w after the -i option. The line in inetd.conf will appear similar to the below.

ssh stream tcp nowait root /sbin/dropbearmulti dropbear ++min=0,swap,group=shell -i -w -K60

One you have made the change, save the file and run the kill -HUP command to restart the inetd process. You will now be able to login with a non-root account, but will get access denied if you use a root account. Once you have established a SSH session with your non-root account you can issue the command su – to switch to the root account.

Script of the Day – shutdown your VMware ESX estate with PowerCLI

February 7, 2011 Leave a comment

The following script is straight from
http://www.virtu-al.net/2010/01/06/powercli-shutdown-your-virtual-infrastructure/

I have used it a few times and it is very effective and easy to use.


Connect-VIServer MyVIServer

# Get All the ESX Hosts
$ESXSRV = Get-VMHost

# For each of the VMs on the ESX hosts
Foreach ($VM in ($ESXSRV | Get-VM)){
# Shutdown the guest cleanly
$VM | Shutdown-VMGuest -Confirm:$false
}

# Set the amount of time to wait before assuming the remaining powered on guests are stuck
$waittime = 200 #Seconds

$Time = (Get-Date).TimeofDay
do {
# Wait for the VMs to be Shutdown cleanly
sleep 1.0
$timeleft = $waittime - ($Newtime.seconds)
$numvms = ($ESXSRV | Get-VM | Where { $_.PowerState -eq "poweredOn"}).Count
Write "Waiting for shutdown of $numvms VMs or until $timeleft seconds"
$Newtime = (Get-Date).TimeofDay - $Time
} until ((@($ESXSRV | Get-VM | Where { $_.PowerState -eq "poweredOn" }).Count) -eq 0 -or ($Newtime).Seconds -ge $waittime)

# Shutdown the ESX Hosts
$ESXSRV | Foreach {Get-View $_.ID} | Foreach {$_.ShutdownHost_Task($TRUE)}

Write-Host "Shutdown Complete"

BE WARNED – IF YOU TEST THIS ON YOUR LIVE ENVIRONEMT, YOU’RE GOING TO GET IN TROUBLE!!!!

Copying VMware Network config / Port Groups

February 7, 2011 Leave a comment

How often do you need to duplicate the port group config from one ESX host to another – easy if you can use Host Profiles . . but maybe you are not licensed for it?

I found a great (FREE . . the best type) tool for this:

http://www.vladan.fr/itq-vlan-and-portgroup-manager-free-utility/

The author is Flores Eken from ITQ Consultancy in the Netherlands. He is a VMware SDK programmer. He wrote this application in C# based on the new ESX3.x /VC2.x SDK, but it works in ESX 4

you can download it at :

http://www.run-virtual.com/files/ITQ-VI-Setup.msi