Skip to content

GrowRootAPFSVolume module errors if there's no space to grow #41

@mattcataws

Description

@mattcataws

The addition of the GrowRootAPFSVolume in version 1.5.7 calls ec2-macos-utils to attempt to grow the root APFS volume to the maximum size of the EBS volume. An error is returned by ec2-macos-utils in the case that there isn't enough space to grow the root volume. For example, the default EBS volume size for EC2 mac instances is 100GB and there's no additional room to expand the APFS volume.

The error logs look like the following:

2023/06/07 22:39:42.931118 Error while running module [GrowRootAPFSVolume] (type: command, group: 3) with message:  and err: ec2macosinit: error executing command [[/bin/zsh -c ec2-macos-utils grow --id root]] with stdout [] and stderr [time="07 Jun 23 22:39 GMT" level=info msg="Configuring diskutil for product" product="macOS Ventura 13.4.0"
time="07 Jun 23 22:39 GMT" level=info msg="Attempting to grow container..." device_id=diskXsX
time="07 Jun 23 22:39 GMT" level=info msg="Checking if device can be APFS resized..." device_id=diskXsX
time="07 Jun 23 22:39 GMT" level=info msg="Device can be resized"
time="07 Jun 23 22:39 GMT" level=info msg="Repairing the parent disk..."
time="07 Jun 23 22:39 GMT" level=info msg="Repairing parent disk..." parent_id=diskY
time="07 Jun 23 22:39 GMT" level=info msg="Successfully repaired the parent disk"
time="07 Jun 23 22:39 GMT" level=info msg="Fetching amount of free space on device..." device_id=diskX
time="07 Jun 23 22:39 GMT" level=warning msg="Available free space does not meet required minimum to grow" required_minimum="1.0 MB" total_free="41 kB"
Error: not enough space to resize container: 40960 bytes available]: exit status 1

This causes unnecessary error logs for ec2-macos-init since it is an expected use case now and isn't a "real" error. It would be best to add support to suppress error messages in ec2-macos-utils to prevent it from reporting as an error in ec2-macos-init.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions