Skip to content

Improve snapshotting functionality#29

Open
amohoste wants to merge 10 commits into
vhive-serverless:v0.25_referencefrom
amohoste:v0.25_reference
Open

Improve snapshotting functionality#29
amohoste wants to merge 10 commits into
vhive-serverless:v0.25_referencefrom
amohoste:v0.25_reference

Conversation

@amohoste

Copy link
Copy Markdown

This PR adds the following changes

  • The HTTP control client timeout has been increased to accomodate longer snapshot creation and restore times
  • Booted and snapshot loaded VMs can execute in their own network namespace
  • A new shim is created upon loading a snapshot, allowing us to boot multiple VMs from a single snapshot
  • A newSnapshotPath parameter has been added which allows to specify where the devicemapper snapshot file file that contains the disk state is located (see Allow specifying a custom devmapper snapshot device on snapshot boot ease-lab/firecracker#3)
  • Added the ability to create differential snapshot

…ns and restorations

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
…pace

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
…m network namespace

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
…pshots

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
Comment thread proto/types.proto Outdated
message FirecrackerMachineConfiguration {
string CPUTemplate = 1; // Specifies the cpu template. Example: "T2" or "C3"
bool HtEnabled = 2; // Specifies if hyper-threading should be enabled
bool TrackDirtyPages = 3; // Specified if dirty-page-tracking should be enabled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please move to the 5th position to allow backwards compatibility.

Comment thread proto/types.proto Outdated
// for a microVM should be large enough
uint32 MemSizeMib = 3;
uint32 VcpuCount = 4; // Specifies the number of vCPUs for the VM
uint32 MemSizeMib = 4;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert

Comment thread runtime/service.go Outdated

// Once the VM is ready, also start forwarding events from it to our exchange
attachCh := eventbridge.Attach(ctx, s.eventBridgeClient, s.eventExchange)
if ! s.snapLoaded {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

refactor for a better code style:

if s.snapLoaded { return }

<...> // everything just like before but without an indent

Comment thread runtime/service.go Outdated

// shutdownSnapLoadedVm shuts down a vm that has been loaded from a snapshot
func (s *service) shutdownSnapLoadedVm() error {
// Kill firecracker process and its shild processes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Kill firecracker process and its shild processes
// Kill firecracker process and its child processes

Comment thread runtime/service.go Outdated
DialTimeout: 100 * time.Millisecond,
RequestTimeout: 10 * time.Second,
ResponseHeaderTimeout: 10 * time.Second,
DialTimeout: 1000 * time.Millisecond,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is there a reason for this timeout increasing? why to those values?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I noticed some timeouts when restoring or loading snapshots, as far as I remember especially for larger memory sizes which makes sense. The values are chosen quite arbitrarily.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

try decreasing them (e.g., try 2x vs 10x as of now). large timeouts create issues in the control plane, the system becomes less responsive

Comment thread runtime/service.go Outdated

// Offload Shuts down a VM and deletes the corresponding firecracker socket
// and vsock. All of the other resources will persist
// and vsock. All of the other resources will persist. Depracated!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// and vsock. All of the other resources will persist. Depracated!
// and vsock. All of the other resources will persist. DEPRECATED!

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
@amohoste amohoste force-pushed the v0.25_reference branch 7 times, most recently from 0e94206 to 032bd10 Compare January 23, 2022 18:24
Signed-off-by: Amory Hoste <amory.hoste@gmail.com>

@ustiugov ustiugov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
…cker-containerd into v0.25_reference

Signed-off-by: Amory Hoste <amory.hoste@gmail.com>
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.

2 participants