-
Notifications
You must be signed in to change notification settings - Fork 341
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
vmware_guest: error when creating vm with enabled virtualization based security #351
Comments
Maybe relevant: #89 |
Just adding a second task with ---
- name: create vm template
hosts: ws
connection: local
gather_facts: false
tasks:
- name: create vm
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: "{{ vcenter_validate_certs }}"
datacenter: "{{ vcenter_datacenter }}"
cluster: "{{ vcenter_cluster }}"
resource_pool: "{{ vcenter_resource_pool }}"
folder: "{{ vcenter_folder }}"
name: "{{ inventory_hostname }}"
guest_id: windows9Server64Guest
hardware:
boot_firmware: "efi"
hotadd_cpu: true
hotadd_memory: true
num_cpus: 2
memory_mb: 4096
memory_reservation_lock: true
nested_virt: true
scsi: paravirtual
virt_based_security: true
cdrom:
type: none
disk:
- size_gb: 50
datastore: "{{ vcenter_datastore }}"
networks:
- name: "{{ vm_network }}"
device_type: vmxnet3
start_connected: true
state: poweredoff
- name: enable virt_based_security
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: "{{ vcenter_validate_certs }}"
datacenter: "{{ vcenter_datacenter }}"
cluster: "{{ vcenter_cluster }}"
resource_pool: "{{ vcenter_resource_pool }}"
folder: "{{ vcenter_folder }}"
name: "{{ inventory_hostname }}"
guest_id: windows9Server64Guest
hardware:
virt_based_security: true |
I think the module crashes here: The module tries to make sure that the chosen hardware version supports virtualization based security, but As a quick'n'dirty workaround, you can explicitly set the hardware version to 14, 15 or 17 ("latest" doesn't work, either, I've tested this). |
I can confirm it! The following playbook is working as intended. - name: create vm template
hosts: ws
connection: local
gather_facts: false
tasks:
- name: create vm
vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: "{{ vcenter_validate_certs }}"
datacenter: "{{ vcenter_datacenter }}"
cluster: "{{ vcenter_cluster }}"
resource_pool: "{{ vcenter_resource_pool }}"
folder: "{{ vcenter_folder }}"
name: "{{ inventory_hostname }}"
guest_id: windows9Server64Guest
hardware:
boot_firmware: "efi"
hotadd_cpu: true
hotadd_memory: true
num_cpus: 2
memory_mb: 4096
memory_reservation_lock: true
nested_virt: true
scsi: paravirtual
version: 14 # added
virt_based_security: true
cdrom:
type: none
disk:
- size_gb: 50
datastore: "{{ vcenter_datastore }}"
networks:
- name: "{{ vm_network }}"
device_type: vmxnet3
start_connected: true
state: poweredoff
|
I'll take a look at this issue, thanks for reporting and debugging. |
@Tomorrow9 shared some interesting information on this in PR #384:
|
@mariolenz What is the action item here? |
Sorry, I didn't have another look at this issue since @Tomorrow9 wanted to. I'll assign it to myself and try to find a solution. edit: |
Actually, I'm quite sure this has been fixed with PR #384. So I'll close this issue for now. However, I think there are some problems when it comes to visualization based security. I've opened PR #816 for this, but it's still work in progress at the moment. |
vmware_guest: Make VBS requirements explicit SUMMARY #351 made me think about how we handle virtualization based security and I don't like it. I really don't think it's a good idea if modules silently configure something, I think it should always be explicit. ISSUE TYPE Bugfix Pull Request COMPONENT NAME vmware_guest ADDITIONAL INFORMATION #816 Reviewed-by: None <None>
SUMMARY
When trying to create a new vm with
virt_based_security: true
, the task will fail.Removing the
virt_based_security
option successfully creates a vm - without virtualization based security thoughISSUE TYPE
COMPONENT NAME
vmware_guest
ANSIBLE VERSION
vmware collection version: 1.1.0
Also tested with ansible 2.9.12
OS / ENVIRONMENT
os: rhel 7.8
vSphere: 6.7.0.44000
STEPS TO REPRODUCE
EXPECTED RESULTS
VM should be created with enabled virtualization based security
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: