Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions python/vm/create_scvm_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ def createArgumentParser():
parser.add_argument('-c', '--cpu', metavar='[cpu cores]', type=int, help='input Value to cpu cores', required=True)
parser.add_argument('-m', '--memory', metavar='[memory gb]', type=int, help='input Value to memory GB', required=True)

#--disk-type { raid_passthrough or lun_passthrough } | 1택, 선택, 필수
parser.add_argument('-dt', '--disk-type', metavar='[raid_passthrough or lun_passthrough]', choices=['raid_passthrough', 'lun_passthrough'], type=str, help='storage center VM disk type choice', required=True)
#--disk-type { raid_passthrough or lun_passthrough or disk_passthrough } | 1택, 선택, 필수
parser.add_argument('-dt', '--disk-type', metavar='[raid_passthrough or lun_passthrough or disk_passthrough]', choices=['raid_passthrough', 'lun_passthrough', 'disk_passthrough'], type=str, help='storage center VM disk type choice', required=True)

#--raid-passthrough-list raid1 raid2 | 다중선택, 조건부 필수 (disk-type가 raid_passthrough 일 경우)
parser.add_argument('-rpl', '--raid-passthrough-list', metavar='[raid pci]', type=str, nargs='+', help='input Value to raid pic list')

#--lun-passthrough-list disk1 disk2 | 다중선택, 조건부 필수 (disk-type가 lun_passthrough 일 경우)
parser.add_argument('-lpl', '--lun-passthrough-list', metavar='[lum]', type=str, nargs='+', help='input Value to LUN list')

# --disk-passthrough-list disk1 disk2 | 다중선택, 조건부 필수 (disk-type가 disk_passthrough 일 경우)
parser.add_argument('-dpl', '--disk-passthrough-list', metavar='[disk]', type=str, nargs='+', help='input Value to disk list')

#--management-network-bridge br0 | 1택, 필수
parser.add_argument('-mnb', '--management-network-bridge', metavar='[bridge name]', type=str, help='input Value to bridge name of the management network', required=True)

Expand Down Expand Up @@ -163,6 +166,19 @@ def createScvmXml(args):
num += 1

line = line.replace('<!--lun_passthrough-->', lpl_txt)
elif 'disk_passthrough' == args.disk_type:
dpl_txt = ""
num = 0
for disk in args.disk_passthrough_list:
dpl_txt += " <disk type='block' device='disk'>\n"
dpl_txt += " <driver name='qemu' type='raw'/>\n"
dpl_txt += " <source dev='" + disk + "'/>\n"
dpl_txt += " <target dev='sd"+ alphabet[num] +"' bus='scsi'/>\n"
dpl_txt += " <alias name='scsi0-0-0-"+ str(num) +"'/>\n"
dpl_txt += " <address type='drive' controller='0' bus='0' target='0' unit='"+ str(num) +"'/>\n"
dpl_txt += " </disk>\n"
num += 1
line = line.replace('<!--lun_passthrough-->', dpl_txt)
else:
# <!--lun_passthrough--> 주석제거
line = ''
Expand Down
25 changes: 23 additions & 2 deletions shell/host/security_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ update_ssh_scan_port() {

#====================[ firewalld 서비스 보장 ]====================#
ensure_firewalld() {
# firewall-cmd가 없으면 firewalld도 없다고 보고 스킵
# firewall-cmd가 없으면 firewalld도 없다고 보고 스킵합니다.
if ! command -v firewall-cmd >/dev/null 2>&1; then
return 0
fi
Expand All @@ -96,23 +96,44 @@ ensure_firewalld() {
return 0
fi

# inactive(dead), failed 상태이면 firewalld를 시작합니다.
if ! systemctl is-active --quiet firewalld 2>/dev/null; then
echo "[INFO] firewalld 서비스가 비활성화되어 있어 시작합니다."

if systemctl start firewalld 2>/dev/null; then
echo "[INFO] firewalld 시작 완료"
if systemctl is-active --quiet firewalld 2>/dev/null; then
echo "[INFO] firewalld 시작 완료"
else
echo "[WARN] firewalld start 명령은 성공했지만 active 상태가 아닙니다. 계속 진행합니다."
return 0
fi
else
echo "[WARN] firewalld 시작 실패 또는 서비스 없음. 계속 진행합니다."
return 0
fi
fi

# 부팅 시 자동 시작 설정입니다.
if ! systemctl is-enabled --quiet firewalld 2>/dev/null; then
if systemctl enable firewalld >/dev/null 2>&1; then
echo "[INFO] firewalld enable 완료"
else
echo "[WARN] firewalld enable 실패. 계속 진행합니다."
fi
fi

# 혹시 모를 상태 반영 문제를 방지하기 위해 마지막에 재시작합니다.
echo "[INFO] firewalld 서비스를 재시작합니다."

if systemctl restart firewalld 2>/dev/null; then
if systemctl is-active --quiet firewalld 2>/dev/null; then
echo "[INFO] firewalld 재시작 완료"
else
echo "[WARN] firewalld restart 명령은 성공했지만 active 상태가 아닙니다. 계속 진행합니다."
fi
else
echo "[WARN] firewalld 재시작 실패. 계속 진행합니다."
fi
}

ensure_firewalld
Expand Down
4 changes: 4 additions & 0 deletions src/features/storage-vm-wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ <h1 class="pf-v6-c-title pf-m-3xl pf-v6-c-wizard__title">스토리지센터 가
<input class="pf-v6-c-radio__input" type="radio" id="lun-passthrough" value="lp" name="form-radio-storage-vm-disk-type" />
<label class="pf-v6-c-radio__label" for="lun-passthrough">LUN Passthrough</label>
</div>
<div class="pf-v6-c-radio">
<input class="pf-v6-c-radio__input" type="radio" id="disk-passthrough" value="dp" name="form-radio-storage-vm-disk-type" />
<label class="pf-v6-c-radio__label" for="disk-passthrough">Disk Passthrough</label>
</div>
</div>
</div>
<div class="pf-v6-c-form__group">
Expand Down
9 changes: 7 additions & 2 deletions src/features/storage-vm-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ function showDivisionVMConfigFinish() {
function setDiskInfo(){
var cmd = ["python3",pluginpath + "/python/disk/disk_action.py","list"];

// rp = raid passthrough, lp = lun passthrough
// rp = raid passthrough, lp = lun passthrough, dp = disk passthrough
disk_setup_type = $('input[name="form-radio-storage-vm-disk-type"]:checked').val()

createLoggerInfo("setDiskInfo() start");
Expand Down Expand Up @@ -981,14 +981,17 @@ function setReviewInfo(){
$('#span-storage-vm-memory').text(memory_txt);
}

//디스크 구성 ( rp = RAID Passthrough, lp = LUN Passthrough )
//디스크 구성 ( rp = RAID Passthrough, lp = LUN Passthrough, dp = Disk Passthrough )
var svdt = $('input[type=radio][name=form-radio-storage-vm-disk-type]:checked').val();
if(svdt == 'rp') {
xml_create_cmd.push("-dt","raid_passthrough");
xml_create_cmd.push("-rpl");
} else if(svdt == 'lp') {
xml_create_cmd.push("-dt","lun_passthrough");
xml_create_cmd.push("-lpl");
} else if(svdt == 'dp') {
xml_create_cmd.push("-dt","disk_passthrough");
xml_create_cmd.push("-dpl");
}

$('#span-storage-vm-data-disk').empty();
Expand All @@ -999,6 +1002,8 @@ function setReviewInfo(){
el += "RAID Passthrough : " + $('label[for="'+this.id+'"]').text()+"</br>";
} else if(svdt == 'lp') {
el += "LUN Passthrough : " + $('label[for="'+this.id+'"]').text()+"</br>";
} else if(svdt == 'dp') {
el += "Disk Passthrough : " + $('label[for="'+this.id+'"]').text()+"</br>";
}
$('#span-storage-vm-data-disk').append(el);
xml_create_cmd.push(this.value);
Expand Down