Skip to content

Commit befef36

Browse files
author
Rafael Garcia
committed
test: increase VM memory to 2GB to accommodate large initrd
The initrd now includes NVIDIA kernel modules, firmware, and driver libraries (~238MB total). With 512MB VMs, the kernel couldn't unpack the initrd into tmpfs without running out of space. Increase test VM memory from 512MB to 2GB to provide sufficient room for the initrd contents plus normal VM operation.
1 parent f563ada commit befef36

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

lib/devices/gpu_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func TestGPUPassthrough(t *testing.T) {
189189
inst, err := instanceMgr.CreateInstance(createCtx, instances.CreateInstanceRequest{
190190
Name: "gpu-test",
191191
Image: "docker.io/library/nginx:alpine",
192-
Size: 512 * 1024 * 1024,
192+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
193193
HotplugSize: 512 * 1024 * 1024,
194194
OverlaySize: 10 * 1024 * 1024 * 1024,
195195
Vcpus: 1,

lib/devices/gpu_module_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func TestNVIDIAModuleLoading(t *testing.T) {
164164
inst, err := instanceMgr.CreateInstance(createCtx, instances.CreateInstanceRequest{
165165
Name: "nvidia-module-test",
166166
Image: createdImg.Name,
167-
Size: 512 * 1024 * 1024,
167+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
168168
HotplugSize: 512 * 1024 * 1024,
169169
OverlaySize: 10 * 1024 * 1024 * 1024,
170170
Vcpus: 2,

lib/instances/exec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestExecConcurrent(t *testing.T) {
7575
inst, err := manager.CreateInstance(ctx, CreateInstanceRequest{
7676
Name: "exec-test",
7777
Image: "docker.io/library/nginx:alpine",
78-
Size: 512 * 1024 * 1024,
78+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
7979
HotplugSize: 512 * 1024 * 1024,
8080
OverlaySize: 1024 * 1024 * 1024,
8181
Vcpus: 2, // More vCPUs for concurrency

lib/instances/manager_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func TestBasicEndToEnd(t *testing.T) {
248248
req := CreateInstanceRequest{
249249
Name: "test-nginx",
250250
Image: "docker.io/library/nginx:alpine",
251-
Size: 512 * 1024 * 1024, // 512MB
251+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
252252
HotplugSize: 512 * 1024 * 1024, // 512MB
253253
OverlaySize: 10 * 1024 * 1024 * 1024, // 10GB
254254
Vcpus: 1,
@@ -862,7 +862,7 @@ func TestStandbyAndRestore(t *testing.T) {
862862
req := CreateInstanceRequest{
863863
Name: "test-standby",
864864
Image: "docker.io/library/nginx:alpine",
865-
Size: 512 * 1024 * 1024,
865+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
866866
HotplugSize: 512 * 1024 * 1024,
867867
OverlaySize: 10 * 1024 * 1024 * 1024,
868868
Vcpus: 1,

lib/instances/network_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestCreateInstanceWithNetwork(t *testing.T) {
6363
inst, err := manager.CreateInstance(ctx, CreateInstanceRequest{
6464
Name: "test-net-instance",
6565
Image: "docker.io/library/nginx:alpine",
66-
Size: 512 * 1024 * 1024,
66+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
6767
HotplugSize: 512 * 1024 * 1024,
6868
OverlaySize: 5 * 1024 * 1024 * 1024,
6969
Vcpus: 1,

lib/instances/resource_limits_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ func TestAggregateLimits_EnforcedAtRuntime(t *testing.T) {
258258

259259
// Set small aggregate limits:
260260
// - MaxTotalVcpus: 2 (first VM gets 1, second wants 2 -> denied)
261-
// - MaxTotalMemory: 2GB (first VM gets 1GB, second wants 1.5GB -> denied)
261+
// - MaxTotalMemory: 6GB (first VM gets 2.5GB, second wants 4GB -> denied)
262262
limits := ResourceLimits{
263263
MaxOverlaySize: 100 * 1024 * 1024 * 1024, // 100GB
264264
MaxVcpusPerInstance: 4, // per-instance limit (high)
265-
MaxMemoryPerInstance: 4 * 1024 * 1024 * 1024, // 4GB per-instance (high)
265+
MaxMemoryPerInstance: 8 * 1024 * 1024 * 1024, // 8GB per-instance (high)
266266
MaxTotalVcpus: 2, // aggregate: only 2 total
267-
MaxTotalMemory: 2 * 1024 * 1024 * 1024, // aggregate: only 2GB total
267+
MaxTotalMemory: 6 * 1024 * 1024 * 1024, // aggregate: only 6GB total (allows first 2.5GB VM)
268268
}
269269

270270
mgr := NewManager(p, imageManager, systemManager, networkManager, deviceManager, volumeManager, limits, nil, nil).(*manager)
@@ -306,14 +306,14 @@ func TestAggregateLimits_EnforcedAtRuntime(t *testing.T) {
306306
assert.Equal(t, 0, usage.TotalVcpus, "Initial vCPUs should be 0")
307307
assert.Equal(t, int64(0), usage.TotalMemory, "Initial memory should be 0")
308308

309-
// Create first VM: 1 vCPU, 512MB + 512MB = 1GB memory
310-
t.Log("Creating first instance (1 vCPU, 1GB memory)...")
309+
// Create first VM: 1 vCPU, 2GB + 512MB = 2.5GB memory
310+
t.Log("Creating first instance (1 vCPU, 2.5GB memory)...")
311311
inst1, err := mgr.CreateInstance(ctx, CreateInstanceRequest{
312312
Name: "small-vm-1",
313313
Image: "docker.io/library/alpine:latest",
314314
Vcpus: 1,
315-
Size: 512 * 1024 * 1024, // 512MB
316-
HotplugSize: 512 * 1024 * 1024, // 512MB (total 1GB)
315+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
316+
HotplugSize: 512 * 1024 * 1024, // 512MB
317317
OverlaySize: 1 * 1024 * 1024 * 1024,
318318
NetworkEnabled: false,
319319
})
@@ -325,7 +325,7 @@ func TestAggregateLimits_EnforcedAtRuntime(t *testing.T) {
325325
usage, err = mgr.calculateAggregateUsage(ctx)
326326
require.NoError(t, err)
327327
assert.Equal(t, 1, usage.TotalVcpus, "Should have 1 vCPU in use")
328-
assert.Equal(t, int64(1024*1024*1024), usage.TotalMemory, "Should have 1GB memory in use")
328+
assert.Equal(t, int64(2*1024*1024*1024+512*1024*1024), usage.TotalMemory, "Should have 2.5GB memory in use")
329329
t.Logf("Aggregate usage after first VM: %d vCPUs, %d bytes memory", usage.TotalVcpus, usage.TotalMemory)
330330

331331
// Try to create second VM: 2 vCPUs (would exceed MaxTotalVcpus=2)

lib/instances/volumes_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func TestVolumeMultiAttachReadOnly(t *testing.T) {
9393
writerInst, err := manager.CreateInstance(ctx, CreateInstanceRequest{
9494
Name: "writer",
9595
Image: "docker.io/library/alpine:latest",
96-
Size: 512 * 1024 * 1024,
96+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
9797
HotplugSize: 512 * 1024 * 1024,
9898
OverlaySize: 1024 * 1024 * 1024,
9999
Vcpus: 1,
@@ -135,7 +135,7 @@ func TestVolumeMultiAttachReadOnly(t *testing.T) {
135135
reader1, err := manager.CreateInstance(ctx, CreateInstanceRequest{
136136
Name: "reader-1",
137137
Image: "docker.io/library/alpine:latest",
138-
Size: 512 * 1024 * 1024,
138+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
139139
HotplugSize: 512 * 1024 * 1024,
140140
OverlaySize: 1024 * 1024 * 1024,
141141
Vcpus: 1,
@@ -151,7 +151,7 @@ func TestVolumeMultiAttachReadOnly(t *testing.T) {
151151
reader2, err := manager.CreateInstance(ctx, CreateInstanceRequest{
152152
Name: "reader-2-overlay",
153153
Image: "docker.io/library/alpine:latest",
154-
Size: 512 * 1024 * 1024,
154+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
155155
HotplugSize: 512 * 1024 * 1024,
156156
OverlaySize: 1024 * 1024 * 1024,
157157
Vcpus: 1,
@@ -270,7 +270,7 @@ func TestOverlayDiskCleanupOnDelete(t *testing.T) {
270270
inst, err := manager.CreateInstance(ctx, CreateInstanceRequest{
271271
Name: "overlay-cleanup-test",
272272
Image: "docker.io/library/alpine:latest",
273-
Size: 512 * 1024 * 1024,
273+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
274274
HotplugSize: 512 * 1024 * 1024,
275275
OverlaySize: 1024 * 1024 * 1024,
276276
Vcpus: 1,
@@ -394,7 +394,7 @@ func TestVolumeFromArchive(t *testing.T) {
394394
inst, err := manager.CreateInstance(ctx, CreateInstanceRequest{
395395
Name: "archive-reader",
396396
Image: "docker.io/library/alpine:latest",
397-
Size: 512 * 1024 * 1024,
397+
Size: 2 * 1024 * 1024 * 1024, // 2GB (needs extra room for initrd with NVIDIA libs)
398398
HotplugSize: 512 * 1024 * 1024,
399399
OverlaySize: 1024 * 1024 * 1024,
400400
Vcpus: 1,

0 commit comments

Comments
 (0)