Showing posts with label vmware. Show all posts
Showing posts with label vmware. Show all posts

Thursday, August 19, 2010

Installing VMtools on a Binnami Redmine appliance

Here's how to install VMtools into a Redmine bitnami appliance, running OpenSuse 11.1.

1. Use "zypper" (the OpenSuse equivalent of aptget) to install the following packages...

1. "zypper install tar, make, gcc, linux-kernel-headers, linux-sources

2. Use the VIclient to right-click the Redmine appliance, and select "Install VMtools"

3. Then just mount the virtual CD that includes vmtools, and install the rpm.

1. "mkdir /mnt/virtual"

2. "mount /dev/cdrom /mnt/virtualcd"

3. "ls /mnt/virtualcd"

4. "rpm -ivh VMwareTools-1.0.3-44356.i386.rpm"

5. Reboot ("shutdown -r now")

6. "vmware-config-tools.pl -default"

After the installer completes, open the VMware Infrastructure Client and verify that Vmware Tools is listed as being installed on the summary tab.

vSphere: VM Stuck during Power down at 95%



Occasionally I've run into a VM that gets stuck at 95% while powering down. I know the issue isn't unheard of, but I didn't run into it until working with a few ESXi 4.0.0 208167 servers. So - if you have a virtual machine hangs while shutting down - and you're certain that you're just not waiting for it to finish powering down, and you've already tried to "power off" from the client- but the power-off command is stuck at 95%, you may have to manually kill the hung VM.
1. Login to the host with the hung machine via SSH (enable SSH if you haven't already)
2. do a /sbin/services.sh restart (or services vmware-mgmt restart on ESX)... which is the same thing as doing this from the ESXi console
1. This command will restart the agents that are installed in /etc/init.d/ ... including hostd, ntpd, sfcbd, sfcbd-watchdog, slpd and wsmand (and HA if you have it)
2. When you do this, the VI/vsphere client will loose connectivity as those services restart, but VM's that are running will not be affected
3. After the services have restarted, you can re-connect via the VI client.
3. Via SSH, go to the right datastore (such as, /vmfs/volumes/DatastoreName/VMname), and delete (rm -r) the *.vswp file (the swap file).
4. If you can't delete it, and you're getting an error message to the effect... can not remove VM: device or resource busy... go find the processes associated with the VM.
1. "ps auxfww|grep "vmname"
2. "kill -9 ProcessIDNumber"
5. After doing so, remove the orphaned VM from inventory... just right-click the "unknown" VM, and select "remove from inventory", being careful to not delete it.
6. Then delete the *.log, and *.0*. If you don't, re-adding the VM may cause the interface to hang, and you'll have to go through some of this all over again.
7. Add the VM back to the inventory, and you should be able to start the VM.
I have run into a situation once, where a host reboot was the only way to solve the problem. But other than that, this seems to be quite effective.

Saturday, March 06, 2010

vSPhere 4 on GA-EX58-UD3R

If you're looking to put together a vSphere whitebox, the Gigabyte GA-EX58-UD3R motherboard with an Intel Core i7 920 isn't a bad choice. If you're thinking about going down this path - there are a few things worth mentioning... and while there's nothing particularly challenging or "show-stopping" about getting this working properly (except maybe the NIC), reading this post might save you some time.

Networking

You should know that the onboard Realtek RTL8168C NIC doesn't work - vSphere doesn't detect it. Ultimatewhitebox has a note about this, as do some forum posts... and sure enough, they're right. I found a few Intel PRO/1000 MT PCI Desktop Adapter's on eBay that work just fine, but if you're buying parts for this - go ahead and get a couple of the Intel NICs now. And you might want to consider disabling the onboard NIC during the setup.

Optical Drive

The takeaway here - make certain that your optical drive and SATA drive are on different channels. Also, if you want to avoid the below consider using a SATA optical drive instead of bothering with using an old IDE drive that you might have laying around.

Things to avoid...

I was using the eval version of vSphere 4 (4.0.0, 208167) on disc. The disc was detected on boot up, and I was able to get launch the vSphere GUI setup and get the installation started.
Initially, I was using an old IDE DVD drive. While the boot process went mostly as expected (with an odd exception sometime after the setup process started I had a message "CDROM Failed to Mount") I was able to get to the point in the setup where I had to create partitions. At that point, the setup process wasn't seeing my onboard SATA hard drive. So I rebooted, checked the BIOS and confirmed that the drive was being detected... I did happen to notice that it was on the same channel as the hard drive. After moving them to different channels, I launched the GUI setup again and when it got to the point of detecting the SATA hard drive, it was there. After seeing that, the setup process needs to copy some files off of the CD... which it suddenly failed to do... no drive detected. That seemed kind of strange, given that I had booted off the DVD drive, but recalling the CDROM failed to mount message - perhaps not. I went back into the BIOS, and changed the mode that the Optical drive was in - rebooted, but again failed to detect CD at the create partitions window. Next, I swapped in a SATA DVD writer from a different machine, launched the vSphere GUI setup (no more CDROM failed to mount message), detected the SATA hard drive, created partitions, and it completed setup without incident.

Overall, not too challenging for a Friday night... and now I have a vSphere host in my lab to start playing with.

Setup
vSphere 4 (4.0.0, 208167) disc
Gigabyte GA-EX58-UD3R bios version FB
Intel Core i7 920 CPU
Realtek RTL8168C on-board NIC disabled
Intel PRO/1000 MT PCI Desktop Adapters
SATA DVD Writer (SH-S223)
Western Digital WD5000 Blue Label, 500GB 7200RPM SATA Drive
Update in 2012 - added a Intel 128GB SSD




Sunday, August 09, 2009

VMware: Defrag Tips

Here are a few defrag tips when working with VMware ESX/ESXi.

  1. Use your guest OS defragmentation tools to defrag VMs.
  2. Always defrag your VM before you create a template.
  3. Do not defragment a drive while a VM has snapshotting enabled (your VM will grow in size, and slow stuff down
  4. Defragment before you take a snapshot
  5. VMFS filesystems do not need to be defragged, because their block-size is large and VMDK's are pre-allocated.

Saturday, August 08, 2009

VMware: Sound Support for remote desktop client and/or thinclients?

VMware ESX/ESXi does not have a virtual sound card device emulated. So there's no direct support for sound within VM's running on ESX/ESXi hosts. However, sound can be played on the remote desktop client if you've set your client to redirect and play locally (assuming your thinclient/remote desktop session supports sound). Keep in mind that if you have a Terminal Server, you need to enable the "Allow Audio Redirection" within the group policy for that machine.

Group Policy>Local Computer Policy>Computer Configuration>Administrative templates>Winows Components>Terminal Services>Client/Server data redirection>Allow Audio Redirection.

Friday, August 07, 2009

How-To: FreeNAS SAN on ESXi

Just a quick how-to, as a follow-up to my last post.

  1. Add Disks (Disks>Mgmt), add 2 (RAID1), or add 3+(RAID5).
  2. Format the disks you just created (Disks>Format, Choose the 1st disk, set the FileSystem to SoftwareRAID, click Format, Disks>Format, Choose the 2nd disk, set the FileSystem to SoftwareRAID, click Format).
  3. Create RAID Level (Disks>Software RAID> RAID1, Select both disks created in step)
  4. Format the RAID as an EXT2 file system (if you don't do this, you're going to get an error when you create the mount point. VMware ESXi will want the EXT2 filesystem... but you can then format it after it's been mounted to whatever you want. This includes if you're just adding storage capacity to a Windows system and using the initiator to mount this as a mount point. It's easiest to format the RAID EXT2 initially, and then do whatever you want later).
  5. Create a mount point (Disks>Mount Point, MBR1 type, and records your mount point .. e.g. /dev/mirror/Raids1).
  6. Unmount RAID if need be (Disks>Mount Point>Mgmt Tools>Tools tab, unmount).
  7. Add the iSCSI target (Services>iSCSI>Add New Extent, Skip the Device, Add New Target)
  8. Now you can mount this target on a Windows Server (Download and Install Microsoft iSCSI Initiator, Discovery Tab, add the IP address of the FreeNAS serverm... Computer, Manage, Delete the new partition that is now visible, and create a new NTFS partition, and Quick format it).

Wednesday, May 20, 2009

Using FreeNAS as a SAN for an ESXi demo

I recently had to do a virtualization demo for a client. The need was to show a particular application stack running under ESXi, using storage mounted from a SAN. This all needed to be portable, inexpensive, and completed quickly. The requirements limited me to stuff I could find quickly, and that would work. As such, I really only considered FreeNAS, OpenFiler, and Windows Storage Server since they were all readily available.

I ended-up using FreeNAS, and was actually quite impressed. FreeNAS runs the FreeBSD distribution, and interestily, like pfSense (another favorite of mine), it too is based on Monowall. What worked really well for me, was that FreeNAS is downloadable as an ESX virtual machine - which meant I could just download it and run as a VM inside an existing ESXi host. After getting it fired-up on "serverA", I stepped through the base configuration, got some storage carved out and exposed via iSCSI, and then just mounted it up inside a different ESXi machine (serverB). After doing do, I was able to copy my pre-configured VM's to the newly created datastore. I fired up my VM sessions on "serverA", they used the FreeNAS storage provided from serverB, and I had my portable demo environment. I'll follow-up with the steps I used to setup and expose the storage.

Monday, December 15, 2008

VMware server 1.0.7 on Ubuntu, "Cannot open the disk... Failed to lock the file" error.

My searches turned up a number of hits, but nothing specific for VMware server 1.07 build-108231 or Ubuntu 8.10. In any case, my Windows XP guest instance wouldn't start, reporting an error of "Cannot open the disk 'somefile.vmdk' or one of the snapshot disks it depends on. Reason: Failed to lock the file". The scenario that prompted this was that the host OS was shutdown hard while the guest was still in the process of shutting down.

If you check out the path of the problem guest instance... (e.g. /var/lib/vmware/Virtual Machines/ProblemGuest), you should see a few *.WRITELOCK files. Just rename those *.WRITELOCk files to something else... like *.OLDWRITELOCK. After doing so, go back to the VMware Server console and startup your guest - it should fire-up without incident.