Отключить синхронизацию времени vmware
Я заметил, что на наших виртуальных машинах VMWare часто отображается неправильное время. Независимо от того, сколько раз я сбрасывал время, когда они продолжают рассинхронизировать.
Кто-нибудь еще заметил это? Что делают другие люди, чтобы синхронизировать время своей виртуальной машины?
Изменить: это виртуальные машины CLI linux, кстати.
Если время вашего хоста правильное, вы можете установить следующий параметр файла конфигурации .vmx, чтобы включить периодическую синхронизацию:
По умолчанию время синхронизируется каждую минуту. Чтобы изменить периодическую скорость, установите следующую опцию на желаемое время синхронизации в секундах:
Чтобы это работало, вам необходимо, чтобы в гостевой ОС были установлены инструменты VMWare.
согласно базе знаний VMware фактическое решение зависит от дистрибутива и выпуска Linux, в RHEL 5.3 я обычно редактирую /etc/grub.conf и добавляю эти параметры в запись ядра: divider = 10 clocksource = acpi_pm
Затем включите NTP, отключите синхронизацию времени VMware из vmware-toolbox и, наконец, перезагрузите виртуальную машину.
Полную таблицу с рекомендациями для каждого дистрибутива Linux можно найти здесь:
Отвечу за гости Windows. Если у вас установлены инструменты VMware, то в области уведомлений панели задач (рядом с часами) есть значок VMware Tools. Дважды щелкните по нему и установите свои параметры.
Здесь нужно кое-что отметить. У нас была такая же проблема с виртуальной машиной Windows, работающей на хосте ESXi. Синхронизация времени была включена в VMWare Tools на гостевой машине, но гостевые часы постоянно отключались (примерно на 30 секунд) от часов хоста. Хост ESXi был настроен для получения обновлений времени от внутреннего сервера времени.
Оказывается, у нас была включена настройка времени в Интернете на виртуальной машине Windows (Панель управления> Дата и время> вкладка Время в Интернете), поэтому гость получал обновления времени из двух мест, и время в Интернете было в выигрыше. Мы отключили это, и теперь гостевые часы в порядке, их время определяется исключительно хостом ESXi.
В моем случае мы запускаем VMWare Server 2.02 на Windows Server 2003 R2 Standard. Хост также является Windows Server 2003 R2 Standard. Я установил инструменты VMware и настроил синхронизацию времени. Я сделал все, что можно было вообразить, что я нашел на разных интернет-сайтах. У нас все еще был ужасный дрейф, хотя он сократился с 15 и более минут до 3–4 минут.
Причина: эта проблема возникает, когда на компьютере включена технология AMD Cool'n'Quiet (двухъядерные процессоры AMD) в BIOS или в некоторых многоядерных процессорах Intel. Многоядерные или многопроцессорные системы могут столкнуться с дрейфом счетчика отметок времени (TSC), когда время между разными ядрами не синхронизировано. Операционные системы, которые используют TSC в качестве ресурса хронометража, могут столкнуться с проблемой. Более новые операционные системы обычно не используют TSC по умолчанию, если в системе доступны другие таймеры, которые можно использовать в качестве источника хронометража. Другие доступные таймеры включают PM_Timer и High Precision Event Timer (HPET). Решение. Чтобы решить эту проблему, обратитесь к поставщику оборудования, чтобы узнать, доступно ли новое обновление драйвера / микропрограммы для устранения проблемы.
Примечание. При установке драйвера в файл Boot.ini может быть добавлен параметр / usepmtimer.
После того, как это (переключатель / usepmtimer) было выполнено, часы отошли вовремя.
Some administrative practices, like a bad habit, have more lives than the proverbial cat – they tend to stay around forever. It is, therefore, very comforting when one finds a problematic administrative practice that has not just been universally abandoned by administrators, but is also on the top of any junior administrator’s “configurations sure to get you dis-invited from the next user group meetup” list.
Take the case of the old practice of synchronizing a virtual machine’s clock with its host’s clock in a vSphere environment. That used to be “the thing to do” way back when. It was actually the default configuration option on the ESX platform in those days. Until everyone got wiser and the message went out to every admin far and wide that such configurations was no longer kosher. Even VMware got religious and stopped making that option the default behavior.
Now, if you are like one of the hundreds of vSphere administrators with whom I have interacted over the past years, you are probably unaware of the fact that, even when the “Synchronize clock with ESXi host” option is disabled (unchecked) on the VMware Tools properties of the virtual machine, the virtual machine will still occasionally synchronize its clock with the ESXi host. Oh, you knew that? Show-off 🙂 You probably did because VMware actually documented the behavior in a rather oft-overlooked knowledge base article – Disabling Time Synchronization
As mentioned in that KB, the following vSphere operations can cause the clock on a virtual machine to be reset (backward or forward) to match the clock on the host on which it resides.
- Resume a virtual machine from a suspended state
- Take or restore a snapshot
- vMotion a virtual machine
- Shrink a virtual machine’s disk
- Reboot a virtual machine
- Restart the VMware Tools service on a virtual machine
During operations listed above, a VMware Tools will adjust a VM’s clock to match that of the ESXi on which it resides. So what? Well, if you are an operator who has not adhered to the good recommended practices of ensuring that host’s CMOS clocks are correct and the ESXi host is configured to use an external NTP time source for time-keeping, your infrastructure may be impacted by this behavior. If your VM resides on an ESXi host with incorrect BIOS clock, or if you vMotion your VM to such hosts, then the operation will result in your VM’s clock being automatically adjusted to match the incorrect host’s clock.
Consider the following scenarios:
- Windows Active Directory Domain Services
Windows Active Directory provides a loose sync time management infrastructure for all machines joined to the AD Domain. This time-keeping capability is sufficient and reliable enough for Windows and AD’s operations, particularly in ensuring that Kerberos authentication succeeds in the Forest/Domain and in-guest applications that do not require strict time accuracy (in sub-seconds). All Windows machines that are joined to a particular Windows Domain default to using the Windows-provided w32time service which looks at the domain/forest time hierarchy for its authoritative time synchronization. The PDC Emulator (PDCe) at the root of the forest is considered the time synchronization Marshall in the Forest, and it is usually configured to synchronize its time with a reliable, external clock and propagate time down the hierarchy throughout out the Forest. If the PDCe VM were migrated to the ESXi host with the bad clock, that operation will impact the accuracy and reliability of the PDCe VM’s clock. The resultant impact will be felt throughout the Active Directory infrastructure. - Windows Applications
Although Microsoft applications do not typically require strict time accuracy, most of these applications have time skew thresholds beyond which they begin to manifest failures and outages. For example, clustered Windows application nodes, or applications like Exchange Servers cannot function reliably if their time become severely divergent. Consequently, the clustered workloads will become unavailable, users will be unable to authenticate and access resources, etc - Oracle Applications
Time synchronization between Oracle RAC cluster nodes is crucial. While a deviating time between the servers in a cluster does not necessarily lead to instability, asynchronous times can make it harder to manage the cluster as a whole. One reason is that timestamps are written using the local node time. Log analysis can be impacted severely if the times in a cluster deviate significantly.The Oracle Clusterware requires the same time zone environment variable setting on all cluster nodes which is used for all processes e.g databases, Oracle ASM, and any other managed processes.
A central time server in the data center, accessed by NTP, is typically used to synchronize the server times to prevent deviating times between the cluster nodes.It is best to avoid sudden time adjustments on individual nodes, which can lead to node evictions when performed too abruptly.Recommendation is to Disable Time Synchronization for all Oracle VMs irrespective of the kind of Oracle Application they host.
The VMware Knowledge base article (Disabling Time Synchronization) documents the virtual machine advanced configurations options that help avoid this condition. They are as listed below.
tools.syncTime | 0 |
time.synchronize.continue | 0 |
time.synchronize.restore | 0 |
time.synchronize.resume.disk | 0 |
time.synchronize.shrink | 0 |
time.synchronize.tools.startup | 0 |
time.synchronize.tools.enable | 0 |
time.synchronize.resume.host | 0 |
For enterprises with existing large number of virtual machines, where manually implementing this configuration changes is not a trivial undertaking, VMware has released a VMware vRealize Orchestrator (vRO) Workflow Package to assist in the effort. The workflow can be started from the VMware vRealize Orchestrator (vRO) client. If the vRO is already registered in a vCenter instance, then the workflow can also be initiated directly from the vSphere Web Client. In either case, you first need to import the attached workflow package into the vSphere environment (using the vRO Client) before you can successfully use it in your vSphere environment.
When you turn on periodic time synchronization, VMware Tools sets the time of the guest operating system to be the same as the time of the host.
After time synchronization occurs, VMware Tools checks once every minute to determine whether the clocks on the guest and host operating systems still match. If not, the clock on the guest operating system is synchronized to match the clock on the host.
If the clock on the guest operating system falls behind the clock on the host, VMware Tools moves the clock on the guest forward to match the clock on the host. If the clock on the guest operating system is ahead of the clock on the host, VMware Tools causes the clock on the guest to run more slowly until the clocks are synchronized.
Native time synchronization software, such as Network Time Protocol (NTP) for Linux and the Mac OS X, or Microsoft Windows Time Service (Win32Time) for Windows, is typically more accurate than VMware Tools periodic time synchronization and is therefore preferred.
Important: Use only one form of periodic time synchronization in your guests. If you are using native time synchronization software, turn off VMware Tools periodic time synchronization.
Regardless of whether you turn on VMware Tools periodic time synchronization, time synchronization occurs after certain operations:
- When the VMware Tools daemon is started, such as during a reboot or power on operation
- When resuming a virtual machine from a suspend operation
- After reverting to a snapshot
- After shrinking a disk
When the operating system starts or reboots, and when you first turn on periodic time synchronization, synchronization can be either forward or backward in time. For other events, synchronization is forward in time.
To disable time synchronization completely, you must edit the configuration file ( .vmx file) of the virtual machine and set several synchronization properties to FALSE.
Procedure
For utility-name use the guest-specific program name.
For subcommand , use enable or disable .
Results
The VMware Tools service enables or disables periodic time synchronization, as you specified. Disabling periodic time synchronization does not disable all VMware Tools time synchronization.
Prerequisites
- Disable other periodic time synchronization mechanisms. For example, some guests might have NTP or Win32Time clock synchronization turned on by default.
- If you plan to script the commands used in this procedure and need to know what the exit codes are, see Exit Codes for the VMware Tools Configuration Utility.
Note: Mac OS X guests use NTP and do not become out of sync with the host. For Mac OS X guests, you do not need to turn on VMware Tools time synchronization.
What to do next
If you need to keep a fictitious time in a virtual machine, so that the clock in the guest operating system is never synchronized with that on the host, disable time synchronization completely.
Сегодня мы поговорим о некоторых особенностях настройки службы времени на виртуализированных контроллерах домена. Как правило, схема синхронизации времени в домене Active Directory выглядит следующим образом:
- Контроллер домена с FSMO ролью эмулятора PDC является основным источником времени в домене AD и синхронизируется с внешним поставщиком точного времени.
- Все остальные контроллеры домена синхронизированы с контроллером, содержащим роль эмулятора PDC
- Все рядовые сервера домена и рабочие станции синхронизируют время с ближайшим контроллером домена.
Однако, если попытаться вывести текущего поставщика времени , неожиданно можно увидеть странный источник времени с именем VM IC Time Synchronization Provider.
w32tm / query / source
Дело в том, что по умолчанию виртуальные машины Hyper-V / VMWare синхронизируют свое время с хостовым гипервизором, в не зависимости от настроек службы времени внутри ВМ. В результате этого может оказаться довольно странная ситуация, когда хост Hyper-V является членом домена AD и синхронизирует время с контроллером домена, который, в свою очередь, является виртуальной машиной и синхронизирован с хостом (рекурсия?!).
Чтобы этого избежать, для контроллеров виртуальных доменов вы должны отключить синхронизацию времени с хостом. Есть два способа сделать это.
Первый способ — отключить синхронизацию времени в свойствах ВМ. Для этого откройте свойства виртуальной машины в оснастке Hyper-V Manager, перейдите в раздел Integration Services и снимите флажок Time synchronization.
То же самое на сервере Hyper-V можно сделать с помощью консоли PowerShell. Например, с помощью этой команды можно получить статус службы синхронизации времени для виртуальной машины:
Get-VMIntegrationService -VMName dc1 -Name ‘Time synchronization’
А следующей командой можно отключить синхронизацию:
Get-VMIntegrationService -VMName dc1 -Name ‘Time synchronization’ | Disable-VMIntegrationService
Если в качестве хоста \виртуализации вы используете VMWare ESXi, вы можете отключить синхронизацию времени с хостом в настройках виртуальной машины.
ВМ->Edit Settings -> вкладка VM Options -> Снимите галку “Synchronize guest time with host”
Второй способ отключения синхронизации времени — редактирование реестра внутри гостевой виртуальной машины с ролью контроллера домена (ADDS). Чтобы отключить синхронизацию, запустите Regedit.exe, перейдите в раздел HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider и измените значение параметра Enabled на 0.
Либо то же самое действие, но из командной строки:
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider /v Enabled /t reg_dword /d 0
Кроме того, рекомендуется выполнить следующие настройки
- Изменить период опроса сервера NTP reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t reg_dword /d 900
- Настроить правильный ответ службы времени на нестандартное изменение времени более чем на 52 часа reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config /v MaxNegPhaseCorrection /t reg_dword 0xFFFFFFFF
После отключения синхронизации с помощью любого из описанных выше методов необходимо перезапустить службу времени w32time, чтобы она перенастроилась на новый источник времени и запустить синхронизацию:
net stop w32time
net start w32time
w32tm /resync /force
На всех остальных DC в AD вы должны дополнительно выполнить команду:
w32tm/config /syncfromflags:DOMHIER /update
Это заставит службу времени выбрать PDC-эмулятор в качестве источника в соответствии с иерархией домена. Таким образом, мы настроим правильную схему синхронизации времени в домене при использовании виртуальных DC.
Я хочу знать, как виртуальные машины (VMWare) обновляют дату и время и как это отключить; потому что я заметил, что даже если я приостановлю / выключу виртуальную машину на год, когда я снова включу ее, у нее будет правильное время и дата.
Я знаю, что для физических машин внутри центрального блока, установленного на материнской плате, есть небольшая батарея, которая помогает отслеживать дату, когда компьютер выключен и отключен от источника питания. Но как насчет виртуальных машин, как они сохраняют свое время? и как я могу это запретить?
Немного любопытно, зачем кому-то это вообще нужно? Если вы возобновите работу виртуальной машины, которая была переведена в спящий режим 15 лет назад, вы хотите, чтобы она по-прежнему думала, что она должна «веселиться, как в 1999 году»? Путешествие во времени на основе виртуальной машины, кто-нибудь?
У меня есть свои причины, но мне было действительно любопытно, как виртуальные машины поддерживают свои часы в актуальном состоянии, и, кстати, вы можете установить лицензию на программное обеспечение на один месяц на виртуальную машину, а затем клонировать ее и повторно использовать их каждый месяц! :п
Обновление 2019 через статью базы знаний VMWare . Теперь есть больше событий, запускающих синхронизацию времени.
Виртуальные машины по умолчанию работают с ОС хоста.
При этом «остановка часов» может быть не тем, что вы имели в виду, поскольку, когда виртуальная машина работает, гостевая ОС должна иметь как минимум рабочие часы.
Конечно, я не хочу останавливать часы навсегда. Я просто хочу, чтобы он был приостановлен, когда виртуальная машина выключена, как только она включается, часы должны продолжать с того места, где они остановились, так я знаю, с тех пор, как виртуальная машина была выключена. но НЕТ обновлений. Спасибо за документы, посмотрю!
Читайте также: