-
Notifications
You must be signed in to change notification settings - Fork 8
Add VM lifecycle management to AAP configuration #132
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?
Conversation
Implements playbook_cloudkit_create_vm.yml and playbook_cloudkit_delete_vm.yml to handle virtual machine creation and deletion operations. These playbooks integrate with the VM template system and provide proper resource management including namespace finalizers and locking mechanisms. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add create-vm and delete-vm job templates with vm-operations instance group - Configure vm-operations inventory and inventory source for VM management - Set up vm-operations-ig container group with kubernetes service account access 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- name: Acquire VM lock for deletion | ||
kubernetes.core.k8s: | ||
state: present | ||
apply: true | ||
server_side_apply: | ||
field_manager: "{{ vm_order_holder_id }}" | ||
definition: | ||
apiVersion: coordination.k8s.io/v1 | ||
kind: Lease | ||
metadata: | ||
name: "{{ vm_order_lock_name }}" | ||
namespace: "{{ vm_target_namespace }}" | ||
labels: | ||
cloudkit.openshift.io/aap-job-id: "job-{{ awx_job_id | default('unknown') }}" | ||
cloudkit.openshift.io/resource-type: "vm" | ||
cloudkit.openshift.io/operation: "delete" | ||
spec: | ||
holderIdentity: "{{ vm_order_holder_id }}" | ||
|
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 don't think need the lock
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.
@adriengentil Actually we do need the lock. From my testing, if we don't grab a lock then 2 namespaces can be created. I'm not sure how this is possible but it happens. I am testing this fix now and will update the PR once I know it works. (Also, I believe the lock should be held in the CloudKit namespace...)
description: "Publish templates inventory" | ||
organization: "{{ aap_organization_name }}" | ||
- name: "{{ aap_prefix }}-vm-operations" | ||
description: "VM Operational Inventory - Dedicated BM Hypervisors" |
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.
"Dedicated BM Hypervisors" ?
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.
That claude is one crazy fella!
no eda config as code? |
Summary
This PR depends on #131
🤖 Generated with Claude Code