Skip to content

Commit

Permalink
podvm: update qemu for rhel s390x
Browse files Browse the repository at this point in the history
Packer is picking qemu-system-x86 instead of s390x as qemu binaries

Fixes: confidential-containers#1740

Signed-off-by: Saripalli Lavanya <Saripalli.Lavanya@ibm.com>
  • Loading branch information
Saripalli-lavanya committed Mar 18, 2024
1 parent e190fed commit 883fe87
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions podvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ endif

endif
else ifeq ($(PODVM_DISTRO),rhel)
@echo defined
$(eval OPTS := -var disk_size=11144)
ifeq ($(ARCH),s390x)
$(eval OPTS += -var machine_type=${QEMU_MACHINE_TYPE_${ARCH}})
ifndef QEMU_BINARY
$(eval OPTS += -var qemu_binary=qemu-system-${ARCH})
endif
endif
else
$(error PODVM_DISTRO is invalid or not defined)
endif
Expand Down
3 changes: 2 additions & 1 deletion podvm/qcow2/rhel/qemu-rhel.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ source "qemu" "rhel" {
iso_checksum = "${var.cloud_image_checksum}"
iso_url = "${var.cloud_image_url}"
output_directory = "output"
qemuargs = [["-m", "${var.memory}"], ["-smp", "cpus=${var.cpus}"], ["-cdrom", "${var.cloud_init_image}"], ["-serial", "mon:stdio"], ["-cpu", "Cascadelake-Server"]]
qemuargs = [["-m", "${var.memory}"], ["-smp", "cpus=${var.cpus}"], ["-cdrom", "${var.cloud_init_image}"], ["-serial", "mon:stdio"]]
ssh_password = "${var.ssh_password}"
ssh_port = 22
ssh_username = "${var.ssh_username}"
ssh_timeout = "${var.ssh_timeout}"
boot_wait = "${var.boot_wait}"
qemu_binary = "${var.qemu_binary}"
vm_name = "${var.qemu_image_name}"
shutdown_command = "sudo shutdown -h now"
machine_type = "${local.machine_type}"
Expand Down
5 changes: 5 additions & 0 deletions podvm/qcow2/rhel/variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ variable "ssh_username" {
default = "peerpod"
}

variable "qemu_binary" {
type = string
default = "qemu-system-x86_64"
}

variable "ssh_timeout" {
type = string
default = "15m"
Expand Down

0 comments on commit 883fe87

Please sign in to comment.