{"id":210,"date":"2012-05-01T20:47:12","date_gmt":"2012-05-01T19:47:12","guid":{"rendered":"http:\/\/www.simweb.ch\/blog\/?p=210"},"modified":"2013-12-05T13:49:44","modified_gmt":"2013-12-05T12:49:44","slug":"short-note-time-providers-in-virtual-enfironments","status":"publish","type":"post","link":"https:\/\/www.simweb.ch\/blog\/2012\/05\/short-note-time-providers-in-virtual-enfironments\/","title":{"rendered":"Short note: Time providers in virtual environments"},"content":{"rendered":"<p>Correct time in VMs is unfortunately has and will continue to be somewhat of an issue - some virtualization environments provide clock sources so you don't have\u00a0 to rely on ntpd (which fails if the drift gets too high). So for the short note - how can you check if you are using a time provider of your VM platform when running Linux on:<\/p>\n<p><strong>KVM (e.g. Proxmox VE, bare Debian\/Ubuntu\/RHEL...):<\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">root@proxvm:~$ cat \/sys\/devices\/system\/clocksource\/clocksource0\/available_clocksource\r\nkvm-clock tsc hpet acpi_pm \r\n\r\nroot@proxvm:~$ cat \/sys\/devices\/system\/clocksource\/clocksource0\/current_clocksource\r\nkvm-clock<\/pre>\n<p>Additional resources:<\/p>\n<ul>\n<li>http:\/\/pve.proxmox.com\/wiki\/Guest_Time_drift<\/li>\n<li>http:\/\/docs.redhat.com\/docs\/en-US\/Red_Hat_Enterprise_Linux\/6\/html\/Virtualization_Host_Configuration_and_Guest_Installation_Guide\/chap-Virtualization_Host_Configuration_and_Guest_Installation_Guide-KVM_guest_timing_management.html<\/li>\n<\/ul>\n<p>Bonus question: Is a Linux guest also able to use kvm_clock when running inside a illumo-KVM on illumos, like on SmartOS? \ud83d\ude42<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\"><\/pre>\n<p><strong>MS Hyper-V:<\/strong><\/p>\n<p>For what I know, the time provider is enabled per default also at Hyper-V level per VM, but you might want to disable this for specific guests like (Windows) domain controllers or Kerberos KDCs. (5' time drift will also break Kerberos authentication). This will at least require at Kernel from later 2011 but better look for a Kernel with more stable Hyper-V driver integration, 3.4 will likely make you happy or 3.2 is also reasonably stable.<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">root@hvtux:~$ cat \/sys\/devices\/system\/clocksource\/clocksource0\/available_clocksource\r\nhyperv_clocksource tsc acpi_pm jiffies\r\n\r\nroot@hvtux:~$ cat \/sys\/devices\/system\/clocksource\/clocksource0\/current_clocksource\r\nhyperv_clocksource<\/pre>\n<p>When using the provider by the VE platform, I had less issues with time drift (none to be correct).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Correct time in VMs is unfortunately has and will continue to be somewhat of an issue &#8211; some virtualization environments provide clock sources so you don&#8217;t have\u00a0 to rely on ntpd (which fails if the drift gets too high). So for the short note &#8211; how can you check if you are using a time &#8230; <a class=\"moretag\" href=\"https:\/\/www.simweb.ch\/blog\/2012\/05\/short-note-time-providers-in-virtual-enfironments\/\">more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":0,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}