Tuesday, March 25, 2014

Tech TIps: Alternative way of killing VM stuck at 95% on your ESXi

If you have a ESXi VM stuck at 95% during boot up or after a snapshot taking place an nothing you do will reboot the VM, first step would be the following:


  1. With vSphere Client, connect to the host or the VC server that controls the host.
  2. Click on the host and go to the Configuration tab.
  3. Click on Security Profile.
  4. Click on Properties in the Services table.
  5. Start ESXi Shell and SSH services.
  6. Open a SSH session to the host.
  7. Execute /sbin/services.sh restart. This will restart all agents. The vSphere Client or the vCenter server will lose connection to the host. Reconnect! The VM may show as (invalid).
  8. Find the PID of the process by typing ps|grep “”. The second number before the name of the VM is the PID.
  9. Kill the process by typing kill -9 .
  10. Go to /vmfs/volumes//.
  11. Delete the swap file by typing rm –r
  12. In vSphere Client right click the VM and select Remove From Inventory.
  13. Browse the data store, open the VM folder, right click on the .vmx file and select Add to Inventory.
  14. Power On the VM.
If you somehow are no able to kill of the specific PID, try the following from VMware KB, which works for me!

Using the ESXi 5.x esxcli command to power off a virtual machine

The esxcli command can be used locally or remotely to power off a virtual machine running on ESXi 5.x. For more information, see the esxcli vm Commands section of the vSphere Command-Line Interface Reference.
  1. Open a console session where the esxcli tool is available, either in the ESXi Shell, the vSphere Management Assistant (vMA), or the location where the vSphere Command-Line Interface (vCLI) is installed.
  2. Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file, using this command:

    esxcli vm process list
  3. Power off one of the virtual machines from the list using this command:

    esxcli vm process kill --type=[soft,hard,force] --world-id=WorldNumber

    Notes:
    Three power-off methods are available. Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.
    Alternate power off command syntax is: esxcli vm process kill -t [soft,hard,force] -w WorldNumber
  4. Repeat Step 2 and validate that the virtual machine is no longer running.
For ESXi 4.1:
  1. Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file, using this command:

    esxcli vms vm list
  2. Power off one of the virtual machines from the list using this command:

    esxcli vms vm kill --type=[soft,hard,force] --world-id=WorldNumber

Using the ESXi command-line utility vim-cmd to power off the virtual machine

  1. On the ESXi console, enter Tech Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677).
  2. Get a list of all registered virtual machines, identified by their VMID, Display Name, and path to the .vmx configuration file, using this command:

    vim-cmd vmsvc/getallvms
  3. To get the current state of a virtual machine:

    vim-cmd vmsvc/power.getstate VMID
  4. Shutdown the virtual machine using the VMID found in Step 2 and run:

    vim-cmd vmsvc/power.shutdown VMID

    Note: If the virtual machine fails to shut down, use this command:

    vim-cmd vmsvc/power.off VMID

Sending signals on ESXi to power off the virtual machine

A virtual machine can be halted from the command line by sending signals to the process.
Warning: This procedure is potentially hazardous to the ESXi host. If you do not identify the appropriate process ID (PID) and kill the wrong process, it may have unexpected results. If you are not comfortable with the following procedure, file a support request with VMware Technical Support and note this Knowledge Base article ID (1014165) in the problem description. For more information, see How to Submit a Support Request.
In ESXi 3.5-5.x, you can use the kill command to send a signal to, and terminate, a running virtual machine process.
  1. On the ESXi console, enter Tech Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677).
  2. To determine if the virtual machine process is running on the ESXi host, run this command:

    ps | grep vmx

    The output appears similar to:

    7662 7662 vmx /bin/vmx
    7667 7662 vmx /bin/vmx
    7668 7662 mks:VirtualMachineName /bin/vmx
    7669 7662 vcpu-0:VirtualMachineName /bin/vmx


    Several rows are returned, one for each vmx process. Identify the parent vmx process for the target virtual machine. The first column contains the PID, and the second contains the parent's PID. Ensure you terminate only the parent process. The parent Process ID (PID) for each process is listed in the second column, identified in this example in bold. Take note of this number for use in the following steps.

    Caution: Ensure that you identify the line specific only to the virtual machine you are attempting to repair. If you continue this process for a virtual machine other than the one in question, you can cause downtime for the other virtual machine.
  3. If the vmx process is listed, terminate the process using this command:

    kill ProcessID
  4. Wait 30 seconds and repeat step 2 to check for the process again.
  5. If it is not terminated, run this command:

    kill -9 ProcessID
  6. Wait 30 seconds and check for the process again.
In ESXi 4.x/ESXi 5.x, you can use the k command in esxtop to send a signal to, and kill, a running virtual machine process.
  1. On the ESXi console, enter Tech Support mode and log in as root. For more information, see Tech Support Mode for Emergency Support (1003677).
  2. Run the esxtop utility using this command:

    esxtop
  3. Press c to switch to the CPU resource utilization screen.
  4. Press Shift+v to limit the view to virtual machines. This may make it easier to find the Leader World ID in step 7.
  5. Press f to display the list of fields.
  6. Press c to add the column for the Leader World ID.
  7. Identify the target virtual machine by its Name and Leader World ID (LWID).
  8. Press k.
  9. At the World to kill prompt, type in the Leader World ID from step 6 and press Enter.
  10. Wait 30 seconds and validate that the process is not longer listed.


Monday, October 21, 2013

Tech Tips: VMDK File restores using Veeam - Side-by-side access

Veeam is a pretty awesome tool for doing full VM and file-level backups of VMware vSphere VMs. Every once in a while, however, you might try to do a restore that is a bit out of the ordinary. One such scenario is when you want to do a full restore of the VMDK files (descriptor and flat) and then mounting the drive alongside the original disk on the original virtual machine. You might want to do this so you can compare files between the current copy and the restored VMDK. When you attempt to mount the restored VMDK, you will run into the following message upon reconfiguring the VM:

Message from ESX Host: Virtual disks [truncated output] have the same UUID. Virtual disks with same UUID should not be assigned to a virtual machine because duplications can lead to problems when the guest boots. Make sure virtual disks have unique UUIDs. Do you want to continue?

To avoid the duplicate UUID problem, try this: after restoring the VMDK files to your host, ssh to your ESXi server and browse to the /VMFS/Volumes/ of the restore point. Once there, run the following command against the VMDK descriptor file:

vmkfstools -J setuuid .vmdk

Replace with the name of the VMDK as seen in a directory listing of the VM’s folder in the VMFS/NFS volume or in the vSphere Client (C# or Web). This will generate and set a new (random) UUID and allow you to mount the drive to the original VM without problems!

Wednesday, February 06, 2013

Tech Tips: Overcoming VMWare ESXi’s 2TB limit with Dell PERC 6 and H700/H800 using disk groups with many virtual disks

VMWare ESXi (version 4, I wonder about what ESXi 5 really brings) has a 2TB limit on datastore size.
So say you just bought a new Dell server and disk array, with let’s say 24 500gb disks, and wanna run it in RAID-6 for a total of 10230gb (22 * 465gb).
You’ll soon discover VMWare will limit the datastore to a little less than 2Tb. I’ll not go into the mess that is the reason for this, just accept it. Or buy ESXi 5 for US$ 10k.
One (poor) solution, would be to setup a few smaller RAID arrays (eg, four 5-disk 500gb RAID-5 arrays); each array totalling around 2tb, and create a few datastores, each with a little less than 2tb.
That’s bad because obviously you’ll waste a lot of disks; but it works.
The best solution is to make use of a little-advertised feature of RAID cards: disk groups. Since PERC 6 (PERC 6/i, PERC 6/E, H700 and H800) the card has 3 concepts: Physical Disks, Disk Groups, and Virtual Disks.
When you use OMSA, or go into Ctrl-R during boot, the ‘Create Virtual Disk Wizard’ makes it easy to create a Virtual Disk in a specific RAID mode.

So when you create a new 24 physical disk RAID-6 virtual disk, it automatically creates the Disk Group for you (it’s a ‘wizard’, right?).
What’s not so obvious is that you can put more than one Virtual Disk inside a Disk Group, effectively creating more than one LUN on a RAID array.
To do that, during the first VD create step, reduce the VD “size” field to 2000gb; it will create the first VD in the Disk Group.
Then, repeat the VD creation; it will allow you to re-use the same RAID level and Physical Disks, to create new VDs in the same group.
This way you can create a few VDs (all below 2Tb) without ‘wasting’ physical disks. In VMWare ESXi, create Datastores, one for each VD: set the VMWare block size to 8mb so that you can create large VMWare Virtual Disks in them.
For a large Virtual Machine, you can create many VMWare Virtual Disks (each up to 2tb, each in different datastores) for the VM; inside that VM’s operating system, use the OS’s features to JBOD each virtual disk into a large volume.
You can do that with Windows’s Dynamic Disks, or using Linux software raid md (in JBOD mode): just make sure to use JBOD or other non-stripped mode, because the RAID is actually done and working at the physical controller card Disk Group level.


reference: here

Friday, September 28, 2012

Tech Tips: How to fix Microsoft Exchange Server setup cannot continue because a restart from a previous installation or update is pending

I faced the above mentioned problem when trying to install the Exchange 2010 Management Tool on a brand new Windows Server 2008 R2.

Having all the prerequisites installed and enabled, I wonder why the setup wizard still would not allowed me to proceed with the installation. It boils down to the following:


The Exchange Server Analyzer reads the following registry key to determine whether a system restart is required after installation or removal of a software update such as a security update, critical update, or hotfix.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\UpdateExeVolatile

The Exchange Analyzer also checks the following registry key to determine whether a previous software update installation was not completed and the system must be restarted to finish the installation.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

The Exchange Analyzer displays an error message if one of the following conditions is true:.
  • The value of the UpdateExeVolatile registry key is anything other than 0.
  • The PendingFileRenameOperations registry key has any value.
This error indicates that a restart from a previous install or update is pending and the system must be restarted before Exchange Setup can continue.

To resolve this issue, restart the system and then run Exchange setup again.
To remove an orphaned UpdateExeVolatile registry key value
  1. Open a registry editor, such as Regedit.exe or Regedt32.exe.
  2. Navigate to HKLM\SOFTWARE\Microsoft\Updates\
  3. In the right navigation pane, double-click the UpdateExeVolatile key.
  4. Configure the key with a value of 0
  5. Close Registry Editor.
To delete the orphaned PendingFileRenameOperations registry key
  1. Open a registry editor, such as Regedit.exe or Regedt32.exe.
  2. Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\
  3. In the right navigation pane, right-click the PendingFileRenameOperations key and select Delete.
  4. Close Registry Editor.
Before you edit the registry, and for information about how to edit the registry, see Microsoft Knowledge Base article 256986,Description of the Microsoft Windows Registry.

http://technet.microsoft.com/en-us/library/cc164360(v=exchg.80).aspx

Friday, July 27, 2012

Beginners' guide to underwater photography


Helpful Resources for Beginner Photographers


Basics

If you are just starting out, review the Underwater Photography Basics
Now that you know the basics, welcome to the world of underwater photography! This section is a “quick start” guide for those of you new to underwater photography. Once you’ve done a couple dives, and read your camera manual, you can take time to read the rest of this guide. The “underwater camera settings” chapter, the beginning of “Underwater Composition”, the beginning of the “Lighting and Strobes” section, Compact cameras underwater, and “Underwater Photo Tips” will be most relevant for a first-time underwater photographer.
If you haven’t purchased a camera or housing yet, you can take a look at the Underwater Equipment section or contact us directly at our partner site Bluewater Photo.
You can always ask questions in our underwater photography forums.

Ready to try underwater photography?

Great, now you have an underwater camera and a housing, lets get in the water! But first, please make sure you are comfortable with your diving skills and buoyancy. Using a camera can be distracting, and it can be too easy for a new diver to crash into the reef, or worse, float to the surface without knowing it.
Before going underwater, it really helps to use your camera indoors, in a dimly lit room. Take some photos with the camera inside the housing, macro mode, flash on. Take photos of some small objects, and see how your photos come out. Test out the range of the camera with macro mode on and off.

First time advice for UW photographers

Ok, if you’re ready now to go underwater, here’s what you need to know initially:
1)       For most photos (within 3-4ft), you will need the flash on. Make sure your flash is set to “forced flash”, not “auto-flash”. The flash will add color to your shots, otherwise they will look blue.
2)       For most photos, you’ll want to be in macro mode. Learn how to turn macro mode on and off. You need to know the range of your macro mode. For most cameras this range will be 1-2 inches to 2 feet (2.5-5cm to 60cm). Any closer and you can’t take a photo. Further away, you must turn macro mode off. Make sure you are zoomed out (see #4)
3)       Turn your internal flash on if you are within 2-3ft of a subject. Further than 3ft, turn the internal flash off. Unless the subject is really interesting and fast (shark, manta ray), I highly suggest getting within 3ft of the subject and using the flash. Otherwise, your photo will look blue. Use auto-white balance when you are using your internal flash. Don't use "cloudy" white balance or underwater mode with your flash/strobe, that will result in photos that are reddish-orange. Use auto, aperture priority, or full manual mode, depending on your comfort level with camera settings.
4)       For now, keep your camera zoomed out (the widest setting). The reason why this is so important is because it affects how closely you can focus, especially in macro mode.  If you zoom in, you can't focus as closely to the subject, and that defeats the purpose of macro mode. The better strategy is to get closer to the subject.
5)       Try to get within a few inches of the subject. Try to get very low, at eye-level. Focus at the eyes. Try to get a photo of the subject facing you. Read more underwater composition tips.
6)       If you are taking photos with the flash off (subjects more than 3ft away), also known as using ambient light, and you want better color, you must do 1 of two things – either use the underwater mode, or even better, do a manual white balance (custom white balance). Read the manual white balance section.
7)       If you leave the flash on, and take a photo of a subject more than 2-3ft away, don’t be surprised if your photo has backscatter in it, unless you are shooting in exceptionally clear water. The only way to solve this is to get closer to the subject, and/or purchase an external strobe.
8)       Remember – the closer you are, the better your color, contrast and sharpness will be. Try to “fill the frame” with your subject.
9)       Your housing should have come with a "flash diffuser", although it might be built into the housing. This diffuser will be placed in front of your internal flash and will soften the light. Make sure you use it.
10)     If you are having problems with the lag time between focusing on a subject and taking a shot, you can try "locking focus" by pressing halfway down on the shutter button, and then fine-tweaking your composition and making sure you keep the camera very still. This works better for non-moving subjects. Here's some more tips on achieving faster focus underwater.
11)     You can leave your camera on "auto" mode for now, but if your camera has full manual mode (which you can set the shutter speed and aperture/f-stop independently of each other) - that's the mode you want to be using. Read the underwater settings chapter for more info.
12)     Think about getting an external strobe, that's the best way to improve your photos. To use the strobe, you need to be able to control your camera's aperture, and control the power of the strobe.
13)    Set up your camera, housing, and strobe indoors - and then take some practice shots indoors. Test your settings. Everything will work similarly to how it will work underwater, although indoors focusing will be easier, and your strobe will appear to be more powerful. I'm surprised how many people wait until they get underwater to try out settings.
14)     Last, but not least - concentrate on the following two types of underwater shots.
  • Close-up shots in macro mode, forced flash, auto-white balance, spot-focus, with the subject no more than 5-6 inches away. Aperture priority (AV) mode if available, F8, otherwise program mode.
  • Scenic coral/reef shots several feet away, macro mode off, flash off, custom white balance, Evaluative (matrix) metering, only in shallow sunny water (25ft or less). Aperture priority (AV) mode if available at F2.8, otherwise program mode.

spinecheek anemonefish, lembeh
Spinecheek Anemonefish, Fuji F30, auto-mode, flash, macro-mode

Further reading


Go take some shots, and good luck!

Reference link