diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 177f2d25..3f7a85bb 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -30,6 +30,7 @@ jobs: sudo apt-get install -y cpu-checker sudo kvm-ok sudo apt-get install -y qemu-kvm libvirt-daemon-system + sudo usermod -aG kvm $USER sudo usermod -aG libvirt $USER sudo setfacl -m user:$USER:rw /var/run/libvirt/libvirt-sock sudo systemctl enable --now libvirtd @@ -37,8 +38,8 @@ jobs: sudo systemctl status libvirtd sudo update-ca-certificates sudo rm -rf /var/lib/apt/lists - sudo lspci -nn - virsh nodedev-dumpxml pci_0000_00_08_0 + sudo ls -la /var/run/libvirt/libvirt-sock + sudo ls -l /dev/kvm - name: Run go tests run: | diff --git a/pkg/controllers/machine_controller.go b/pkg/controllers/machine_controller.go index c3404a1c..4d5c36e7 100644 --- a/pkg/controllers/machine_controller.go +++ b/pkg/controllers/machine_controller.go @@ -431,6 +431,8 @@ func (r *MachineReconciler) domainFor( return nil, nil, nil, err } + domainSettings.Type = "kvm" + domainDesc := &libvirtxml.Domain{ Name: machine.GetID(), UUID: machine.GetID(), @@ -609,7 +611,7 @@ func (r *MachineReconciler) setDomainResources(ctx context.Context, log logr.Log func (r *MachineReconciler) setDomainPCIControllers(machine *api.Machine, domain *libvirtxml.Domain) error { domain.Devices.Controllers = append(domain.Devices.Controllers, libvirtxml.DomainController{ Type: "pci", - Model: "pci-root", + Model: "pcie-root", }) for i := 1; i <= 30; i++ { diff --git a/provider/server/machine_create_test.go b/provider/server/machine_create_test.go index 1cacee1c..a58ffec4 100644 --- a/provider/server/machine_create_test.go +++ b/provider/server/machine_create_test.go @@ -24,9 +24,9 @@ var _ = Describe("Create Machine", func() { }, Spec: &iri.MachineSpec{ Power: iri.Power_POWER_ON, - Image: &iri.ImageSpec{ - Image: "example.org/foo:latest", - }, + // Image: &iri.ImageSpec{ + // Image: "example.org/foo:latest", + // }, Class: machineClassx3xlarge, IgnitionData: ignitionData, // TODO: will be done when convertMachineToIRIMachine() supports Volumes and NetworkInterfaces @@ -41,7 +41,7 @@ var _ = Describe("Create Machine", func() { Expect(createResp).Should(SatisfyAll( HaveField("Machine.Metadata.Id", Not(BeEmpty())), HaveField("Machine.Spec.Power", iri.Power_POWER_ON), - HaveField("Machine.Spec.Image", Not(BeNil())), + HaveField("Machine.Spec.Image", BeNil()), HaveField("Machine.Spec.Class", machineClassx3xlarge), HaveField("Machine.Spec.IgnitionData", Equal(ignitionData)), HaveField("Machine.Spec.Volumes", BeNil()), @@ -69,18 +69,10 @@ var _ = Describe("Create Machine", func() { return resp.Machines[0].Status }).Should(SatisfyAll( HaveField("State", Equal(iri.MachineState_MACHINE_RUNNING)), - // HaveField("Access", SatisfyAll( - // HaveField("Driver", "ceph"), - // HaveField("Handle", image.Spec.WWN), - // HaveField("Attributes", SatisfyAll( - // HaveKeyWithValue("monitors", image.Status.Access.Monitors), - // HaveKeyWithValue("image", image.Status.Access.Handle), - // )), - // HaveField("SecretData", SatisfyAll( - // HaveKeyWithValue("userID", []byte(image.Status.Access.User)), - // HaveKeyWithValue("userKey", []byte(image.Status.Access.UserKey)), - // )), - // )), + HaveField("ObservedGeneration", BeZero()), + HaveField("ImageRef", BeEmpty()), + HaveField("Volumes", BeNil()), + HaveField("NetworkInterfaces", BeNil()), )) }) }) diff --git a/provider/server/server_suite_test.go b/provider/server/server_suite_test.go index f6fd43d1..8fc67b4f 100644 --- a/provider/server/server_suite_test.go +++ b/provider/server/server_suite_test.go @@ -89,11 +89,11 @@ var _ = BeforeSuite(func() { RootDir: fmt.Sprintf("%s/libvirt-provider", userHomeDir), StreamingAddress: streamingAddress, Libvirt: app.LibvirtOptions{ - Socket: "/var/run/libvirt/libvirt-sock", - URI: "qemu:///system", - // PreferredDomainTypes: []string{"kvm", "qemu"}, - // PreferredMachineTypes: []string{"pc-i440fx-2.9", "pc-i440fx-2.8"}, - Qcow2Type: "exec", + Socket: "/var/run/libvirt/libvirt-sock", + URI: "qemu:///system", + PreferredDomainTypes: []string{"kvm", "qemu"}, + PreferredMachineTypes: []string{"pc-q35", "pc-i440fx-2.9", "pc-i440fx-2.8"}, + Qcow2Type: "exec", }, NicPlugin: apinetPlugin, // TODO: add other required fields