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

providers: add initial zVM hypervisor support #865

Merged
merged 1 commit into from
Nov 4, 2019

Conversation

zhengxiaomei123
Copy link
Contributor

Support extracting an Ignition config from the reader device on z/VM platform. It doesn't require network setup in the initramfs, nor waiting for a config-drive that may not show up.

Fixes #810

@coreosbot
Copy link
Contributor

Can one of the admins verify this patch?

@lucab
Copy link
Contributor

lucab commented Sep 27, 2019

ok to test

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
return (err == nil)
}
}
_, err = logger.LogCmd(exec.Command("udevadm", "settle", "||", "udevsettle"), "Settle udev device")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands are invoked directly, so shell functions are not available (||). Does this actually work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if "udevadm settle" failed ,run "udevsettle" . It worked.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably worked because udevadm ignored the || and udevsettle arguments. This should be handled by the distro package; it exists to allow setting different commands at link-time so it can be compiled against different distros with different commands.

Actually, the udevsettle can almost certainly be dropped. Ignition depends on systemd, which means udevadm should always exist.

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
_, err := f.Logger.LogCmd(exec.Command("/sbin/vmur", "re", "-f", spoolid, file), "Receive the spool file")
if err == nil {
f.Logger.Info("using config file at %q", file)
_, err := f.Logger.LogCmd(exec.Command("tar", "-xzvf", file), "Extract the spool file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are spool files always sent as compressed tarballs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tarballs are not necessary for spool files. But for ignition config JSON file, the vmur tools will format the config file which cause parse failure. So tarball can avoid the ignition config JSON file be formatted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. Are you saying that the spool file is not presenting a tarball but vmur is converting it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^ Can you clarify about my previous question?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I forgot this question. I mean If not using tarball, vmur will format the json config file with padding char. There will error when do later ParseConfig operation. So to avoid the config file being formatted , I chose to use tarball.

doc/supported-platforms.md Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Show resolved Hide resolved
record := strings.Split(records, " ")
f.Logger.Info("The single record info: ")
fmt.Println(record, len(record))
if len(record) == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This length-check should verify that all five fields exist.

Copy link
Contributor Author

@zhengxiaomei123 zhengxiaomei123 Sep 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This length-check verify that it is the last null record to avoid the “record[*]” error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand? What is the record[*] error? We should still check that len(record) == 5 (or is it >=5? I don't know the format) before accessing record[4] to eliminate the chance of panics from out of bounds access.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify about my previous question?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The length of the record is >=11, but when I use strings.Split(s, "\n"). There will be a null record as the last record. It will cause error when read record[1].

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ajeddeloh ajeddeloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach seems good. Left comments about a bunch of misc bits.

doc/supported-platforms.md Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 4 times, most recently from bd0fc90 to 8ac85dd Compare September 29, 2019 06:40
@zhengxiaomei123
Copy link
Contributor Author

@ajeddeloh @crawford @lucab Thanks for your review comments. I have finished the code changes and test the function on zVM platform referring to your comments. Could you please review my pull request again?

Copy link
Contributor

@ajeddeloh ajeddeloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, gave it another pass

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
_, err := f.Logger.LogCmd(exec.Command("/sbin/vmur", "re", "-f", spoolid, file), "Receive the spool file")
if err == nil {
f.Logger.Info("using config file at %q", file)
_, err := f.Logger.LogCmd(exec.Command("tar", "-xzvf", file), "Extract the spool file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. Are you saying that the spool file is not presenting a tarball but vmur is converting it?

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Show resolved Hide resolved
record := strings.Split(records, " ")
f.Logger.Info("The single record info: ")
fmt.Println(record, len(record))
if len(record) == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand? What is the record[*] error? We should still check that len(record) == 5 (or is it >=5? I don't know the format) before accessing record[4] to eliminate the chance of panics from out of bounds access.

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 4 times, most recently from 3d79404 to 46a7b05 Compare October 4, 2019 16:23
return (err == nil)
}
}
_, err = logger.LogCmd(exec.Command("udevadm", "settle", "||", "udevsettle"), "Settle udev device")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably worked because udevadm ignored the || and udevsettle arguments. This should be handled by the distro package; it exists to allow setting different commands at link-time so it can be compiled against different distros with different commands.

Actually, the udevsettle can almost certainly be dropped. Ignition depends on systemd, which means udevadm should always exist.

internal/distro/distro.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
_, err := f.Logger.LogCmd(exec.Command("/sbin/vmur", "re", "-f", spoolid, file), "Receive the spool file")
if err == nil {
f.Logger.Info("using config file at %q", file)
_, err := f.Logger.LogCmd(exec.Command("tar", "-xzvf", file), "Extract the spool file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^ Can you clarify about my previous question?

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
record := strings.Split(records, " ")
f.Logger.Info("The single record info: ")
fmt.Println(record, len(record))
if len(record) == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify about my previous question?

@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 2 times, most recently from a2afdaa to 8e21c66 Compare October 7, 2019 15:36
@zhengxiaomei123
Copy link
Contributor Author

@ajeddeloh Please review my code again for my latest updates. Thanks.

internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
internal/providers/zvm/zvm.go Show resolved Hide resolved
readerInfo, err := exec.Command(distro.VmurCmd(), "li").CombinedOutput()
if err != nil {
f.Logger.Err("Can not get reader device: %v", err)
return types.Config{}, report.Report{}, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The returned error should be wrapped with a fmt.Errorf() like the log message so the error retains context after it's been returned.

_, err := f.Logger.LogCmd(exec.Command(distro.VmurCmd(), "re", "-f", spoolid, file), "Receive the spool file")
if err == nil {
f.Logger.Info("using config file at %q", file)
_, err := f.Logger.LogCmd(exec.Command(distro.TarCmd(), "-xzvf", file), "Extract the spool file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You previously replied:

Sorry. I forgot this question. I mean If not using tarball, vmur will format the json config file with padding char. There will error when do later ParseConfig operation. So to avoid the config file being formatted , I chose to use tarball.

What is padding char in this case? If the config is just padded I think it would be better to just strip the padding than to need to run tar?

Copy link
Contributor Author

@zhengxiaomei123 zhengxiaomei123 Oct 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajeddeloh Hi, The process is :
Write data to the z/VM punch file queue and transfer it to virtual reader. The data is sliced up into 80-byte chunks (called records) and written to the punch device. If the data length is not an integer multiple of 80 or 132, the last record is padded. So The length of padded string is not confirmed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajeddeloh I have resolved the padding string with bytes package. So now tar is not necessary.

@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 2 times, most recently from 1fe990c to b8d1875 Compare October 9, 2019 08:54
tuan-hoang1 added a commit to tuan-hoang1/ignition-dracut that referenced this pull request Oct 11, 2019
@@ -10,6 +10,7 @@ Ignition is currently only supported for the following platforms:
* [Packet] - Ignition will read its configuration from the instance userdata. SSH keys are handled by coreos-metadata.
* [QEMU] - Ignition will read its configuration from the 'opt/com.coreos/config' key on the QEMU Firmware Configuration Device (available in QEMU 2.4.0 and higher).
* [DigitalOcean] - Ignition will read its configuration from the droplet userdata. SSH keys and network configuration are handled by coreos-metadata.
* [zVM] - Ignition will read its configuration from the reader device directly.The vmur program is necessary,which requires the vmcp and vmur kernel module as prerequisite, and the corresponding z/VM virtual unit record devices (in most cases 000c as reader, 000d as punch) must be set online.
Copy link
Contributor

@lucab lucab Oct 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: two missing spaces after the first . and ,.

@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 4 times, most recently from bc174d5 to 27e5e66 Compare October 14, 2019 05:59
@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 5 times, most recently from 8d72d0c to b944ed6 Compare October 15, 2019 08:35
@zhengxiaomei123
Copy link
Contributor Author

@ajeddeloh Hi, please help recheck my PR for the Black Box Tests. I have fixed some comments and please give another review and go ahead this PR. Thanks.

tuan-hoang1 added a commit to tuan-hoang1/ignition-dracut that referenced this pull request Oct 15, 2019
@jlebon
Copy link
Member

jlebon commented Oct 17, 2019

I see the following tests failed:

    --- FAIL: TestIgnitionBlackBox/config.replace.tftp_3.0.0 (87.77s)
        blackbox_test.go:121: config.replace.tftp 3.0.0
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/config.replace.tftp_3.1.0-experimental (135.15s)
        blackbox_test.go:121: config.replace.tftp 3.1.0-experimental
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/config.merge.http_3.0.0 (134.94s)
        blackbox_test.go:121: config.merge.http 3.0.0
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/genernal.reformat.withfile_3.1.0-experimental (134.70s)
        blackbox_test.go:121: genernal.reformat.withfile 3.1.0-experimental
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/config.merge.http_3.1.0-experimental (134.96s)
        blackbox_test.go:121: config.merge.http 3.1.0-experimental
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/genernal.reformat.withfile_3.0.0 (122.31s)
        blackbox_test.go:121: genernal.reformat.withfile 3.0.0
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/config.replace.http_3.1.0-experimental (134.86s)
        blackbox_test.go:121: config.replace.http 3.1.0-experimental
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/config.replace.http_3.0.0 (134.82s)
        blackbox_test.go:121: config.replace.http 3.0.0
        blackbox_test.go:94: failed: "sgdisk": signal: killed
            
    --- FAIL: TestIgnitionBlackBox/filesystem.reuse_3.1.0-experimental (62.80s)
        blackbox_test.go:121: filesystem.reuse 3.1.0-experimental
        blackbox_test.go:258: Rendered Ignition Config:
            {
            		"ignition": {"version": "3.1.0-experimental"},
            		"storage": {
            			"filesystems": [
            			{
            				"path": "/tmp0",
            				"device": "/dev/loop26p1",
            				"wipeFilesystem": false,
            				"format": "xfs",
            				"label": "data",
            				"uuid": "4d3a56ff-6cb7-42d9-8183-7b207e339f10"
            			}]
            		}
            	}
        filesystem.go:166: ignition [-clear-cache -platform file -stage disks -root  -log-to-stdout --config-cache /var/tmp/ignition-blackbox-143582933/ignition.json]
        filesystem.go:170: PID: 28691
        filesystem.go:171: Ignition output:
            INFO     : Ignition v2.0.1-33-gb944ed6
            INFO     : Stage: disks
            ERROR    : unable to clear cache: remove /var/tmp/ignition-blackbox-143582933/ignition.json: no such file or directory
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            DEBUG    : parsed url from cmdline: ""
            INFO     : no config URL provided
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : using default filename
            INFO     : using config file at "config.ign"
            DEBUG    : parsing config with SHA512: 7293a2c7392155dc13b25b5bc2c33ac5de2e2475e04124948f01a5151bd124d9a911917c4277e97a9ddae727909bb9516762d6cbc076fde337d32999a1934394
            INFO     : disks: createFilesystems: op(1): [started]  waiting for devices [/dev/loop26p1]
            INFO     : disks: createFilesystems: op(1): [finished] waiting for devices [/dev/loop26p1]
            INFO     : disks: createFilesystems: created device alias for "/dev/loop26p1": "/run/ignition/dev_aliases/dev/loop26p1" -> "/dev/loop26p1"
            INFO     : disks: createFilesystems: op(2): [started]  determining filesystem type of "/dev/loop26p1"
            INFO     : disks: createFilesystems: op(2): found xfs filesystem at "/dev/loop26p1" with uuid "4d3a56ff-6cb7-42d9-8183-7b207e339f10" and label "data"
            INFO     : disks: createFilesystems: op(2): [finished] determining filesystem type of "/dev/loop26p1"
            INFO     : disks: createFilesystems: filesystem at "/dev/loop26p1" is already correctly formatted. Skipping mkfs...
            INFO     : disks: op(3): [started]  waiting for udev to settle
            DEBUG    : disks: op(3): executing: "udevadm" "settle"
            INFO     : disks: op(3): [finished] waiting for udev to settle
            INFO     : disks: disks passed
            INFO     : Ignition finished successfully
        filesystem.go:166: ignition [-clear-cache -platform file -stage mount -root /var/tmp/ignition-blackbox-143582933/hd0p9 -log-to-stdout --config-cache /var/tmp/ignition-blackbox-143582933/ignition.json]
        filesystem.go:170: PID: 28813
        filesystem.go:171: Ignition output:
            INFO     : Ignition v2.0.1-33-gb944ed6
            INFO     : Stage: mount
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            DEBUG    : parsed url from cmdline: ""
            INFO     : no config URL provided
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : using default filename
            INFO     : using config file at "config.ign"
            DEBUG    : parsing config with SHA512: 7293a2c7392155dc13b25b5bc2c33ac5de2e2475e04124948f01a5151bd124d9a911917c4277e97a9ddae727909bb9516762d6cbc076fde337d32999a1934394
            INFO     : mount: op(1): [started]  mounting "/dev/loop26p1" at "/var/tmp/ignition-blackbox-143582933/hd0p9/tmp0" with type "xfs"
            INFO     : mount: op(1): [finished] mounting "/dev/loop26p1" at "/var/tmp/ignition-blackbox-143582933/hd0p9/tmp0" with type "xfs"
            INFO     : mount: mount passed
            INFO     : Ignition finished successfully
        filesystem.go:166: ignition [-clear-cache -platform file -stage files -root /var/tmp/ignition-blackbox-143582933/hd0p9 -log-to-stdout --config-cache /var/tmp/ignition-blackbox-143582933/ignition.json]
        filesystem.go:170: PID: 28841
        filesystem.go:171: Ignition output:
            INFO     : Ignition v2.0.1-33-gb944ed6
            INFO     : Stage: files
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            DEBUG    : parsed url from cmdline: ""
            INFO     : no config URL provided
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : using default filename
            INFO     : using config file at "config.ign"
            DEBUG    : parsing config with SHA512: 7293a2c7392155dc13b25b5bc2c33ac5de2e2475e04124948f01a5151bd124d9a911917c4277e97a9ddae727909bb9516762d6cbc076fde337d32999a1934394
            DEBUG    : files: compiled without relabeling support, skipping
            INFO     : files: adding relabel-extra.d/ file: "/run/systemd/relabel-extra.d/ignition.relabel"
            INFO     : files: finished adding relabel file
            INFO     : files: files passed
            INFO     : Ignition finished successfully
        filesystem.go:166: ignition [-clear-cache -platform file -stage umount -root /var/tmp/ignition-blackbox-143582933/hd0p9 -log-to-stdout --config-cache /var/tmp/ignition-blackbox-143582933/ignition.json]
        filesystem.go:170: PID: 28855
        filesystem.go:171: Ignition output:
            INFO     : Ignition v2.0.1-33-gb944ed6
            INFO     : Stage: umount
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/base.ign"
            DEBUG    : parsed url from cmdline: ""
            INFO     : no config URL provided
            INFO     : reading system config file "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : no config at "/var/tmp/ignition-blackbox-143582933/system/user.ign"
            INFO     : using default filename
            INFO     : using config file at "config.ign"
            DEBUG    : parsing config with SHA512: 7293a2c7392155dc13b25b5bc2c33ac5de2e2475e04124948f01a5151bd124d9a911917c4277e97a9ddae727909bb9516762d6cbc076fde337d32999a1934394
            INFO     : umount: op(1): [started]  umounting "/var/tmp/ignition-blackbox-143582933/hd0p9/tmp0"
            INFO     : umount: op(1): [finished] umounting "/var/tmp/ignition-blackbox-143582933/hd0p9/tmp0"
            INFO     : umount: umount passed
            INFO     : Ignition finished successfully
        validator.go:180: failed to mount /dev/loop26p1: failed: "mount": context deadline exceeded
        validator.go:218: Error stat'ing file /var/tmp/ignition-blackbox-143582933/hd1p1/foo/bar: lstat /var/tmp/ignition-blackbox-143582933/hd1p1/foo/bar: no such file or directory

Seem like flakes though?

@jlebon
Copy link
Member

jlebon commented Oct 17, 2019

retest this please

Copy link
Contributor

@ajeddeloh ajeddeloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, just two minor style nits. I don't have a way to test this though. @jlebon @arithx @darkmuggle can one of you give this a quick skim too?

internal/providers/zvm/zvm.go Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
@zhengxiaomei123
Copy link
Contributor Author

zhengxiaomei123 commented Oct 18, 2019

@ajeddeloh @jlebon @arithx Hi , I have updated the code with your latest comments and test the function on my zVM platform. Please go head this PR. Thanks.

The initramfs logs is:

[ 2.385906] [01;31m [Kignition [m [K[650]: Ignition 2.99.998
[ 2.385906] [01;31m [Kignition [m [K[650]: Stage: fetch
[ 2.385922] [01;31m [Kignition [m [K[650]: reading system config file "/usr/lib/ignition/base.ign"
[ 2.386658] [01;31m [Kignition [m [K[650]: no config URL provided
[ 2.386674] [01;31m [Kignition [m [K[650]: reading system config file "/usr/lib/ignition/user.ign"
[ 2.386689] [01;31m [Kignition [m [K[650]: no config at "/usr/lib/ignition/user.ign"
[ 2.386706] [01;31m [Kignition [m [K[650]: op(1): [started] Loading zVM control program module
[ 2.388376] [01;31m [Kignition [m [K[650]: op(1): [finished] Loading zVM control program module
[ 2.388408] [01;31m [Kignition [m [K[650]: op(2): [started] Brings a Linux device online
[ 3.235413] [01;31m [Kignition [m [K[650]: op(2): [finished] Brings a Linux device online
[ 3.235447] [01;31m [Kignition [m [K[650]: op(3): [started] Settle udev device
[ 3.269740] [01;31m [Kignition [m [K[650]: op(3): [finished] Settle udev device
[ 3.271250] [01;31m [Kignition [m [K[650]: op(4): [started] Receive the spool file
[ 3.376042] [01;31m [Kignition [m [K[650]: op(4): [finished] Receive the spool file
[ 3.376078] [01;31m [Kignition [m [K[650]: using config file at "ignition.ign"
[ 3.377002] [01;31m [Kignition [m [K[650]: fetch: fetch complete
[ 3.377026] [01;31m [Kignition [m [K[650]: fetch: fetch passed
[ 3.377043] [01;31m [Kignition [m [K[650]: Ignition finished successfully

_, err := f.Logger.LogCmd(exec.Command(distro.ModprobeCmd(), "vmur"), "Loading zVM control program module")
if err != nil {
f.Logger.Err("Couldn't install vmur module: %v", err)
errors := fmt.Errorf("Couldn't install vmur module: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: can probably dedupe these by assigning to a var first?
Edit: and same in other spots below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: can probably dedupe these by assigning to a var first?
Edit: and same in other spots below

Did you mean a function like printError() to do f.loggr.Err? I don't think printError should replace f.logger.Err to involve the context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just mean something like:

errmsg := fmt.Sprintf("Couldn't install vmur module: %v", err)
f.Logger.Err(errmsg)
errors := fmt.Errorf(errmsg)

internal/providers/zvm/zvm.go Show resolved Hide resolved
internal/providers/zvm/zvm.go Show resolved Hide resolved
@zhengxiaomei123 zhengxiaomei123 force-pushed the zxm branch 2 times, most recently from 5179c9b to 9a06e48 Compare October 22, 2019 05:32
internal/providers/zvm/zvm.go Show resolved Hide resolved
internal/providers/zvm/zvm.go Outdated Show resolved Hide resolved
@zhengxiaomei123
Copy link
Contributor Author

Thanks for all the comments. @ajeddeloh If there is no more comments, Could you please help merge this pull request?

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sane to me! Will let @ajeddeloh do the final look and merge.

@ajeddeloh ajeddeloh merged commit aa88038 into coreos:master Nov 4, 2019
jlebon pushed a commit to coreos/ignition-dracut that referenced this pull request Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable reading ignition config by z/VM hypervisor
6 participants