Autoyast question

Greetings All,

For a number of years, I have used an AUTOYAST .xml file to do installations for the various machines that I support.
Most of these machines are multi-boot, with a number of different OSs installed.
To accomplish this, I have rigidly defined partition number assignments.

What would make life a lot easier is to be able to override the default partition number specified.
After slogging through the Autoyast manual, I discovered that I can add questions to modify the settings in the .xml.
After placing the section in the XML, I was overjoyed to find that I could indeed enter a different partition number than the default.

However, When the system rebooted, it turns out that Autoyast ignored the entered partition number and installed on the default.

Here are the relevant sections of the XML:

                         
           
<general>
    <ask-list config:type="list">
        <ask>
           <title>Partition for install</title>
           <pathlist config:type="list">
             <path>partitioning,0,drive,partitions,0,partition_nr</path>
             <path>partitioning,0,drive,use</path>
           </pathlist>
           <question>Select the partition number For install. WARNING! Partition will be formatted!</question>
           <stage>initial</stage>
           <type>integer</type>
           <default>3</default>
        </ask>
    </ask-list>  
    
    <mode>
      <confirm config:type="boolean">false</confirm>
    </mode>
    
  </general>
  
 
  <partitioning config:type="list">
    <drive>
         
      <disklabel>msdos</disklabel>
      <initialize config:type="boolean">false</initialize>
      
      <partitions config:type="list">
      
        <partition>
          <create config:type="boolean">false</create>
          <crypt_fs config:type="boolean">false</crypt_fs>
          <filesystem config:type="symbol">ext4</filesystem>
          <format config:type="boolean">true</format>
          <fstopt>acl,user_xattr,noatime</fstopt>
          <label>SSUSE-15.2</label>
          <mount>/</mount>
          <mountby config:type="symbol">label</mountby>
          <partition_id config:type="integer">131</partition_id>
          <partition_nr config:type="integer">3</partition_nr>
        </partition>
        
      </partitions>
    
      <type config:type="symbol">CT_DISK</type>
      <use>3</use>
       
    </drive>
  </partitioning>                                    
  
 What am I missing or doing wrong??

Thanx for any assistance…

Richard Rosa

The more I thought about what you’re trying to do,
I kept thinking of more info that’s likely needed to be successful.

But first… a couple of things…

  • I don’t know if your label “SSUSE” <sic> is really supposed to mean anything… If you’re deploying SLES or SLED technically you should be asking your question in the SUSE forums, not here in openSUSE… Although your question likely has no bearing which product you’re working on.
  • Before wandering down a road of complexity, you should probably consider a possibly simple problem and likely fix… In the following AutoYaST documentation, it describes how “some products” no longer define installation Stage 1 as different from Stage 2 but without further explanation what those products are or what to look for. I haven’t noticed any difference in how openSUSE 15.2 installs from normal downloaded sources, so I don’t think it applies here but who knows? You should verify your AutoYaST script is ordered sequentially and properly or otherwise runs properly so that the variables you set in your interactive session are available… If your script runs out of order, your variables might not be set or otherwise available. I imagine there should be a way to instrument the script if needed to generate informative output if necessary.
    https://documentation.suse.com/sles/12-SP3/html/SLES-all/configuration.html#CreateProfile-General-wait

Aside from the above,
I assume that you didn’t see any errors after installation, the system runs fine but installed in the wrong partition.

From what you posted, I also assume you’re installing on MBR and not GPT disks which means 4 primary partitions… If different, then that may need to be configured as well.

HTH and doing a lot of guessing…
TSU

Thanx for the reply.

Yes, this is for OpenSUSE (15.2) The extra ‘S’ in the label is there for a naming convention that was adopted (ALL the partition labels on the disk start with ‘S’).

No errors occurred during the installation. I also ran the XML code though the ‘validation’ routine in the Autoyast GUI, and nothing failed.
Everything works correctly EXCEPT the partition selected in the <ASK> section is ignored.

As per the order of specification. The <general> section is specified first, then the <partitioning>. It is possible that the order should be reversed. I’ll give that a try (tomorrow).

The disk is NOT initialized as there are a number of other partitions (some with important data) that should NOT be touched. I only want the partition that is being installed formatted. This is the way it has always worked. I would just like to be able to pick a different partition number for some machines WITHOUT having to modify the XML each time. I’m beginning to think that this MAY not be possible…

I will also add that the partition I picked in the selection was also a primary (partition 2) and was already formatted as EXT4, with more than enough space (40gb). The disk is a 512gb MBR formatted Solid State disk.

Autoyast works like my kids. Agrees with what you say and then does what it wants anyway :slight_smile:

Richard Rosa

Am wondering if your pre-formatted partition is the cause of your problem.
A default openSUSE install looks for, or expects free, unformatted (although possibly partitioned) space,although you can of course modify what happens.

TSU

Does partition 3 exist? Do you have multiple disks?

Partition 3 exists (as does partition 2, the desired partition). Although the target machines MAY have multiple disks, the machine I have been trying to get this working on does not. There is only the solitary 512gb SSD. The Install image and XML are retrieved from another partition on this drive, so there is not even a Thumb Drive present (which is one of the MANY reasons not to format the ENTIRE disk).

If that were true, then it wouldn’t work on the default either (as it is also pre-formatted). However I am giving this a try now. I DID try placing the <general> section at the end rather than the beginning of the XML (as suggested), but it made no difference.

I have ALWAYS been able to select the partition to format by manually changing the XML. (<partition_nr> and <use> tags). However, I was hoping to find a way around this, as manual editing has resulted in more than a few undesirable results :frowning:

Another solution I have though about is to generate a number of XML files, each one for a different partition, then add a bunch of entries in the GRUB menu. This, however seems a bit cumbersome at best…

Being able to prompt for a partition at install time SEEMED like the right solution, but there is some magic spell that I do not have the incantation for…

Thanx again for the suggestions…

Richard Rosa

Partition 2 is mentioned nowhere in your configuration.

Correct. Partition 3 is the default. The idea is to allow a change to a DIFFERENT partition other than the default using an input prompt.
Yes, I CAN change the XML for whatever partition should be defaulted and that works. What is NOT working is when a partition number is prompted for, and the input is something OTHER than the default value specified in <partition_nr> and <use> (which is normally ‘3’).

What SHOULD happen (at least from what I understand from the documentation) is that the prompted input should replace the values in <partition_nr> and <use> tags. This is NOT happening. Regardless of what is entered at the prompt, Autoyast continues to use the default values.

As I indicated, I can (and have) manually changed the values of these tags to install on a different partition. This is what I had hoped to get away from…

Richard Rosa

Ah, OK, I missed it.

“drive” seems to be redundant here. “partitioning,0” selects the first “drive” element already.

Both appear to be needed. One without the other causes Autoyast to complain…

Richard Rosa

I am not sure what you mean but here is direct example from autoyast regression tests:

              <pathlist config:type="list">
                  <path>partitioning,0,partitions,0,filesystem</path>
              </pathlist>

Sorry, my confusion. I though you were referring to the second <path> spec for <use>.

I’ll give the reduced path spec a try.

Thanx for the suggestion.

Richard Rosa

BINGO! The extra ‘drive’ in the path was what was keeping the magic from happening. Removed it, and now Autoyast bows to my wishes!
I’m not sure why the validator didn’t call it out, but things are now working the way I want it to.

Thank you very much!

Richard Rosa

Well, I spoke a little too soon. The install went to to the partition selected, but the default partition was totally removed (de allocated). Not exactly the plan. Looks like there is some other setting that needs to change as well…

Expert partitioning implies that you define exact disk configuration, so YaST assumes that only partitions listed in your profile are present. You can avoid formatting existing partitions, but you must at least list them.

You said earlier that you have very strict and well defined partition layout, so you should be able to describe it in autoyast profile.

Humm, the ONLY partition removed WAS the one listed (the default).

I think I’m gonna put this on the back-burner for a while. It was a nice idea, but the amount of effort to get it functional FAR exceeds the time that the procedure it replaces takes…

Thank you again for your assistance.

Richard Rosa