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

Installer needs a user friendly error message if there are disk partitions. #2060

Closed
liyimeng opened this issue Aug 23, 2017 · 14 comments
Closed
Assignees
Milestone

Comments

@liyimeng
Copy link

liyimeng commented Aug 23, 2017

RancherOS Version: (ros os version)
v1.1.0-rc3/v1.0.4
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
KVM

The below is error output

[rancher@rancher ~]$ sudo ros install -c cloud-config -d /dev/vda 
INFO[0000] No install type specified...defaulting to generic 
Installing from rancher/os:v1.1.0-rc3
Continue [y/N]: y
INFO[0002] start !isoinstallerloaded                    
mount: mounting /dev/sr0 on /bootiso failed: No such file or directory
ERRO[0002] tried and failed to mount /dev/sr0: exit status 255 
INFO[0002] starting installer container for rancher/os:v1.1.0-rc3 (new) 
Unable to find image 'rancher/os:v1.1.0-rc3' locally
v1.1.0-rc3: Pulling from rancher/os
88286f41530e: Pull complete 
4c2fc341d774: Pull complete 
8ce6e295724b: Pull complete 
a5c4fa7adbfd: Pull complete 
84cd47ea47e8: Pull complete 
5397957da3d2: Pull complete 
5fdbb6cc708d: Pull complete 
c6a2ed46ef90: Pull complete 
4b014047e254: Pull complete 
907e84a3fa44: Pull complete 
Digest: sha256:70cc8d54fd8d33a576290593bd5d04312641c5940d6e4743c5abdc6b2ea2d76b
Status: Downloaded newer image for rancher/os:v1.1.0-rc3
Installing from rancher/os:v1.1.0-rc3
time="2017-08-23T12:23:51Z" level=info msg="start !isoinstallerloaded" 
time="2017-08-23T12:23:51Z" level=error msg="partprobe error exit status 127" 
time="2017-08-23T12:23:51Z" level=error msg="error setDiskpartitions exit status 127" 
time="2017-08-23T12:23:51Z" level=fatal msg="Failed to run install" err="exit status 127" 
Error response from daemon: Unable to remove filesystem for d65d4846bded9e3fe4bee31995f6447890cbbbbe9a3afa5619fa66fe744c520d: remove /var/lib/system-docker/containers/d65d4846bded9e3fe4bee31995f6447890cbbbbe9a3afa5619fa66fe744c520d: structure needs cleaning
FATA[0018] Failed to run install                         err="exit status 1"
@liyimeng
Copy link
Author

The same issue is on v1.0.4
This used fo work flawless early version, e.g. v0.5

@liyimeng
Copy link
Author

Together with issue #1790, make installing from iso become the only way to use RancherOS now, pretty frustrated. Anyway have similar issue?

@SvenDowideit
Copy link
Contributor

nope - this works for me, and for our testers. what kind of a baremetal disk is /dev/vda ?

@liyimeng
Copy link
Author

It is actually a KVM VM, I suppose it is no big difference here. I am working around the issue with using v0.7.0, working nicely.
Thanks!

@SvenDowideit
Copy link
Contributor

awesome! can you tell us the commands you're using to start KVM, and how you're using PXE, including the cmdline you're using for it?

@SvenDowideit
Copy link
Contributor

@liyimeng mmm, and can you boot with rancher.debug=true and then run the same install again? I think you've shown me a bug I overlooked.

@SvenDowideit
Copy link
Contributor

SvenDowideit commented Aug 25, 2017

using

sudo  $(which pixiecore)  boot --cmdline "\
rancher.password=rancher rancher.autologin=tty1 \
rancher.bootstrap_docker.registry_mirror=${ENGINE_REGISTRY_MIRROR} \
rancher.system_docker.registry_mirror=${ENGINE_REGISTRY_MIRROR} \
rancher.docker.registry_mirror=${ENGINE_REGISTRY_MIRROR} \
" vmlinuz-* initrd-*

on a 1G ram vmware vm (which then auto loads open-vm-tools), and then running sudo ros install -d /dev/sda works correctly - and the new syslinux boot menu allows me to select "autologin"

(and then the same with real baremetal)

I'm having some weird issues with my kvm, so @liyimeng I'm very interested to see how you're starting yours.

@SvenDowideit SvenDowideit added this to the v1.1.1 milestone Aug 25, 2017
@liyimeng
Copy link
Author

I ipxe boot it with dnsamsq, using this boot script.

#!ipxe

set base-url http://10.10.10.1:8000
kernel ${base-url}/vmlinuz rancher.autologin=tty1 rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda,/dev/vda] rancher.cloud_init.datasources=[url:${base-url}/cloud-config]
initrd ${.base-url}/initrd

I have post the entire testing procedure in #1790 . However, I have not enable debug. will redo with by adding debug. Back to you with new updates soon.

@liyimeng
Copy link
Author

Ok, here is some logs from file /var/log/messages,

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Aug 25 11:56:21 rancher kernel: [    0.000000] Linux version 4.9.40-rancher (root@fa4bbabf4ef2) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) 
#1 SMP Fri Jul 28 04:17:20 UTC 2017
Aug 25 11:56:21 rancher kernel: [    0.000000] Command line: rancher.autologin=tty1 rancher.debug=true rancher.state.dev=LABEL=RANCHER_STATE rancher.state.aut
oformat=[/dev/sda,/dev/vda] rancher.cloud_init.datasources=[url:http://10.10.10.1:8000/cloud-config]
Aug 25 11:56:21 rancher kernel: [    0.000000] KERNEL supported cpus:
Aug 25 11:56:21 rancher kernel: [    0.000000]   Intel GenuineIntel
Aug 25 11:56:21 rancher kernel: [    0.000000]   AMD AuthenticAMD
....

I don't know where to get meaningful message, e.g. all console output :(

@liyimeng
Copy link
Author

liyimeng commented Aug 25, 2017

There seems random state somewhere, I have tried run the test for 5 itmes: ipxe boot -> install to disk.
I actually get it worked once, other 4 attempts failed. iPXE boot never load the cloud-config and setup the system as expected.

@SvenDowideit
Copy link
Contributor

mmm, i suspect rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/sda,/dev/vda] is the problem - that will auto format your disk and set it up as a state partition, which then should make it unavailable for installing to.

if that's the problem, the installer needs to detect this and tell you something more useful.

@liyimeng
Copy link
Author

@SvenDowideit I remove the texts and it is possible to install. Thanks a lot Sven! Do you have a chance to look into the problem I reported in #1790 . iPXE use to work like charm early. I don't know why it get broken for me.

@SvenDowideit SvenDowideit changed the title install to disk is not working after PXE boot Installer needs a user friendly error message if there are disk partitions. Sep 18, 2017
@niusmallnan niusmallnan modified the milestones: v1.1.1, v1.1.3 Dec 22, 2017
@niusmallnan niusmallnan self-assigned this Dec 22, 2017
@niusmallnan
Copy link
Contributor

if there are disk partitions, it can print these logs:

time="2018-01-17T03:30:58Z" level=info msg="start !isoinstallerloaded"
time="2018-01-17T03:30:58Z" level=debug msg="running installation"
time="2018-01-17T03:30:58Z" level=debug msg="running setDiskpartitions"
time="2018-01-17T03:30:58Z" level=debug msg=setDiskpartitions
time="2018-01-17T03:30:58Z" level=debug msg="device /dev/sda already partitioned - checking if any are mounted"
time="2018-01-17T03:30:58Z" level=error msg="partition /dev/sda mounted, cannot repartition"
time="2018-01-17T03:30:58Z" level=error msg="error setDiskpartitions partition /dev/sda mounted, cannot repartition"

@kingsd041
Copy link
Contributor

Tested with RancherOS v1.2.0-rc2.
Test passed.

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

4 participants