# Setting sysctl variables in cloud-config

**URL:** <https://forums.suse.com/t/setting-sysctl-variables-in-cloud-config/15624>\
**Category:** RancherOS\
**Created:** [October 23, 2019, 8:23pm UTC](https://forums.suse.com/t/setting-sysctl-variables-in-cloud-config/15624 "2019-10-23T20:23:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alehed](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/alehed/32/5719_2.png) [@alehed](https://forums.suse.com/u/alehed)\
**Post date:** [October 23, 2019, 8:23pm UTC](https://forums.suse.com/t/setting-sysctl-variables-in-cloud-config/15624/1 "2019-10-23T20:23:53Z")

</div>

Hi,

I’m new to rancherOS, so I might be missing something obvious.

I really like the fact that the system can be configured using cloud-config, but I’m having trouble setting my cloud config such that it changes sysctl values. The relevant part of my config reads:

```auto
rancher:
  sysctl:
    kernel.shmmax: 4294967295
    kernel.shmall: 1048575

```

When adding this to the config via `ros config merge -i`, it successfully adds this to my cloud config, but the values are not set when querying them via `sysctl -a`, even after a reboot.

I also tried using `ros config set` in the following variations, but all of them give me the fatal error “Expected a struct or map but was a at line 90, column 6”.

```auto
sudo ros config set rancher.sysctl.kernel.shmmax "['4294967295']"
sudo ros config set rancher.sysctl.kernel.shmmax "[4294967295]"
sudo ros config set rancher.sysctl.kernel.shmmax [4294967295]
sudo ros config set rancher.sysctl.kernel.shmmax "4294967295"
sudo ros config set rancher.sysctl.kernel.shmmax '4294967295'
sudo ros config set rancher.sysctl.kernel.shmmax 4294967295

```

Apart from this issue, rancherOS works quite well for me so far.

Regards,  
Alexander

---

<div class="post-metadata">

**Author:** ![Danny\_Smith](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/danny_smith/32/5853_2.png) [@Danny\_Smith](https://forums.suse.com/u/Danny_Smith)\
**Post date:** [November 29, 2019, 6:10pm UTC](https://forums.suse.com/t/setting-sysctl-variables-in-cloud-config/15624/2 "2019-11-29T18:10:38Z")

</div>

> [@alehed](#):
>
> rancher: sysctl: kernel.shmmax: 4294967295 kernel.shmall: 1048575

I’m new here too, so not sure how much help this is.

I’m running v1.5.4 on VMWare, and I’ve been setting net.ipv6.conf.all.disable\_ipv6 in my cloud-config during install, and that’s been working fine for me.

I did wonder if the fact this was set in the installer’s cloud-config made a difference, so just attempted a ros config merge with the sysctl params you have above. Pleased to report that, on v1.5.4 at least, the params are set correctly after a reboot. Would be even better if they were dynamically set during the merge, but I guess you can’t have everything.

I can only guess that this has been fixed in the later release, or that there’s some other platform related issue.
