-
Notifications
You must be signed in to change notification settings - Fork 61
🌱 Set the VC created at timestamp in VM CR status #1402
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
base: main
Are you sure you want to change the base?
🌱 Set the VC created at timestamp in VM CR status #1402
Conversation
c87af77 to
92b41d0
Compare
controllers/virtualmachine/virtualmachine/virtualmachine_controller_intg_test.go
Outdated
Show resolved
Hide resolved
| vmCtx.VM.Status.InstanceUUID = vmCtx.MoVM.Summary.Config.InstanceUuid | ||
|
|
||
| // Only set CreatedAt if it hasn't been set yet and config.createDate is available. | ||
| // This field is immutable once set. |
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 about for restored VMs?
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 do you mean specifically? the timestamp would still backfill from the config
92b41d0 to
00e7875
Compare
edda263 to
c7c08c4
Compare
Introduing a new Provider and Provider.CreationTimestamp field in the VM's status custom resource which sets the creation timestamp from VC/VPXD on VM's creation
c7c08c4 to
0612e83
Compare
Minimum allowed line rate is |
|
|
||
| // Provider describes the observed state of the VirtualMachine from | ||
| // the underlying infrastructure provider (vSphere/vCenter). | ||
| Provider *VirtualMachineProviderStatus `json:"provider,omitempty"` |
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 initially loved this approach, but the more I think about it, the more it is confusing. Nearly everything in status comes from the provider, so I'm not sure we need to nest this. I'm also not convinced this should not be a condition if the goal is to understand the lifecycle of the VM since all other timestamps are part of conditions.
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.
my thought process for why this wouldn't fit in the conditions:
- the timestamp in the conditions represents when did the transition occur which I think will be confusing if for the case of an imported VM a condition timestamp is going to be older than the CR's creation timestamp itself.
- the condition will always transition either none or exactly once.
- I thought it was already a pattern to store such info in the status like
status.LastRestartTime
I agree that most of the CR is an abstraction of the underlying provider so I am open to other names or not having it nested.
akutz
left a comment
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.
Please consider removing the provider status type as I think it is a little weird, even though I initially loved it.
What does this PR do, and why is it needed?
Introducing a new Provider object under status to keep track of info from VC. Defined Provider.CreationTimestamp field that gets set to config.createDate on successful VM creation.
Which issue(s) is/are addressed by this PR? (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes # NA
Are there any special notes for your reviewer:
What do you think of the field names and structure ?
Please add a release note if necessary: