Server

Client

I’m attempting to image a Lenovo P50 with two HDD configured as a RAID0 array.

I tried setting “Host Kernel Argument” as I do on my Lenovo W530 to “mdraid=true”, but it doesn’t find the md array.

Booting into Debug.
I only have a empty container /dev/md0, I don’t get a /dev/md126 or md127 like I have on my W530.
/proc/mdstats shows no available devices.

During my troubleshooting I booted the machine with an Ubuntu 16.04 Live CD and the was able to access the RAID array using dmraid, so I started looking at dmraid in FOG. It isn’t working, looking into the /etc/init.d/S20dmraid script I found It’s not starting because the init script stops at line:8
modprobe dm-mod >/dev/null 2>&1

The dm-mod module isn’t install in /lib or /lib64 so it errors, I’m not sure why that stops the bash script.

@rbaldwin while we await your suggestions/ideas/etc… Anyway we could have you try the --metadata flag during auto assembly? While I will likely add the postinitload feature anyway, I’d still be interested in seeing if we can get automated detection working.

Since mdadm --examine --scan shows the metadata for the array as metadata=imsm, I used that in my attempt.

The way it works is VERY similar to postdownload scripts, but runs before anything dealing with taskings is called (within the /bin/fog script).

It’s a “first” attempt so there may be some issues…

The “quick and dirty” documentation:

FOG Will create a folder in the capture folder of the server called postinitscripts. (E.G. typically /images/dev/postinitscripts)

Installer

FOG Will create a folder in the capture folder of the server called postinitscripts. (E.G. typically /images/dev/postinitscripts)
This will happen on the installer if the postinitscripts folder does not already exist.

FOS

When the init’s load and call the /bin/fog script (last part of S99fog IIRC) the postinitscripts directory will be mounted.

Right before the main script for the tasking is started, it will run through the postinitscripts as defined in the fog.postinst script.

Will unmount the nfs that was mounted so the download/upload tasks will be able to mount where they are expecting to get/put the data.

Note/Suggestion

When calling scripts I like to lean more to sourcing in the script rather than implicit call (. somescript vs somescript) as it will allow “fallthrough” of variables/functions within your postinit that you could use later on (say postdownloadscripts for example).

General needed knowledge

The fog.postinit script should really only be used to call other scripts but this is not a requirement. It is, after all, a bash script.

The scripts you want to use for postinit must go in the postinitscripts directory. They will also need to be executable. (Normal script type stuff).

Caution/Recommends

The sourced path is to the mountpoint naturally and stored in the variable $postinitpath.
You can directly get the path you want, but this variable should be used in my opinion.
In the case of download scripts the image mountpoint will always be:/imagestorelocationonserver->/images.
In the case of upload scripts the image mountpoint will always be:/imagestorelocation/dev->/images

In download mode, the dev folder would be visible directly. So a path of /images/dev/postinitscripts/somescript would work.

In upload mode, the dev folder would not be visible. So postinitscripts would never be accessible if you left the /dev/ in the path. I’ve added corrective items for this postinit to try to make sure this would not break the variable and skip it.

Summary

Hopefully all will be well and I got it right the first go around (highly unlikely but I can be hopeful right?) The init’s have been updated and should support this. I will run a test just to see (though I’m not mounting I should be able validate the system is working.

@rbaldwin I’ll likely still add the postinitload scripts though my implementation will likely be a little different.

For example, the S99fog.sh script should not deal with mounting anything (that should be handled in the fog system for ease. Also postinitscripts should probably exist in the dev folder because you might want to upload, not always download – just my suggestion).

@rbaldwin I’ll likely still add the postinitload scripts though my implementation will likely be a little different.

For example, the S99fog.sh script should not deal with mounting anything (that should be handled in the fog system for ease. Also postinitscripts should probably exist in the dev folder because you might want to upload, not always download – just my suggestion).

@rbaldwin while we await your suggestions/ideas/etc… Anyway we could have you try the --metadata flag during auto assembly? While I will likely add the postinitload feature anyway, I’d still be interested in seeing if we can get automated detection working.

This way when the host boots in capture or deploy mode, S99FOG.sh checks to see if $postinitscript is set, if it is it mounts the images path and executes the specified script. I only have the one storage node, which is my FOG server. So I’m not sure if my method would work on a multinode configuration.

With this configuration I was able to boot and capture an image of my RAID configured Lenovo P50s and deploy that image to another identically configured Lenovo P50. Because the script can be specified per host, it’s customizable for other host which might need some postinit scripting.

@rbaldwin while we await your suggestions/ideas/etc… Anyway we could have you try the --metadata flag during auto assembly? While I will likely add the postinitload feature anyway, I’d still be interested in seeing if we can get automated detection working.

I agree with this summary. I would just like to add I have modified my copy to execute a specified postinit script. I’ve done this by “kernel arguments”, I have added two and modified S99FOG to look for them and run the specified script. This way my Lenovo P50 hosts can run the commands to manually build the RAID array postinit and prior to imaging.

I would share my changes here, but I’m unsure the rules. Would that be welcome here?

Essentially (if this is what you mean), @rbaldwin has a RAID setup that he’d like to capture/deploy images from/to. The common RAID setup is using a metadata of 0.90 (which I suspect is causing the inability to assemble the array currently).

This thread is trying to get the RAID array in use to work with FOG. I’m trying to get it to figure out how to do this without necessarily having to know the drives and layouts just to perform the tasking.

Capture is really the only thing that should need this except we capture partition data based on MBR/GPT layout on the disk. This will need to be rethought so images can be deployed to any disk regardless of if it is a RAID array. – This is for later though (more a todo than will be done right now).

So far, however, we have not had any luck so many of the runs on here is just a collaborative effort to see if we can get it working automatically.

All we’re trying to do right now is figure out a means to get this somewhat automated. If we cannot I might add a postinitload feature that will allow users to perform tasks after the init is loaded but before fog start performing its own tasks.

Can we please summarize this thread in 1 or 2 posts please? It’s now 24 posts long and getting unwieldy. I want to help - probably as others do - but I’ve just read through 30 other posts and it’s now 1:30 AM.

If you jump on the dev-branch, it should update the inits for this new stuff. If these new changes still don’t work, please see if there’s a way we can do an auto assembly on the iMSM raid. If we cannot auto-assemble, it is extremely difficult (currently) to make a working method for you. I suppose I could add a “postinitload” scripts thing, similar to postdownload scripts. I’d really prefer seeing if the current code could handle this with these modifications or an auto assembly model over implicit command to generate the array.

A postinitload script would be great, if I could specify that per host. As I have many Lenovo W530/W520s with RAID that work just fine with the existing FOG RAID Configurations. It’s only the brand new EUFI Bios’ed Lenovo P50s that are having this issue.

Is there perhaps a newer version of mdadm tools? Maybe these new Intel fake RAID controllers aren’t supported by the older version?

Specifically, I’m hoping that you could run the mdadm --assemble --scan with a chunk size specified in the command line. If this successfully builds your imsm array, then I can adjust our arguments to accept the “chunk” size.

Perhaps:

mdadm --auto-detect --assemble --scan

Of course I don’t have an array I could test this with, sorry.

–chunk is an invalid command on the --assemble command as is --auto-detect

If you jump on the dev-branch, it should update the inits for this new stuff. If these new changes still don’t work, please see if there’s a way we can do an auto assembly on the iMSM raid. If we cannot auto-assemble, it is extremely difficult (currently) to make a working method for you. I suppose I could add a “postinitload” scripts thing, similar to postdownload scripts. I’d really prefer seeing if the current code could handle this with these modifications or an auto assembly model over implicit command to generate the array.

Specifically, I’m hoping that you could run the mdadm --assemble --scan with a chunk size specified in the command line. If this successfully builds your imsm array, then I can adjust our arguments to accept the “chunk” size.