nforgeio / neonKUBE

Public NeonKUBE Kubernetes distribution related projects
https://neonkube.io
Apache License 2.0
80 stars 13 forks source link

Cannot configure OS disk with size equal to the minimum allowed #1352

Closed jefflill closed 2 years ago

jefflill commented 2 years ago

Specifying a 64 GiB OS disk as specified below doesn't work:

name: tiny-hyperv
datacenter: $<<<profile:home.datacenter>>>
environment: development
timeSources:
- pool.ntp.org
kubernetes:
  allowPodsOnMasters: true
hosting:
  environment: hyperv-local
  vm:
    cores: 4
    memory: 8 GiB
    osDisk: 64 GiB                         <-------------- LIKE THIS
    diskLocation: $<<<profile:home.hyperv.diskfolder>>>
network:
  premiseSubnet: $<<<profile:home.lan.subnet>>>
  gateway: $<<<profile:home.lan.gateway>>>
  nameservers:
    - $<<<profile:home.lan.dns0>>>
    - $<<<profile:home.lan.dns1>>>
openEbs:
  engine: cstor
nodes:
  master-0:
    role: master
    address: $<<<profile:home.cluster.hyperv.node0.ip>>>
    openEbsStorage: true

Here's what we see in the log:

*** STATUS: resize: OS disk
START: sudo bash -c 'growpart /dev/sda 2'
END [ERROR=1]
*** STATUS: ERROR[1]
*** ERROR: [Neon.SSH.RemoteCommandException]: [exitcode=1]: sudo bash -c 'export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/lib/neonkube/bin && growpart /dev/sda 2'

NOCHANGE: partition 2 could only be grown by 2015 [fudge=2048]

*** ERROR: [Neon.SSH.RemoteCommandException]: [exitcode=1]: sudo bash -c 'export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/lib/neonkube/bin && growpart /dev/sda 2'

NOCHANGE: partition 2 could only be grown by 2015 [fudge=2048]

*** STACK:
   at Neon.SSH.LinuxSshProxy.RunCommand(String command, RunOptions runOptions, Object[] args) in C:\src\neonKUBE\Lib\Neon.SSH\LinuxSshProxy.cs:line 2390
   at Neon.SSH.LinuxSshProxy.SudoCommand(String command, RunOptions runOptions, Object[] args) in C:\src\neonKUBE\Lib\Neon.SSH\LinuxSshProxy.cs:line 2461
   at Neon.Kube.HyperVLocalHostingManager.ProvisionVM(NodeSshProxy`1 node) in C:\src\neonKUBE\Lib\Neon.Kube.HyperVLocal\HyperVLocalHostingManager.cs:line 612
   at Neon.Kube.HyperVLocalHostingManager.<>c__DisplayClass19_0.<AddProvisioningSteps>b__3(ISetupController controller, NodeSshProxy`1 node) in C:\src\neonKUBE\Lib\Neon.Kube.HyperVLocal\HyperVLocalHostingManager.cs:line 272
   at Neon.Kube.SetupController`1.<>c__DisplayClass34_2.<ExecuteStep>b__3(NodeSshProxy`1 node) in C:\src\neonKUBE\Lib\Neon.Kube\SetupController\SetupController.cs:line 844
jefflill commented 2 years ago

Currently, the minimum OS disk size is 64GiB (but we may reduce this in the future) and the default OS disk size is 128GiB.

The problem here is that growpart returns a non-zero exit code when the partition is already as big as it can be. I thin the easiest fix is to look for NOCHANGE: in the response and consider this not to be an error in this case.

We used to ignore growpart errors until recently which is why we didn't notice this before.

jefflill commented 2 years ago

FIXED