Solved

Clock-related (!) disk-errors in Linux/Ubuntu running on a VMWare VM

Posted on 2011-09-23
5
719 Views
Last Modified: 2012-05-12
I have a very unusual date-related problem that has arisen on one of our Linux VMs.

We're using a VMWare VM as a desktop appliance in developing countries where there is no internet access - ie our master VM is copied onto each computer as an appliance, and after starting up the VM, users simply click a button to launch a browser with the application.

In one installation, however, the computer's clock was accidentally set to 2012 prior to installation of the VM.  Once the error was noticed, the clock was corrected, but the VM then stopped working, giving the following error:
"Errors were found while checking the disk drive for /
F to attempt to fix the errors, I to ignore, S to skip mounting, or M for manual..."

If 'F' is chosen, the VM launches, but the error then reappears next time the VM is started.  When the clock is changed back to 2012, this error disappears and the VM launches fine, but when the clock is returned to 2011, the VM returns the error message again!

I can't figure out how a clock setting could be affecting the VM's virtual hard disk integrity...  Has anybody come across this bug before, or (even more importantly) figured out how to resolve it?  (Our team had to drive out for half a day to install a new VM and migrate their data - we want to avoid that next time!)

Cheers, Sam.
0
Comment
Question by:samueldjohnson
5 Comments
 
LVL 87

Expert Comment

by:rindi
Comment Utility
Did you just change the clock on the Host and not inside the Guest? I'd expect the issue you had if you changed the time on the host but not inside the guest. Normally Linux distro's are set to run a file-system check on their file-system after a certain number of mounts, and if the time is changed or not correct I'd expect it to check that file-system. You can turn off this automatic checking within fstab, see the link below:

http://www.debianhelp.co.uk/fstab.htm

For example:

# <device> <mountpoint> <filesystemtype><options> <dump> <fsckorder>

/dev/hdb2        /home                  ext2               defaults       1             2
/dev/hda1     /mnt/dos/c              msdos              defaults        0             0

The "2" in the fsckorder section for hdb2 means that the system will check that partition, while if there is a "0" like for hda1 it won't be checked.

0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
Have you got VMware Tools installed, and Checked it's The VM is Syncing with the Host?
0
 
LVL 3

Expert Comment

by:RitBit
Comment Utility
For all time/clock related issues see this VMware knowledge base :

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

It comes down to this: make sure your Host runs on NTP and the vm's absolutely do NOT use ntp but use the time-sync via vmware tools. On some linux kernels you need an extra line like "clocksource=pit" but all those details are in the knowledgebase i pointed you to.

Good luck.
0
 
LVL 3

Accepted Solution

by:
RitBit earned 500 total points
Comment Utility
Oh, forgot to explain why time issues mess up your system:

Since a virtual machine is scheduled by the hypervisor the internal clock of a VM is untrustfull as it has to skip steps based on how much time it got from the hypervisor-scheduler. As most processes within a OS are dependent on correct timing it's important to correct the clock within the VM with the exact time as kept within the hypervisor. The only way to do so is to use the vmware-tools timesync option.

As the file-system administration is depending on a correct clock it makes sense your file system got messed up. For databases this is much worse and a vm-clock that does not skip correctly can destroy your whole database.

Please take good care of the clock-source settings as mentioned in the knowlegdebase article to prevent such issues.
0
 

Author Comment

by:samueldjohnson
Comment Utility
Many thanks for all of your input - it definitely sounds like the file system has become confused by this clock setting.  I'll have a remote look at this VM tomorrow (Monday), and feed back how it went.

We're actually in the process of developing a new application that will also run on a VM, and to get around these potential time errors (particularly with database time-stamping!), we're asking the user to input the current data and time before they even enter the application - if this differs by more than 10 mins from the VM clock, then the application will shut down...

Many thanks,

Sam.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSpā€¦
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now