Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Update start-virt.sh #254

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Update start-virt.sh #254

merged 1 commit into from
Jan 31, 2024

Conversation

ruomengh
Copy link
Contributor

  1. User can specify vCPU number and memory size
  2. Add usage example in README.md

@@ -11,6 +11,8 @@ GUEST_NAME="tdx-guest"
GUEST_ROOTDIR=/tmp/libvirt-vms

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this part of the args like -v vcpu_num ? othewise if different users run this command, it will conflict

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Iris, as long as the "GUEST_NAME" (can be customized using arg -n) is not the same, the "GUEST_ROOTDIR" doesn't affect TD boot. If you want to boot more than 1 TD using start-virt.sh, try below commands.
$ ./start-virt.sh -i -n
e.g.
$ ./start-virt.sh -i tdx-guest-ubuntu-22.04.qcow2 -n tdx-vm1
$ ./start-virt.sh -i tdx-guest-ubuntu-22.04.qcow2 -n tdx-vm2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ruomengh LGTM

@@ -1,10 +1,10 @@
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>td-guest-grub-on-ubuntu-host</name>
<memory unit='KiB'>2097152</memory>
<name>tdx-guest</name>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a random string or changing the name to a variable for creating multiple TDs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script provides arg "-n" to set domain name.

<name>td-guest-grub-on-ubuntu-host</name>
<memory unit='KiB'>2097152</memory>
<name>tdx-guest</name>
<memory unit='GiB'>mem_size</memory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the pattern to CAPITAL to prevent the regex matches the libvirt keywords?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with capital keywords "REPLACE_MEM_SIZE" and "REPLACE_VCPU_NUM". Thanks.

1. User can specify vCPU number and memory size
2. Add usage example in README.md

Signed-off-by: Hao, Ruomeng <ruomeng.hao@intel.com>
@ruomengh ruomengh requested a review from dongx1x January 31, 2024 02:06
Copy link
Contributor

@dongx1x dongx1x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ruomengh ruomengh merged commit fcd202d into intel:main Jan 31, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants