更新时间:2025-06-25 GMT+08:00
镜像内禁用关机命令
操作场景
对于裸金属类型的规格实例(规格名称中包含physical),如果通过操作系统的shutdown,poweroff,half等命令进行操作,可能会导致命令无效或关机后无法启动。所以请在作镜像时禁用这些关机命令
操作步骤
禁用方法可自行设置,例如:
在文件/root/.bash_profile中添加如下语句:
alias shutdown="echo 'Please do not run shutdown here. Go to the console to stop the VM.'"
alias poweroff="echo 'Please do not run poweroff here. Go to the console to stop the VM.'"
父主题:虚拟机环境配置

