背景
阿里云云服务器,操作系统为 Windows Server 2008 R2 SP1 中文标准版,问题出现更改计算机名之后。
问题现象
打开服务器管理器(Server Manager),在窗口的右下角会显示“重新启动计算机之前控制台无法刷新”(Console cannot refresh until computer is restarted”);进行任何操作,都会出现类似的提示:
是否希望立即重新启动?
此服务器的重新启动处于挂起状态,必须重新启动服务器才可以安装或删除角色或功能。
Do you want to restart now?
A restart is pending for this server and no roles or features can be installed or removed until the server is restarted.
但无论怎么重启,问题依旧。
解决过程
查看 C:\Windows\Logs 中的日志文件 ServerManager.log,发现下面的信息:
1708: 2013-02-05 15:34:47.087 [ComputerState] Active Netbios Name: AY1302020339148
1708: 2013-02-05 15:34:47.087 [ComputerState] Future Netbios Name: BLOGSERVER1
1708: 2013-02-05 15:34:47.088 [ComputerState] Netbios name changed, reboot pending...
AY1302020339148 是阿里云安装 Windows 时自动生成的默认计算机名,BLOGSERVER1 是我更改后的计算机名。
将计算机名改回为默认的 AY1302020339148,重启后问题就解决了。
进一步测试发现,只要一改计算机名,就会出现这个问题,必须要用默认的计算机名。
进一步的解决方法
根据阿里云客服的反馈,更改计算机名后先不要重启计算机,进入注册表 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName ,将 ComputerName 改为新计算机名(不知这个地方为什么没同步更改,之前从来没遇到过这个问题),然后重启,就不会出现“重新启动计算机之前控制台无法刷新”的问题。见下图: