为Google计算引擎创buildCentos 7最小图像

使用此设置,我可以将Centos 7最小化安装到我的虚拟机中

在这里输入图像说明

然后我创build单个“/”标准的ext4分区。

分区一旦安装:

在这里输入图像说明

一旦我上传图像和创build实例,实例只是不启动。

这里是从我的centos 7实例的日志最小的形象:

KBD: int09 handler: AL=0 PS2 keyboard initialized All threads complete. Scan for option roms Searching bootorder for: HALT drive 0x000fd900: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=20971520 Space available for UMB: 000c0000-000eb800 Returned 122880 bytes of ZoneHigh e820 map has 7 items: 0: 0000000000000000 - 000000000009fc00 = 1 RAM 1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED 2: 00000000000f0000 - 0000000000100000 = 2 RESERVED 3: 0000000000100000 - 00000000bfffe000 = 1 RAM 4: 00000000bfffe000 - 00000000c0000000 = 2 RESERVED 5: 00000000fffbc000 - 0000000100000000 = 2 RESERVED 6: 0000000100000000 - 0000000130000000 = 1 RAM Unable to lock ram - bridge not found KBD: int09 handler: AL=0 enter handle_19: NULL Booting from Hard Disk 0... Booting from 0000:7c00 

但只是卡住了。

这里是来自Google Centos 7的日志

 KBD: int09 handler: AL=0 PS2 keyboard initialized All threads complete. Scan for option roms Searching bootorder for: HALT drive 0x000fd920: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=20971520 Space available for UMB: 000c0000-000eb800 Returned 122880 bytes of ZoneHigh e820 map has 6 items: 0: 0000000000000000 - 000000000009fc00 = 1 RAM 1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED 2: 00000000000f0000 - 0000000000100000 = 2 RESERVED 3: 0000000000100000 - 00000000bfffe000 = 1 RAM 4: 00000000bfffe000 - 00000000c0000000 = 2 RESERVED 5: 00000000fffbc000 - 0000000100000000 = 2 RESERVED Unable to lock ram - bridge not found KBD: int09 handler: AL=0 enter handle_19: NULL Booting from Hard Disk 0... Booting from 0000:7c00 [H [J [1;1H [?25l [m [H [J [1;1H [20;7H [mUse the ^ and v keys to change the selection. Press 'e' to edit the selected item, or 'c' for a command prompt. [4;80H [7m [4;1H CentOS Linux (3.10.0-327.4.4.el7.x86_64) 7 (Core) [m [4;79H [m [m [5;1H CentOS Linux (3.10.0-229.20.1.el7.x86_64) 7 (Core) [m [5;79H [m [m [6;1H CentOS Linux, with Linux 3.10.0-123.el7.x86_64 [m [6;79H [m [m [7;1H CentOS Linux, with Linux 0-rescue-c237d8614bd9258fe3d4b8048fbe651d [m [7;79H [m [m [8;1H [m [8;79H [m [m [9;1H [m [9;79H [m [m [10;1H [m [10;79H [m [m [11;1H [m [11;79H [m [m [12;1H [m [12;79H [m [m [13;1H [m [13;79H [m [m [14;1H [m [14;79H [m [m [15;1H [m [15;79H [m [m [16;1H [m [16;79H [m [m [17;1H [m [17;79H [m [m [18;1H [m [18;79H [m [18;80H [4;79H [22;1H The selected entry will be started automatically in 5s. [4;79H [22;1H The selected entry will be started automatically in 4s. [4;79H [22;1H The selected entry will be started automatically in 3s. [4;79H [22;1H The selected entry will be started automatically in 2s. [4;79H [22;1H The selected entry will be started automatically in 1s. [4;79H [22;1H The selected entry will be started automatically in 0s. [4;79H [?25h [H [J [1;1H [H [J [1;1H[ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct 

它看起来像你的引导程序没有正确configuration。 文章中的说明构成:

在系统上configuration引导加载程序,以便在计算引擎上引导。

  1. 使用您计划导入的启动磁盘连接到系统上的terminal。
  2. 编辑GRUBconfiguration文件。 通常这个文件在/etc/default/grub ,但是在一些较老的发行版中,它可能位于一个非标准的目录中。
  3. 对GRUBconfiguration文件进行以下更改:

    • 删除任何有splashimage= 。 计算引擎在引导时不支持启animation面。
    • 删除rhgb和安静的内核命令行参数。
    • console=ttyS0,38400n8d添加到内核命令行参数中,以便实例可以在交互式串行控制台中运行。
  4. 重新生成grub.cfg文件。 根据您的分配使用以下命令之一。

    • Debian和Ubuntu: sudo update-grub
    • RHEL,CentOS,SUSE,openSUSE:sudo grub-mkconfig -o /boot/grub/grub.cfg
  5. 编辑/etc/fstab文件,并删除除引导磁盘本身和该引导磁盘上分区以外的所有磁盘和分区的引用。 /etc/fstab无效条目可能会导致系统启动进程停止。