Skip to content

Commit 1e09660

Browse files
committed
move resume VM outside create snapshot
1 parent 5c22b29 commit 1e09660

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

cri/firecracker/coordinator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ func (c *coordinator) orchCreateSnapshot(ctx context.Context, funcInst *FuncInst
313313
return nil
314314
}
315315

316+
_, err = c.orch.ResumeVM(ctx, funcInst.vmID)
317+
316318
if err := c.snapshotManager.CommitSnapshot(id); err != nil {
317319
funcInst.logger.WithError(err).Error("failed to commit snapshot")
318320
return err

ctriface/iface.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,6 @@ func (o *Orchestrator) CreateSnapshot(ctx context.Context, vmID string, snap *sn
475475
return err
476476
}
477477

478-
// 5. Resume
479-
if _, err := o.fcClient.ResumeVM(ctx, &proto.ResumeVMRequest{VMID: vmID}); err != nil {
480-
log.Printf("failed to resume the VM")
481-
return err
482-
}
483-
484478
return nil
485479
}
486480

ctriface/image/manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func TestMultipleConcurrent(t *testing.T) {
120120
imgWg.Add(concurrentPulls)
121121
for i := 0; i < concurrentPulls; i++ {
122122
go func(i int) {
123-
defer wg.Done()
123+
defer imgWg.Done()
124124
_, err := mgr.GetImage(ctx, imgName)
125125
require.NoError(t, err, fmt.Sprintf("Failed to pull image %s", imgName))
126126
}(i)

scripts/clean_fcctr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ echo Cleaning /run/firecracker-containerd/*
7171
sudo rm -rf /run/firecracker-containerd/containerd.sock.ttrpc \
7272
/run/firecracker-containerd/io.containerd.runtime.v1.linux \
7373
/run/firecracker-containerd/io.containerd.runtime.v2.task \
74-
/run/containerd/s
74+
/run/containerd/*
7575

7676
echo Cleaning CNI state, e.g., allocated addresses
7777
sudo rm /var/lib/cni/networks/fcnet*/last_reserved_ip.0 || echo clean already

0 commit comments

Comments
 (0)