-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPLAT-1811: Add vSphere multi disk support #1290
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
7bb2ca6
to
7e46607
Compare
b05d938
to
cb52ddf
Compare
@vr4manta: This pull request references SPLAT-1811 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
cb52ddf
to
da0d90c
Compare
/test all |
pkg/controller/vsphere/reconciler.go
Outdated
// Currently, MAPI does not provide any API knobs to configure additional volumes for a VM. | ||
// So, we are expecting the VM to have only one disk, which is OS disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment will need to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. Thanks!
pkg/controller/vsphere/reconciler.go
Outdated
func getAdditionalDiskSpecs(s *machineScope, devices object.VirtualDeviceList, datastore *object.Datastore) ([]types.BaseVirtualDeviceConfigSpec, error) { | ||
var diskSpecs []types.BaseVirtualDeviceConfigSpec | ||
|
||
klog.InfoS("About to iterate through disks", "disk", s.providerSpec.Disks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update those. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this message.
pkg/controller/vsphere/reconciler.go
Outdated
|
||
klog.InfoS("About to iterate through disks", "disk", s.providerSpec.Disks) | ||
|
||
klog.Infof("Feature Gates: %v", s.featureGates) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update those. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed these logs messages.
pkg/controller/vsphere/reconciler.go
Outdated
if len(s.providerSpec.Disks) > 0 && !s.featureGates.Enabled(featuregate.Feature(apifeatures.FeatureGateVSphereMultiDisk)) { | ||
return nil, machinecontroller.InvalidMachineConfiguration( | ||
"machines cannot contain additional disks due to VSphereMultiDisk feature gate being disabled") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to happen at the providerSpec validation webhook level as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll copy this up this up there too. Thanks!
@@ -547,7 +547,8 @@ func TestNodeGetter(t *testing.T) { | |||
testEnv := &envtest.Environment{ | |||
CRDDirectoryPaths: []string{ | |||
filepath.Join("..", "..", "..", "install"), | |||
filepath.Join("..", "..", "..", "vendor", "github.com", "openshift", "api", "config", "v1", "zz_generated.crd-manifests")}, | |||
filepath.Join("..", "..", "..", "vendor", "github.com", "openshift", "api", "config", "v1", "zz_generated.crd-manifests"), | |||
filepath.Join("..", "..", "..", "third_party", "cluster-api", "crds")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What new CRDs are needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that once I fixed loading of feature gates, there are some existing tests that start to fail due to
E1113 15:26:22.870540 2519608 actuator.go:65] "test" error: test: reconciler failed to Delete machine: unable to remove finalizer for IP address claims: unable to list IPAddressClaims: no matches for kind "IPAddressClaim" in version "ipam.cluster.x-k8s.io/v1beta1"
actuator_test.go:387:
Unexpected error:
<*fmt.wrapError | 0xc00073f880>:
test: reconciler failed to Delete machine: unable to remove finalizer for IP address claims: unable to list IPAddressClaims: no matches for kind "IPAddressClaim" in version "ipam.cluster.x-k8s.io/v1beta1"
{
msg: "test: reconciler failed to Delete machine: unable to remove finalizer for IP address claims: unable to list IPAddressClaims: no matches for kind "IPAddressClaim" in version "ipam.cluster.x-k8s.io/v1beta1"",
err: <*fmt.wrapError | 0xc000f9dba0>{
msg: "unable to remove finalizer for IP address claims: unable to list IPAddressClaims: no matches for kind "IPAddressClaim" in version "ipam.cluster.x-k8s.io/v1beta1"",
err: <*fmt.wrapError | 0xc000f9db80>{
msg: "unable to list IPAddressClaims: no matches for kind "IPAddressClaim" in version "ipam.cluster.x-k8s.io/v1beta1"",
err: <*meta.NoKindMatchError | 0xc000b54d80>{
GroupKind: {
Group: "ipam.cluster.x-k8s.io",
Kind: "IPAddressClaim",
},
SearchedVersions: ["v1beta1"],
},
},
},
}
occurred
I was able to fix this by including the CRDs that are provided by the cluster-capi-operator. Sadly, these are not in a package that go can extract full directory due to no .go file in the same directory as the CRD yaml files. Maybe in a separate PR we can fix the other repo to put a dummy go file in there so we can remove this. Note, we'll still need the filepath join logic, but we can remove what was put into the third_party directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have gone through and removed this one entry but the other locations are still needed. I think I added this here as part of my original debug.
err = gates.Set(fmt.Sprintf("%v=%v", features.FeatureGateVSphereStaticIPs, tc.staticIPFeatureGateEnabled)) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, should inline this
err = gates.Set(fmt.Sprintf("%v=%v", features.FeatureGateVSphereStaticIPs, tc.staticIPFeatureGateEnabled)) | |
if err != nil { | |
if err := gates.Set(fmt.Sprintf("%v=%v", features.FeatureGateVSphereStaticIPs, tc.staticIPFeatureGateEnabled)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll update that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this related to this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are needed for the unit tests to run. Not sure why they were not needed before, but I think it has to do with now I am setting the featuregate infos during the tests.
da0d90c
to
cd3cb81
Compare
cd3cb81
to
2d44f66
Compare
be37562
to
ad6f989
Compare
4e8092d
to
d5ccb46
Compare
/test all |
@vr4manta: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1d28c85
to
aa778a0
Compare
12880d9
to
73a04b8
Compare
73a04b8
to
62a3cbb
Compare
// VM os disks filename contains the machine name in it | ||
// and has the format like "[DATASTORE] path-within-datastore/machine-name.vmdk". | ||
// This is based on vSphere behavior, an OS disk file gets a name that equals the target VM name during the clone operation. | ||
func filterOutVmOsDisk(attachedDisks []attachedDisk, machine *machinev1.Machine) []attachedDisk { | ||
var disks []attachedDisk | ||
regex, _ := regexp.Compile(fmt.Sprintf(".*\\/%s(_\\d*)?.vmdk", machine.GetName())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this regex doing differently? What will the additional disks names look like?
if len(s.providerSpec.DataDisks) > 0 && !s.featureGates.Enabled(featuregate.Feature(apifeatures.FeatureGateVSphereMultiDisk)) { | ||
return nil, machinecontroller.InvalidMachineConfiguration( | ||
"machines cannot contain additional disks due to VSphereMultiDisk feature gate being disabled") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this same check in the validation webhook?
if !used { | ||
unit32 := int32(unit) | ||
vd.UnitNumber = &unit32 | ||
klog.Infof("Assigned unit number %d = %d", unit, *vd.UnitNumber) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we are getting a little too much on the logs here? This seems rather low level for logging default
SPLAT-1811
Changes
Prerequisites