Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize and create multiple SNP guests in the Ubuntu Host #24

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LakshmiSaiHarika
Copy link
Contributor

@LakshmiSaiHarika LakshmiSaiHarika commented Dec 6, 2024

Users can launch multiple SNP enabled guests at the same time using --guest-name option and export of HOST_SSH_PORT env. variables

Modified snp.sh to create a separate guest user directory and point the launch working directory to point the current specific guest user directory.

Enhanced the guest creation process via the download of base guest image from the URL once and re-use the same base guest image to create multiple SNP enabled guests.

@LakshmiSaiHarika LakshmiSaiHarika force-pushed the create-multiple-guests branch 3 times, most recently from 0476cc5 to 0a58ee3 Compare December 12, 2024 22:48
@LakshmiSaiHarika LakshmiSaiHarika changed the title Create various unique SNP enabled guests Optimize and create multiple SNP guests in the Ubuntu Host Dec 12, 2024
@LakshmiSaiHarika
Copy link
Contributor Author

LakshmiSaiHarika commented Dec 12, 2024

Hey @ryansavino and @DGonzalezVillal , I request for this PR review for the optimization of SNP guest creation process in the ubuntu host as per our previous meeting. Please let me know if any changes are required

Copy link
Contributor

@DGonzalezVillal DGonzalezVillal left a comment

Choose a reason for hiding this comment

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

A question related to current functionality and just a suggestion about your comments.

docs/snp.md Outdated Show resolved Hide resolved
tools/snp.sh Show resolved Hide resolved
tools/snp.sh Show resolved Hide resolved
tools/snp.sh Outdated Show resolved Hide resolved
@LakshmiSaiHarika LakshmiSaiHarika force-pushed the create-multiple-guests branch 2 times, most recently from 09b6f06 to 0801550 Compare December 16, 2024 23:34
Copy link
Contributor

@DGonzalezVillal DGonzalezVillal left a comment

Choose a reason for hiding this comment

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

The one comment. Besides that it lgtm

Comment on lines +114 to +117
User created SNP guest via guest-name option can be stopped with the `--guest-name` option as follows:
```
./snp.sh stop-guests --guest-name <user-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.

I don't see this as part of the code, are you meaning to add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the documentation, I was just highlightling a way to stop guest for a specific guest.

--guest-name option sets the IMAGE env. variable for that specific guest, which stops the running IMAGE env variable as per the stop_guests() function.

Let me know if we don't want to show this in documentation?

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad, I misunderstood how that worked, you can ignore that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, @DGonzalezVillal , thanks for approving this PR.
Hi @ryansavino , please let me know if any changes are required in this PR.

Copy link
Contributor

@DGonzalezVillal DGonzalezVillal left a comment

Choose a reason for hiding this comment

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

LGTM

@LakshmiSaiHarika LakshmiSaiHarika changed the title Optimize and create multiple SNP guests in the Ubuntu Host 2) Optimize and create multiple SNP guests in the Ubuntu Host Jan 14, 2025
… a separate SNP guest

This supports launch of various SNP Guests at the same time using unique guest name and guest qemu port.

A separate SNP guest can be launched with the --guest-name and --guest-port command option as follows:
  ./snp.sh launch-guest --guest-name <user-guest-name> --guest-port <user-guest-port>

Signed-off-by: Harika Nittala <[email protected]>
Updated to show the correct details for the guest SSH access.

Signed-off-by: Harika Nittala <[email protected]>
…tion process

Updated the ubuntu guest download process to download it once and re-use the same image to quickly create multiple guests with the improved performance.
Update of the  guest image download structure in ubuntu also helps to  easily add support for the same in the other OS linux distros.

Signed-off-by: Harika Nittala <[email protected]>
LakshmiSaiHarika added a commit to LakshmiSaiHarika/sev-utils that referenced this pull request Jan 24, 2025
This reads MSR 0xC0010010 SME, SNP bits to check if SME, SNP are set and enabled in the bios

Bit amd#23 corresponds to the SME bit status
Bit amd#24 corresponds to the SNP bit status

Signed-off-by: Harika Nittala <[email protected]>
LakshmiSaiHarika added a commit to LakshmiSaiHarika/sev-utils that referenced this pull request Jan 24, 2025
This verifies if SME, SNP are enabled in the host BIOS settings by reading SME and SNP bit status from MSR 0xC0010010

Bit amd#23 corresponds to the SME bit status
Bit amd#24 corresponds to the SNP bit status

Signed-off-by: Harika Nittala <[email protected]>
LakshmiSaiHarika added a commit to LakshmiSaiHarika/sev-utils that referenced this pull request Jan 24, 2025
This verifies if SME, SNP are enabled in the host BIOS settings by reading SME and SNP bit status from MSR 0xC0010010

Bit amd#23 corresponds to the SME bit status
Bit amd#24 corresponds to the SNP bit status

Signed-off-by: Harika Nittala <[email protected]>
Copy link

@arvindskumar99 arvindskumar99 left a comment

Choose a reason for hiding this comment

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

LGTM

LakshmiSaiHarika added a commit to LakshmiSaiHarika/sev-utils that referenced this pull request Jan 24, 2025
This verifies if SME, SNP are enabled in the host BIOS settings by reading SME and SNP bit status from MSR 0xC0010010

Bit amd#23 corresponds to the SME bit status
Bit amd#24 corresponds to the SNP bit status

Signed-off-by: Harika Nittala <[email protected]>
LakshmiSaiHarika added a commit to LakshmiSaiHarika/sev-utils that referenced this pull request Jan 28, 2025
This verifies if SME, SNP are enabled in the host BIOS settings by reading SME and SNP bit status from MSR 0xC0010010

Bit amd#23 corresponds to the SME bit status
Bit amd#24 corresponds to the SNP bit status

Signed-off-by: Harika Nittala <[email protected]>
@LakshmiSaiHarika LakshmiSaiHarika changed the title 2) Optimize and create multiple SNP guests in the Ubuntu Host Optimize and create multiple SNP guests in the Ubuntu Host Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants