Skip to content

Commit

Permalink
ovirt: Add bootable attribute to the provider
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Necas <mnecas@redhat.com>
  • Loading branch information
mnecas committed Jul 3, 2023
1 parent 71d5b9b commit 0d921e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/plan/adapter/ovirt/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ func (r *Builder) mapDisks(vm *model.Workload, persistentVolumeClaims []core.Per
},
},
}
if da.DiskAttachment.Bootable {
var bootOrder uint = 1
disk.BootOrder = &bootOrder
}

kVolumes = append(kVolumes, volume)
kDisks = append(kDisks, disk)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/provider/container/ovirt/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ type VM struct {
Disks struct {
Attachment []struct {
ID string `json:"id"`
Bootable string `json:"bootable"`
Name string
Interface string `json:"interface"`
SCSIReservation string `json:"uses_scsi_reservation"`
Expand Down Expand Up @@ -418,6 +419,7 @@ func (r *VM) addDiskAttachment(m *model.VM) {
Interface: da.Interface,
SCSIReservation: r.bool(da.SCSIReservation),
Disk: da.Disk.ID,
Bootable: r.bool(da.Bootable),
})
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/provider/model/ovirt/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ type DiskAttachment struct {
Interface string `json:"interface"`
SCSIReservation bool `json:"scsiReservation"`
Disk string `json:"disk"`
Bootable bool `json:"bootable"`
}

type NIC struct {
Expand Down

0 comments on commit 0d921e2

Please sign in to comment.