Forced Saltboot image redeployment
Systems provisioned by Saltboot are usually redeployed or repartitioned automatically when a new image is available, or Saltboot partitioning changes.
Occasionally, however, it is needed to force Saltboot to redeploy an image or repartition disk, even when automation would not do so. For these situations, Saltboot offers three ways to force redeployment or repartitioning:
Repartitioning of a terminal removes all data stored on the terminal hard disk, including any persistent partitions. |
1. Force Saltboot redeployment using Salt grains
Saltboot redeployment grains have no side effects, and do not require any further configuration. The limitation is that terminal must be accessible by salt
.
-
On the SUSE Manager Server, as root, apply this Salt state at the command prompt:
salt $terminal_minion_id state.apply saltboot.force_redeploy
-
Restart the terminal to pick up the changes.
-
On the SUSE Manager Server, as root, apply this Salt state at the command prompt:
salt $terminal_minion_id state.apply saltboot.force_repartition
-
Restart the terminal to pick up the changes.
2. Force Saltboot redeployment using custom info values
Saltboot custom values remove the limitation on terminal being reachable by salt
, however there are configuration steps.
Custom info keys and values can be also managed using API or spacecmd
command. For more information, see custominfo.
-
In the SUSE Manager Web UI, navigate to
. -
Click
Create Key
to create newCustom Info Key
. -
As
Key Label
fill insaltboot_force_redeploy
. -
As
Description
fill inForce redeploy Saltboot image
. -
Click
Create Key
.Creating
saltboot_force_redeploy
custom key is a one time operation. When created, it is available for repeated use.
-
Navigate to the
Overview
page of the system you want to redeploy. -
Select tab
Custom Info
. -
Click on
Create Value
. -
From the list of available keys click
saltboot_force_redeploy
. -
As
Value
typeTrue
. -
Click
Update Key
. -
Reboot the terminal to pick up the changes.
After terminal finishes booting, Saltboot redeployment custom info setting is automatically reset to prevent repeated redeployment. |
-
Navigate to menu::Systems[Custom System Info] page.
-
Click
Create Key
to create newCustom Info Key
. -
As
Key Label
fill insaltboot_force_repartition
. -
As
Description
fill inForce terminal disk repartition
. -
Click
Create Key
.Creating
saltboot_force_repartition
custom key is one time operation. Once created, it is available for repeated use.
-
Navigate to the
Overview
page of the system you want to redeploy. -
Select tab
Custom Info
. -
Click on
Create Value
. -
From the list of available keys click
saltboot_force_repartition
. -
As
Value
typeTrue
. -
Click
Update Key
. -
Reboot the terminal to pick up the changes.
3. Force Saltboot redeployment using Saltboot API call
After terminal finishes booting, Saltboot redeployment setting is automatically reset to prevent repeated redeployment. |
An API call system.setPillar
can be used to set specific Saltboot options through Salt pillar data. SUSE Manager Saltboot integration is using tuning-saltboot
pillar category to manage Saltboot tuning, including forced redeployment or disk repartition. Using this pillar category allows SUSE Manager to reset Saltboot flag once the terminal is booted up.
-
In the console run following the command, and replace
$terminal_minion_id
with the actual terminal minion id:spacecmd api -- -A '$terminal_minion_id,tuning-saltboot,{"saltboot": {"force_redeployment": "True"}}' system.setPillar
-
In the console run the following command, replace
$terminal_minion_id
with the actual terminal minion id:spacecmd api -- -A '$terminal_minion_id,tuning-saltboot,{"saltboot": {"force_repartition": "True"}}' system.setPillar
-
In the console run the following command, and replace
$terminal_minion_id
with the actual terminal minion id:spacecmd api -- -A '$terminal_minion_id,tuning-saltboot' system.getPillar
Make sure to use |
4. Force Saltboot redeployment by custom pillar
Pillars specified outside of SUSE Manager database cannot be reset automatically. Without manual intervention, the terminal will download a new image on each reboot. |
-
Create new file
/srv/salt/pillar/force_redeploy.sls
with content:saltboot: force_redeploy: True
-
Create new file or update existing file named
/srv/salt/pillar/top.sls
with content:base: '$terminal_minion_id': - force_redeploy
-
Reboot the terminal to pick up the changes.
-
After the terminal finishes booting, remove modifications made in
/srv/salt/pillar/top.sls
file.
If your terminal encounters a problem with the file system or the partition table, you might need to remove the partition table and reformat the terminal.
-
Create new file
/srv/salt/pillar/force_repartition.sls
with content:saltboot: force_repartition: True
-
Create new file or update existing file named
/srv/salt/pillar/top.sls
with content:base: '$terminal_minion_id': - force_repartition
-
Reboot the terminal to pick up the changes.
-
After the terminal finishes booting, remove modifications made in
/srv/salt/pillar/top.sls
file.