【问题标题】:Google Cloud - Compute Engine - Error starting instance when attached disk in READ_ONLYGoogle Cloud - Compute Engine - 在 READ_ONLY 中附加磁盘时启动实例时出错
【发布时间】:2014-05-12 07:14:32
【问题描述】:

我在 Google Cloud Compute Engine 服务上有一个实例 (F1-Micro) 和一个根永久磁盘 (10GB)。当我启动实例并在READ_WRITE 中附加磁盘时,实例正常启动,执行我的启动脚本,我可以通过 SSH 访问。但是,当我将磁盘模式参数更改为READ_ONLY 时,该实例显然可以正常启动,并且我无法进行 SSH 给我一个超时连接。另外,我的启动脚本没有启动。我怀疑或者我需要附加更多具有READ_WRITE 权限的根永久磁盘,或者我需要在我的磁盘中设置一些配置。有人可以让我了解正在发生的事情吗?下面我给出一些数据和日志:

正文请求:

instance = {
        'name': instance_name,
        'machineType': machine_type_url,
        'disks': [{
            'index' : 0,
            'autoDelete': 'false',
            'boot': 'true',
            'type': 'PERSISTENT',
            'mode' : 'READ_ONLY', # READ_ONLY, READ_WRITE
            'deviceName' : root_disk_name,
            'source' : source_root_disk
          }],
        'networkInterfaces': [{
          'accessConfigs': [{
            'type': 'ONE_TO_ONE_NAT',
            'name': 'External NAT'
           }],
          'network': network_url
        }],
        'serviceAccounts': [{
             'email': service_email,
             'scopes': scopes
        }]
    }

GC-CE 上启动实例的日志:

Changing serial settings was 0/0 now 3/0
Start bios (version 1.7.2-20131007_152402-google)
No Xen hypervisor found.
Unable to unlock ram - bridge not found
Ram Size=0x26600000 (0x0000000000000000 high)
Relocating low data from 0x000e10a0 to 0x000ef780 (size 2161)
Relocating init from 0x000e1911 to 0x265d07a0 (size 63291)
CPU Mhz=2601
=== PCI bus & bridge init ===
PCI: pci_bios_init_bus_rec bus = 0x0
=== PCI device probing ===
Found 4 PCI devices (max PCI bus is 00)
=== PCI new allocation pass #1 ===
PCI: check devices
=== PCI new allocation pass #2 ===
PCI: map device bdf=00:03.0  bar 0, addr 0000c000, size 00000040 [io]
PCI: map device bdf=00:04.0  bar 0, addr 0000c040, size 00000040 [io]
PCI: map device bdf=00:04.0  bar 1, addr febff000, size 00001000 [mem]
PCI: init bdf=00:01.0 id=8086:7110
PIIX3/PIIX4 init: elcr=00 0c
PCI: init bdf=00:01.3 id=8086:7113
Using pmtimer, ioport 0xb008, freq 3579 kHz
PCI: init bdf=00:03.0 id=1af4:1004
PCI: init bdf=00:04.0 id=1af4:1000
Found 1 cpu(s) max supported 1 cpu(s)
MP table addr=0x000fdaf0 MPC table addr=0x000fdb00 size=240
SMBIOS ptr=0x000fdad0 table=0x000fd9c0 size=269
Memory hotplug not enabled. [MHPE=0xffffffff]
ACPI DSDT=0x265fe1f0
ACPI tables: RSDP=0x000fd990 RSDT=0x265fe1c0
Scan for VGA option rom
WARNING - Timeout at i8042_flush:68!
All threads complete.
Found 0 lpt ports
Found 0 serial ports
found virtio-scsi at 0:3
Searching bootorder for: /pci@i0cf8/*@3/*@0/*@0,0
Searching bootorder for: /pci@i0cf8/*@3/*@0/*@1,0
virtio-scsi vendor='Google' product='PersistentDisk' rev='1' type=0 removable=0
virtio-scsi blksize=512 sectors=20971520
Searching bootorder for: /pci@i0cf8/*@3/*@0/*@2,0
...
Searching bootorder for: /pci@i0cf8/*@3/*@0/*@255,0
Scan for option roms
Searching bootorder for: HALT
drive 0x000fd950: 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 - 00000000265fe000 = 1 RAM
  4: 00000000265fe000 - 0000000026600000 = 2 RESERVED
  5: 00000000fffbc000 - 0000000100000000 = 2 RESERVED
Unable to lock ram - bridge not found
Changing serial settings was 3/2 now 3/0
enter handle_19:
  NULL
Booting from Hard Disk...
Booting from 0000:7c00
[    1.386940] i8042: No controller found
Loading, please wait...

INIT: version 2.88 booting

[[36minfo[39;49m] Using makefile-style concurrent boot in runlevel S.
[....] Starting the hotplug events dispatcher: udevd[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0c.
[....] Synthesizing the initial hotplug events...[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0cdone.
[....] Waiting for /dev to be fully populated...[    8.524814] piix4_smbus 0000:00:01.3:     SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0cdone.
[....] Activating swap...[?25l[?1c7[1G[[32m ok [39;49m8[?25h[?0cdone.
[....] Checking root file system...fsck from util-linux 2.20.1
fsck.ext4: Operation not permitted while trying to open /dev/sda1
You must have r/w access to the filesystem or be root
fsck died with exit status 8
[?25l[?1c7[1G[[31mFAIL[39;49m8[?25h[?0c[31mfailed (code 8).[39;49m
[....] An automatic file system check (fsck) of the root filesystem failed. A manual fsck     must be performed, then the system restarted. The fsck should be performed in maintenance     mode with the root filesystem mounted in read-only mode. ...[?25l[?1c7[1G[[31mFAIL[39;49m8[?    25h[?0c [31mfailed![39;49m
[....] The root filesystem is currently mounted in read-only mode. A maintenance shell will     now be started. After performing system maintenance, press CONTROL-D to terminate the     maintenance shell and restart the system. ...[?25l[?1c7[1G[[33mwarn[39;49m8[?25h[?0c                 [33m(warning).[39;49m
sulogin: root account is locked, starting shell
root@localhost:~# 

谢谢!

【问题讨论】:

    标签: ssh disk google-compute-engine


    【解决方案1】:

    您假设 GCE 实例的启动盘需要以读写模式出现是正确的。 documentation for root persistent disks 说:

    要在 gcutil 中使用现有根永久磁盘启动实例, 附加磁盘时提供引导参数。当你创建一个 使用 Google 提供的映像的根永久磁盘,您必须附加它 以读写模式发送到您的实例。如果您尝试将其附加到 只读模式,您的实例可能创建成功,但它 无法正常启动。

    【讨论】:

    • 谢谢!我部分理解你在说什么。这部分“当您创建根永久磁盘时......您必须以读写模式将其附加到您的实例”对我来说,只有当我第一次创建根永久磁盘时它才需要处于 RW 中.在我的情况下,我已经用图像创建了这个磁盘,只想启动而不覆盖里面的任何东西。有没有办法做到这一点?我的主要目标只是执行一个算法,在 SQS 中使用任务 X 并将结果 Y 写入 NoSQL 数据库,而无需在 HD 中写入任何内容。
    • 用于启动的永久性磁盘始终需要以 RW 模式挂载。如果您想要一个没有写入任何内容的映像,您可以使用一个 PD 进行引导,然后在 RO 模式下使用另一个 PD,其中包含您的应用程序。
    猜你喜欢
    • 1970-01-01
    • 2014-07-08
    • 1970-01-01
    • 1970-01-01
    • 2019-09-20
    • 2020-11-23
    • 1970-01-01
    • 2016-09-25
    • 1970-01-01
    相关资源
    最近更新 更多