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

ensure that /dev has settled before operating #3195

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

davidovich
Copy link
Contributor

Minikube automount relies on a VM disk to be mounted (usually /dev/sda)
to provide .ssh credentials.

This commit adds a dependency on systemd-udev-settle to ensure that all devices
(including disks) are up and available before executing the mount
script.

We use systemd-udev-settle
https://github.com/systemd/systemd/blob/master/units/systemd-udev-settle.service.in

To ensure this. Note that in the above link, we can read a comment
stating that systemd-udev-settle is used to ensure a populated /dev
during bootup, which is exaclty what we want.

closes #3167

Note that it may close other ssh related issues on several platforms.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Oct 1, 2018
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 1, 2018
@davidovich
Copy link
Contributor Author

I have a cncf account, I'm not sure why the bot didn't pick it up.

Minikube automount relies on a VM disk to be mounted (usually /dev/sda)
to provide .ssh credentials.

This commit adds a dependency on systemd-udev-settle to ensure that all devices
(including disks) are up and available before executing the mount
script.

We use systemd-udev-settle
https://github.com/systemd/systemd/blob/master/units/systemd-udev-settle.service.in

To ensure this. Note that in the above link, we can read a comment
stating that systemd-udev-settle is used to ensure a populated /dev
during bootup, which is exaclty what we want.

Signed-off-by: David Genest <david.genest@gmail.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 1, 2018
@davidovich
Copy link
Contributor Author

The boot sequence is now as desired:

Oct 01 19:36:04 minikube kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
Oct 01 19:36:04 minikube kernel: sd 2:0:0:0: [sda] 40960000 512-byte logical blocks: (21.0 GB/19.5 GiB)
Oct 01 19:36:04 minikube kernel: sd 2:0:0:0: [sda] Write Protect is off
Oct 01 19:36:04 minikube kernel: sd 2:0:0:0: [sda] Mode Sense: 0f 00 00 00
Oct 01 19:36:04 minikube kernel: sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct 01 19:36:04 minikube kernel: cdrom_id (2066) used greatest stack depth: 14024 bytes left
Oct 01 19:36:04 minikube kernel: sd 2:0:0:0: [sda] Attached SCSI disk

occurs before the minikube-automount script is run, (Below I only pasted a partial output (related to /dev/sda)):

Oct 01 19:36:04 minikube minikube-automount[2189]: + BOOT2DOCKER_DATA=
Oct 01 19:36:04 minikube minikube-automount[2189]: ++ cut -f1 '-d '
Oct 01 19:36:04 minikube minikube-automount[2189]: ++ lsblk
Oct 01 19:36:04 minikube minikube-automount[2189]: ++ grep disk
Oct 01 19:36:04 minikube minikube-automount[2189]: + UNPARTITIONED_HD=/dev/sda
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo
Oct 01 19:36:04 minikube minikube-automount[2189]: + '[' '!' -n '' ']'
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo 'Is the disk unpartitioned?, test for the '\''boot2docker format-me'\'' string'
Oct 01 19:36:04 minikube minikube-automount[2189]: Is the disk unpartitioned?, test for the 'boot2docker format-me' string
Oct 01 19:36:04 minikube minikube-automount[2189]: + grep 'Partition Table: unknown'
Oct 01 19:36:04 minikube minikube-automount[2189]: + parted --script /dev/sda print
Oct 01 19:36:04 minikube minikube-automount[2189]: Error: /dev/sda: unrecognised disk label
Oct 01 19:36:04 minikube minikube-automount[2189]: Partition Table: unknown
Oct 01 19:36:04 minikube minikube-automount[2189]: + '[' 0 -eq 0 ']'
Oct 01 19:36:04 minikube minikube-automount[2189]: ++ dd if=/dev/sda bs=1 count=29
Oct 01 19:36:04 minikube minikube-automount[2189]: + HEADER='boot2docker, please format-me'
Oct 01 19:36:04 minikube minikube-automount[2189]: + '[' 'boot2docker, please format-me' = 'boot2docker, please format-me' ']'
Oct 01 19:36:04 minikube minikube-automount[2189]: + dd if=/dev/sda of=/userdata.tar bs=1 count=4096
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo 'NEW boot2docker managed disk image (/dev/sda): formatting it for use'
Oct 01 19:36:04 minikube minikube-automount[2189]: NEW boot2docker managed disk image (/dev/sda): formatting it for use
Oct 01 19:36:04 minikube minikube-automount[2189]: + fdisk /dev/sda
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo n
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo p
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo 2
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo +1000M
Oct 01 19:36:04 minikube minikube-automount[2189]: + echo w
Oct 01 19:36:04 minikube minikube-automount[2189]: Welcome to fdisk (util-linux 2.32).
Oct 01 19:36:04 minikube minikube-automount[2189]: Changes will remain in memory only, until you decide to write them.
Oct 01 19:36:04 minikube minikube-automount[2189]: Be careful before using the write command.
Oct 01 19:36:04 minikube minikube-automount[2189]: Device does not contain a recognized partition table.
Oct 01 19:36:04 minikube minikube-automount[2189]: Created a new DOS disklabel with disk identifier 0x541d1d35.
Oct 01 19:36:04 minikube minikube-automount[2189]: Command (m for help): Partition type
Oct 01 19:36:04 minikube minikube-automount[2189]:    p   primary (0 primary, 0 extended, 4 free)
Oct 01 19:36:04 minikube minikube-automount[2189]:    e   extended (container for logical partitions)
Oct 01 19:36:04 minikube minikube-automount[2189]: Select (default p): Partition number (1-4, default 1): First sector (2048-40959999, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-40959999, default 40959999):
Oct 01 19:36:04 minikube minikube-automount[2189]: Created a new partition 2 of type 'Linux' and of size 1000 MiB.

@davidovich
Copy link
Contributor Author

I believe #2126 is related and would be fixed by this.

@tstromberg tstromberg added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 1, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: davidovich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tstromberg
Copy link
Contributor

@minikube-bot - OK to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ssh keys are not mounted through boot2docker VM disk image
4 participants