Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

fix(disks): attach default disk first if needed #551

Merged
merged 2 commits into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,13 +649,17 @@ class Zone extends common.ServiceObject {
}
delete body.os;
body.disks = body.disks || [];
body.disks.push({
autoDelete: true,
boot: true,
initializeParams: {
sourceImage: image.selfLink,
},
});
// Only push an additional disk configuration if the disk provided
// is not bootable:
if (body.disks.length === 0 || !body.disks[0].boot) {
body.disks.unshift({
autoDelete: true,
boot: true,
initializeParams: {
sourceImage: image.selfLink,
},
});
}
self.createVM(name, body, callback);
});
return;
Expand Down