affinity groups

This commit is contained in:
Z. Cliffe Schreuders
2018-10-25 23:27:09 +01:00
parent e779347aa1
commit 38dc16ee27
3 changed files with 6 additions and 4 deletions

View File

@@ -184,14 +184,13 @@ class OVirtFunctions
vnic_profiles_service.list.shuffle.each do |vnic_profile|
if vnic_profile.name =~ /#{network_name}/
puts vnic_profile.name
puts vnic_profile.network.id
Print.info "Found: #{vnic_profile.name} (#{vnic_profile.network.id})"
network_profile = vnic_profile
network_network = vnic_profile.network
vnic_profiles_service.list.each do |vnic_snoop_profile|
if vnic_snoop_profile.name =~ /snoop/ && vnic_snoop_profile.network.id == network_network.id
puts vnic_snoop_profile.name
Print.info "Found: #{vnic_snoop_profile.name} (#{vnic_snoop_profile.network.id})"
snoop_profile = vnic_snoop_profile
end
end

View File

@@ -62,8 +62,8 @@ vms = vms_service.list(search='name=' + args.vm_name_search)
affinitygroups = cluster_affinitygroups_service.list()
for affinitygroup in affinitygroups:
print ("Affinity_Group: %s Affinity_Group ID: %s Description: %s Comment: %s"%(affinitygroup.name,affinitygroup.id,affinitygroup.description,affinitygroup.comment))
if affinitygroup.name == args.affinitygroup:
print ("Affinity_Group: %s Affinity_Group ID: %s Description: %s Comment: %s"%(affinitygroup.name,affinitygroup.id,affinitygroup.description,affinitygroup.comment))
group_service = cluster_affinitygroups_service.group_service(affinitygroup.id)
group_vms_service = group_service.vms_service()
for vm in vms:

View File

@@ -188,6 +188,8 @@ def build_vms(project_dir, options)
end
end
# actions on the VMs after vagrant has built them
# this includes networking and snapshots
def ovirt_post_build(options, scenario, project_dir)
Print.std 'Taking oVirt post-build actions...'
if options[:ovirtnetwork]
@@ -200,6 +202,7 @@ def ovirt_post_build(options, scenario, project_dir)
end
if options[:snapshot]
Print.info 'Creating a snapshot of VM(s)'
sleep(20) # give oVirt/Virtualbox a chance to save any VM config changes before creating the snapshot
if OVirtFunctions::provider_ovirt?(options)
OVirtFunctions::create_snapshot(options, scenario, get_vm_names(scenario))
else