Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] crc 1.18 crc config set disk-size not respected on macos #1640

Closed
csantanapr opened this issue Nov 4, 2020 · 16 comments
Closed

[BUG] crc 1.18 crc config set disk-size not respected on macos #1640

csantanapr opened this issue Nov 4, 2020 · 16 comments
Assignees
Labels
kind/bug Something isn't working points/1 priority/minor status/pinned Prevents the stale bot from closing the issue

Comments

@csantanapr
Copy link

csantanapr commented Nov 4, 2020

Trying to set the disk size to 50GB with crc config set disk-size 50 doesn't work

General information

  • OS: macOS
  • Hypervisor: hyperkit
  • Did you run crc setup before starting it (Yes/No)? Yes
  • Running CRC on: Laptop

CRC version

❯ crc version
CodeReady Containers version: 1.18.0+bb304aa
OpenShift version: 4.6.1 (embedded in binary)

CRC status

crc status --log-level debug
DEBU CodeReady Containers version: 1.18.0+bb304aa
DEBU OpenShift version: 4.6.1 (embedded in binary)
Checking file: /Users/csantana23/.crc/machines/crc/.crc-exist
DEBU About to run SSH command with hidden output
DEBU SSH command succeeded
DEBU image-registry operator is degraded, Reason: ImagePrunerJobFailed
DEBU About to run SSH command:
df -B1 --output=size,used,target /sysroot | tail -1
DEBU SSH command results: err: <nil>, output: 32720793600 12768727040 /sysroot
CRC VM:          Running
OpenShift:       Running (v4.6.1)
Disk Usage:      12.77GB of 32.72GB (Inside the CRC VM)
Cache Usage:     15.26GB
Cache Directory: /Users/csantana23/.crc/cache

CRC config

crc config view
- cpus                                  : 6
- disk-size                             : 50
- memory                                : 20384

Host Operating System

sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H2

Steps to reproduce

  1. crc delete
  2. crc setup
  3. crc config set cpus 6
  4. crc config set memory 20384
  5. crc config set disk-size 50

Expected

Expect VM disk size to be 50GB

Actual

VM Disk size is the default 33GB

Logs

crc start -p ~/Downloads/pull-secret.txt
INFO Checking if oc binary is cached
INFO Checking if podman remote binary is cached
INFO Checking if goodhosts binary is cached
INFO Checking minimum RAM requirements
INFO Checking if running as non-root
INFO Checking if HyperKit is installed
INFO Checking if crc-driver-hyperkit is installed
INFO Checking file permissions for /etc/hosts
INFO Checking file permissions for /etc/resolver/testing
INFO Loading bundle: crc_hyperkit_4.6.1.crcbundle ...
INFO Checking size of the disk image /Users/csantana23/.crc/cache/crc_hyperkit_4.6.1/crc.qcow2 ...
INFO Creating CodeReady Containers VM for OpenShift 4.6.1...
INFO CodeReady Containers VM is running
INFO Generating new SSH Key pair ...
INFO Updating authorized keys ...
INFO Copying kubeconfig file to instance dir ...
INFO Starting network time synchronization in CodeReady Containers VM
INFO Network restart not needed
INFO Check internal and public DNS query ...
INFO Check DNS query from host ...
INFO Adding user's pull secret to instance disk...
INFO Verifying validity of the kubelet certificates ...
INFO Starting OpenShift kubelet service
INFO Configuring cluster for first start
INFO Adding user's pull secret to the cluster ...
INFO Updating cluster ID ...
INFO Starting OpenShift cluster ... [waiting 3m]
INFO Updating kubeconfig
WARN The cluster might report a degraded or error state. This is expected since several operators have been disabled to lower the resource usage. For more information, please consult the documentation
Started the OpenShift cluster

Tried to pass via flag -d and I get WARN messages, I get same result VM is 33GB

crc start -p ~/Downloads/pull-secret.txt -d 50
INFO Checking if oc binary is cached
INFO Checking if podman remote binary is cached
INFO Checking if goodhosts binary is cached
INFO Checking minimum RAM requirements
INFO Checking if running as non-root
INFO Checking if HyperKit is installed
INFO Checking if crc-driver-hyperkit is installed
INFO Checking file permissions for /etc/hosts
INFO Checking file permissions for /etc/resolver/testing
INFO Starting CodeReady Containers VM for OpenShift 4.6.1...
WARN Memory configuration change has been ignored as the machine driver does not support it
WARN CPU configuration change has been ignored as the machine driver does not support it
WARN Disk size configuration change has been ignored as the machine driver does not support it
INFO CodeReady Containers VM is running
INFO Starting network time synchronization in CodeReady Containers VM
INFO Network restart not needed
INFO Check internal and public DNS query ...
INFO Check DNS query from host ...
INFO Verifying validity of the kubelet certificates ...
INFO Starting OpenShift kubelet service
INFO Starting OpenShift cluster ... [waiting 3m]
INFO Updating kubeconfig
@csantanapr csantanapr added the kind/bug Something isn't working label Nov 4, 2020
@gbraad
Copy link
Contributor

gbraad commented Nov 4, 2020

crc config set memory 20384
crc config set disk-size 50

there is no unit given so 50 will be interpreted the same as 20384 was. This also does not result in 20384GB, but 20GB... right?

@guillaumerose
Copy link
Contributor

It is not yet implemented on macOS.

@cfergeau
Copy link
Contributor

cfergeau commented Nov 4, 2020

Yes, not implemented yet, see crc-org/machine-driver-hyperkit#18

Note that there is a warning about it in the logs:

WARN Memory configuration change has been ignored as the machine driver does not support it
WARN CPU configuration change has been ignored as the machine driver does not support it
WARN Disk size configuration change has been ignored as the machine driver does not support it

(and I see there's also a bug in that code :( )

Regarding the unit, disk sizes are in GiB while memory sizes are in MiB

  -d, --disk-size uint            Total size in GiB of the disk used by the OpenShift cluster (default 31)
  -m, --memory int                MiB of memory to allocate to the OpenShift cluster (default 9216)

@gbraad
Copy link
Contributor

gbraad commented Nov 4, 2020

It is not yet implemented on macOS.

Please create follow-up issues accordingly for the remaining work/platform support, or re-use this one to add macOS support.

@csantanapr
Copy link
Author

csantanapr commented Nov 5, 2020

@gbraad

there is no unit given so 50 will be interpreted the same as 20384 was. This also does not result in 20384GB, but 20GB... right?

values do not take units.
For disk-size the fixed unit is GB, so 50 without a unit is 50GB
For memory the fixed unit is MiB, so 20480 without a unit is 20GB

@csantanapr
Copy link
Author

@cfergeau

Note that there is a warning about it in the logs:

Why do I get Warnings? when cpu and memory work fine when I set them with crc config set cpus 6 crc config set memory 20480

WARN CPU configuration change has been ignored as the machine driver does not support it
WARN Disk size configuration change has been ignored as the machine driver does not support it

@csantanapr
Copy link
Author

@guillaumerose

It is not yet implemented on macOS.

Looking forward, please 🙏

@guillaumerose
Copy link
Contributor

@csantanapr if you really need it now, you can take qcow-tool here https://github.com/code-ready/machine-driver-hyperkit/releases/tag/v0.12.9 and use it to resize your disk. Then inside, the VM you still need to run xfs_growfs.

@schmaustech
Copy link

I have used qemu-img to resize the qcow2 in previous versions but this latest 1.18 version with OCP 4.6.1 doesn't seem to allow for that resize either

INFO Starting CodeReady Containers VM for OpenShift 4.6.1...
Could not update CRC VM configuration: virError(Code=8, Domain=18, Message='invalid argument: Can't shrink capacity below current capacity unless shrink flag explicitly specified')

@gbraad
Copy link
Contributor

gbraad commented Nov 6, 2020

@gbraad

there is no unit given so 50 will be interpreted the same as 20384 was. This also does not result in 20384GB, but 20GB... right?

values do not take units.
For disk-size the fixed unit is GB, so 50 without a unit is 50GB
For memory the fixed unit is MiB, so 20480 without a unit is 20GB

I am questioning this as this is not how minishift worked.
Unit imho are needed to avoid ambiguity

@cfergeau
Copy link
Contributor

cfergeau commented Nov 12, 2020

I have used qemu-img to resize the qcow2 in previous versions but this latest 1.18 version with OCP 4.6.1 doesn't seem to allow for that resize either

INFO Starting CodeReady Containers VM for OpenShift 4.6.1...
Could not update CRC VM configuration: virError(Code=8, Domain=18, Message='invalid argument: Can't shrink capacity below current capacity unless shrink flag explicitly specified')

Well, I'll first point out that this was a totally unsupported way of resizing disk images... You should be able to workaround this error by setting the disk size in the config to something bigger than the size you gave to your disk image.
PS: this discussion is totally unrelated to the initial bug report, which is about --disk-size not working on macos.

@cfergeau cfergeau changed the title [BUG] crc 1.18 crc config set disk-size no respected [BUG] crc 1.18 crc config set disk-size no respected on macos Nov 17, 2020
@stale
Copy link

stale bot commented Jan 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/stale Issue went stale; did not receive attention or no reply from the OP label Jan 17, 2021
@guillaumerose guillaumerose added the status/pinned Prevents the stale bot from closing the issue label Jan 17, 2021
@stale stale bot removed the status/stale Issue went stale; did not receive attention or no reply from the OP label Jan 17, 2021
@cfergeau
Copy link
Contributor

This might be dependent on #1850

@guillaumerose
Copy link
Contributor

It will be available in the next crc release (1.29.0).

@cfergeau
Copy link
Contributor

Closing this as everything is merged, we can reopen if needed.

@gbraad gbraad changed the title [BUG] crc 1.18 crc config set disk-size no respected on macos [BUG] crc 1.18 crc config set disk-size not respected on macos Jun 23, 2021
@csantanapr
Copy link
Author

Thank you for the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working points/1 priority/minor status/pinned Prevents the stale bot from closing the issue
Projects
None yet
Development

No branches or pull requests

5 participants