Extend Disk Size in RancherOS for ESXi

Hello everyone !

Cannot grown my file system on RancherOS 0.4.4 build. :frowning2:
Set an extra 20Gb on my VM (ESXi) and tried this to extend it:

rancher:
environment:
RESIZE_DEV: /dev/sda1
services_include:
resize-fs: true
ubuntu-console: true

… on /var/lib/rancher/conf/cloud-config.yml … rebooted, and the volume keeps the same size !

Based on this changelog: https://github.com/rancher/os/releases/tag/v0.4.4 … it should be fixed.

Help please.
Thank you.

Hi @jviegas,

the device name in RESIZE_DEV should be /dev/sda (without “1”). Sorry it’s confusing.

Thank you !

Worked like a charm :wink:

I am using RancherOS v1.1.0-rc3 as it works with vsphere 6.5’s vmware tools. I am trying to resize the volume as it’s stuck at 1000M but I can’t seem to figure it out. If I use ros config and set the RESIZE_DEV: /dev/sda and then validate it, the message I get is ERRO[0000] resize-fs:: Additional property resize-fs: is not allowed. If I reboot, the property goes away from the cloud-config.yml and it doesn’t actually resize it.

If anyone can help, it would be greatly appreciated.

I should mention, I am using docker-machine to build this.

Interesting. Did they change the property at some point? I recently had to resize my vmware drives, and (successfully) used the following config snippet:

rancher:
  resize_device: /dev/sda

Of course, I’m running 1.0.3, so I’m not at all surprised.

It is “normal”
RancherOs is not install on disk but is load inside RAM.
Your disk is not used at all.

[docker@rancheros-vsphere--dba32a9b-5ffc-4d4d-9b50-db8d0b4de40a ~]$ cat /etc/os-release 
NAME="RancherOS"
VERSION=v1.1.0-rc3
ID=rancheros
ID_LIKE=
VERSION_ID=v1.1.0-rc3
PRETTY_NAME="RancherOS v1.1.0-rc3"
HOME_URL="http://rancher.com/rancher-os/"
SUPPORT_URL="http://forums.rancher.com/c/rancher-os"
BUG_REPORT_URL="https://github.com/rancher/os/issues"
BUILD_ID=
[docker@rancheros-vsphere--dba32a9b-5ffc-4d4d-9b50-db8d0b4de40a ~]$ sudo mount
overlay on / type overlay (rw,relatime,lowerdir=/var/lib/system-docker/overlay/dd5936029be79281f70d53dbc7640f78b46811a5f3d70e4f29b6983789bb63cb/root,upperdir=/var/lib/system-docker/overlay/2c9a47f0f65382611ac9cdc45fdd968420e3bc52c7a7059ee1bb6e751eca8ab4/upper,workdir=/var/lib/system-docker/overlay/2c9a47f0f65382611ac9cdc45fdd968420e3bc52c7a7059ee1bb6e751eca8ab4/work)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
none on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
none on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
none on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
none on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
none on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
none on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
none on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
none on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
none on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
none on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
none on /run type tmpfs (rw,relatime)
tmpfs on /media type tmpfs (rw,relatime)
rootfs on /opt type rootfs (rw,size=3035348k,nr_inodes=758837)
tmpfs on /mnt type tmpfs (rw,relatime)
rootfs on /home type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /var/log type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /usr/lib/firmware type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /usr/lib/modules type rootfs (rw,size=3035348k,nr_inodes=758837)
devtmpfs on /host/dev type devtmpfs (rw,relatime,size=3035356k,nr_inodes=758839,mode=755)
none on /host/dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
shm on /host/dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
mqueue on /host/dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
rootfs on /usr/sbin/iptables type rootfs (ro,size=3035348k,nr_inodes=758837)
rootfs on /etc/docker type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /etc/selinux type rootfs (rw,size=3035348k,nr_inodes=758837)
none on /var/run type tmpfs (rw,relatime)
rootfs on /etc/logrotate.d type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /usr/share/ros type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /usr/bin/ros type rootfs (ro,size=3035348k,nr_inodes=758837)
rootfs on /var/lib/docker type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /var/lib/rancher type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /etc/ssl/certs/ca-certificates.crt.rancher type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /var/lib/rancher/cache type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /var/lib/rancher/conf type rootfs (rw,size=3035348k,nr_inodes=758837)
rootfs on /etc/resolv.conf type rootfs (rw,size=3035348k,nr_inodes=758837)
tmpfs on /etc/hostname type tmpfs (rw,relatime)
rootfs on /etc/hosts type rootfs (rw,size=3035348k,nr_inodes=758837)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
devtmpfs on /dev type devtmpfs (rw,relatime,size=3035356k,nr_inodes=758839,mode=755)
none on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/selinux type selinuxfs (ro,relatime)
rootfs on /var/lib/docker/overlay type rootfs (rw,size=3035348k,nr_inodes=758837)
tmpfs on /tmp type tmpfs (rw,relatime)
[docker@rancheros-vsphere--dba32a9b-5ffc-4d4d-9b50-db8d0b4de40a ~]$ sudo mount | grep /dev/sda
[docker@rancheros-vsphere--dba32a9b-5ffc-4d4d-9b50-db8d0b4de40a ~]$
[docker@rancheros-vsphere--dba32a9b-5ffc-4d4d-9b50-db8d0b4de40a ~]$ sudo fdisk -l /dev/sda
Disk /dev/sda: 19.5 GiB, 20971520000 bytes, 40960000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

You need to know too, that the “resize-always” is not implemented yet or it not suitable with VSphere.
The"resize" happen only at the first boot and you will need a trick if you want a implement “resize-always” (#rancher-os )

Personally , I used this cloud-config to be able to provision my VM by docker-machine, install RancherOS on disk, and activate the “resize-always”.

Best regards,