@@ -28,6 +28,7 @@ import (
2828 azurecredutil "github.com/openshift/hive/contrib/pkg/utils/azure"
2929 gcputils "github.com/openshift/hive/contrib/pkg/utils/gcp"
3030 openstackutils "github.com/openshift/hive/contrib/pkg/utils/openstack"
31+ ovirtutils "github.com/openshift/hive/contrib/pkg/utils/ovirt"
3132 "github.com/openshift/hive/pkg/apis"
3233 hivev1 "github.com/openshift/hive/pkg/apis/hive/v1"
3334 "github.com/openshift/hive/pkg/clusterresource"
@@ -92,6 +93,7 @@ const (
9293 cloudGCP = "gcp"
9394 cloudOpenStack = "openstack"
9495 cloudVSphere = "vsphere"
96+ cloudOVirt = "ovirt"
9597
9698 testFailureManifest = `apiVersion: v1
9799kind: NotARealSecret
@@ -109,6 +111,7 @@ var (
109111 cloudGCP : true ,
110112 cloudOpenStack : true ,
111113 cloudVSphere : true ,
114+ cloudOVirt : true ,
112115 }
113116)
114117
@@ -172,6 +175,14 @@ type Options struct {
172175 VSphereNetwork string
173176 VSphereCACerts string
174177
178+ // Ovirt
179+ OvirtClusterID string
180+ OvirtStorageDomainID string
181+ OvirtNetworkName string
182+ OvirtAPIVIP string
183+ OvirtDNSVIP string
184+ OvirtIngressVIP string
185+
175186 homeDir string
176187}
177188
@@ -199,7 +210,8 @@ create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=aws
199210create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=azure --azure-base-domain-resource-group-name=RESOURCE_GROUP_NAME
200211create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=gcp
201212create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=openstack --openstack-api-floating-ip=192.168.1.2 --openstack-cloud=mycloud
202- create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=vsphere --vsphere-vcenter=vmware.devcluster.com --vsphere-datacenter=dc1 --vsphere-default-datastore=nvme-ds1 --vsphere-api-vip=192.168.1.2 --vsphere-ingress-vip=192.168.1.3 --vsphere-cluster=devel --vsphere-network="VM Network" --vsphere-ca-certs=/path/to/cert` ,
213+ create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=vsphere --vsphere-vcenter=vmware.devcluster.com --vsphere-datacenter=dc1 --vsphere-default-datastore=nvme-ds1 --vsphere-api-vip=192.168.1.2 --vsphere-ingress-vip=192.168.1.3 --vsphere-cluster=devel --vsphere-network="VM Network" --vsphere-ca-certs=/path/to/cert
214+ create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=ovirt` ,
203215 Short : "Creates a new Hive cluster deployment" ,
204216 Long : fmt .Sprintf (longDesc , defaultSSHPublicKeyFile , defaultPullSecretFile ),
205217 Args : cobra .ExactArgs (1 ),
@@ -279,6 +291,14 @@ create-cluster CLUSTER_DEPLOYMENT_NAME --cloud=vsphere --vsphere-vcenter=vmware.
279291 flags .StringVar (& opt .VSphereNetwork , "vsphere-network" , "" , "Name of the network to be used by the cluster" )
280292 flags .StringVar (& opt .VSphereCACerts , "vsphere-ca-certs" , "" , "Path to vSphere CA certificate, multiple CA paths can be : delimited" )
281293
294+ // oVirt flags
295+ flags .StringVar (& opt .OvirtClusterID , "ovirt-cluster-id" , "" , "The oVirt cluster under which all VMs will run" )
296+ flags .StringVar (& opt .OvirtStorageDomainID , "ovirt-storage-domain-id" , "" , "oVirt storage domain under which all VM disk would be created" )
297+ flags .StringVar (& opt .OvirtNetworkName , "ovirt-network-name" , "ovirtmgmt" , "oVirt network of all the network interfaces of the nodes" )
298+ flags .StringVar (& opt .OvirtAPIVIP , "ovirt-api-vip" , "" , "IP which will be served by bootstrap and then pivoted masters, using keepalived" )
299+ flags .StringVar (& opt .OvirtDNSVIP , "ovirt-dns-vip" , "" , "IP of the internal DNS which will be operated by the cluster" )
300+ flags .StringVar (& opt .OvirtIngressVIP , "ovirt-ingress-vip" , "" , "External IP which routes to the default ingress controller" )
301+
282302 return cmd
283303}
284304
@@ -595,6 +615,22 @@ func (o *Options) GenerateObjects() ([]runtime.Object, error) {
595615 CACert : bytes .Join (caCerts , []byte ("\n " )),
596616 }
597617 builder .CloudBuilder = vsphereProvider
618+ case cloudOVirt :
619+ oVirtConfigYAMLContent , err := ovirtutils .GetCreds (o .CredsFile )
620+ if err != nil {
621+ return nil , err
622+ }
623+ oVirtProvider := & clusterresource.OvirtCloudBuilder {
624+ OVirtConfigYAMLContent : oVirtConfigYAMLContent ,
625+ ClusterID : o .OvirtClusterID ,
626+ StorageDomainID : o .OvirtStorageDomainID ,
627+ NetworkName : o .OvirtNetworkName ,
628+ APIVIP : o .OvirtAPIVIP ,
629+ DNSVIP : o .OvirtDNSVIP ,
630+ IngressVIP : o .OvirtIngressVIP ,
631+ }
632+ builder .CloudBuilder = oVirtProvider
633+ builder .SkipMachinePoolGeneration = true
598634 }
599635
600636 if len (o .ServingCert ) != 0 {
0 commit comments