Mentions légales du service

Skip to content
Snippets Groups Projects

WIP: Allow nvme in deployment

Closed Alexandre MERLIN requested to merge bugs/#12669 into master
3 files
+ 19
14
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -829,6 +829,10 @@ class Microstep < Automata::QueueTask
end
end
def get_part_prefix_str
get_block_device_str + (get_block_device_str.start_with?('nvme') ? "p":"")
end
def get_block_device_num
get_block_device_str().strip[-1].ord - 'a'[0].ord
end
@@ -843,9 +847,9 @@ class Microstep < Automata::QueueTask
if context[:execution].deploy_part.nil?
get_block_device_str
elsif context[:execution].deploy_part != ""
get_block_device_str + context[:execution].deploy_part
get_part_prefix_str + context[:execution].deploy_part
else
get_block_device_str + context[:cluster].deploy_part
get_part_prefix_str + context[:cluster].deploy_part
end
end
@@ -1323,7 +1327,7 @@ class Microstep < Automata::QueueTask
ret['KADEPLOY_FS_TYPE'] = vals[:fstype] if vals[:fstype]
ret['KADEPLOY_FS_TYPE_TMP'] = vals[:fstype_tmp] if vals[:fstype_tmp]
ret['KADEPLOY_ENV_EXTRACTION_DIR'] = vals[:extractdir] if vals[:extractdir]
ret['KADEPLOY_PART_PREFIX'] = vals[:block_device] + (vals[:block_device].start_with?('nvme') ? "p" : "")
ret
end
@@ -1351,6 +1355,7 @@ class Microstep < Automata::QueueTask
:env => env,
:deploy_part => get_deploy_part_str(),
:block_device => get_block_device_str(),
:part_prefox => get_part_prefix_str(),
:parts => {
:deploy => get_deploy_part_num(),
:swap => context[:cluster].swap_part,
@@ -1854,10 +1859,10 @@ class Microstep < Automata::QueueTask
fstype = context[:execution].reformat_tmp
if context[:common].mkfs_options.has_key?(fstype) then
opts = context[:common].mkfs_options[fstype]
tmp_part = get_block_device_str() + context[:cluster].tmp_part
tmp_part = get_part_prefix_str + context[:cluster].tmp_part
return parallel_exec("mkdir -p /tmp; umount #{tmp_part} 2>/dev/null; mkfs.#{fstype} #{opts} #{tmp_part};mount #{tmp_part} /mnt/tmp && chmod 1777 /mnt/tmp; umount /mnt/tmp")
else
tmp_part = get_block_device_str() + context[:cluster].tmp_part
tmp_part = get_part_prefix_str + context[:cluster].tmp_part
return parallel_exec("mkdir -p /tmp; umount #{tmp_part} 2>/dev/null; mkfs.#{fstype} #{tmp_part};mount #{tmp_part} /mnt/tmp && chmod 1777 /mnt/tmp; umount /mnt/tmp")
end
end
@@ -1868,7 +1873,7 @@ class Microstep < Automata::QueueTask
# Output
# * return true if the format has been successfully performed, false otherwise
def ms_format_swap_part()
swap_part = get_block_device_str() + context[:cluster].swap_part
swap_part = get_part_prefix_str + context[:cluster].swap_part
return parallel_exec("mkswap #{swap_part}")
end
@@ -1887,7 +1892,7 @@ class Microstep < Automata::QueueTask
# Output
# * return true if the mount has been successfully performed, false otherwise
def ms_mount_tmp_part()
tmp_part = get_block_device_str() + context[:cluster].tmp_part
tmp_part = get_part_prefix_str + context[:cluster].tmp_part
return parallel_exec("mount #{tmp_part} /tmp")
end
Loading