def _check_ip_available(ip_addr):
 for (vm_name, vm_details) in six.iteritems(get_resources_vms(includeConfig=True)):
  vm_config = vm_details['config']
  if ((ip_addr in vm_config['ip_address']) or (vm_config['ip_address'] == ip_addr)):
   log.debug('IP "{0}" is already defined'.format(ip_addr))
   return False
 log.debug("IP '{0}' is available to be defined".format(ip_addr))
 return True

def _check_ip_available ( ip_addr ) : for ( vm_name , vm_details ) in six . iteritems ( get_resources_vms ( includeConfig = True ) ) : vm_config = vm_details [ 'config' ] if ( ( ip_addr in vm_config [ 'ip_address' ] ) or ( vm_config [ 'ip_address' ] == ip_addr ) ) : log . debug ( 'IP "{0}" is already defined' . format ( ip_addr ) ) return False log . debug ( "IP '{0}' is available to be defined" . format ( ip_addr ) ) return True
proxmox vms refuse to start when the ip is already being used .