Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Formatting disk #2381

Closed
drpebcak opened this issue Jun 7, 2018 · 2 comments
Closed

Formatting disk #2381

drpebcak opened this issue Jun 7, 2018 · 2 comments
Assignees

Comments

@drpebcak
Copy link
Contributor

drpebcak commented Jun 7, 2018

RancherOS Version: (ros os version)
v1.4.0

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
AWS

I am attempting to use cloud-config to format and mount the ephemeral instance store in a new m5d instance:

#cloud-config
bootcmd:
  - [ mkfs.ext2, /dev/nvme1n1 ]
mounts:
  - [ /dev/nvme1n1, /storage, ext2, "" ]
rancher:
  docker:
    extra_args:
      - "-g"
      - /storage

When the instance starts up, /storage exists, and user-docker has put its state there. However, nvme1n1 is not formatted, and there is no mount on /storage

Any ideas? I have been unable to find any logs or errors that show what is happening during the bootstrap.

@Jason-ZW
Copy link

Jason-ZW commented Jun 8, 2018

@drpebcak bootcmd will be executed while RancherOS is still running from memory and before System Docker and any system services are started. Therefore, bootcmd cannot read the cloud-config.yml file which configured by the user in the console container.

You can use runcmd instead of bootcmd:

#cloud-config
runcmd:
  - [ mkfs.ext2, /dev/nvme1n1 ]
  - [ mkdir, -p, /storage]
  - [ mount, -t, ext2, /dev/nvme1n1, /storage ]
rancher:
  docker:
    extra_args:
      - "-g"
      - /storage

@drpebcak
Copy link
Contributor Author

Ah, of course that makes sense. Thanks @Jason-ZW, your suggestion works perfectly!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants