theforeman/foreman · error · Foreman::Exception

Could not find network %s on VMWare compute resource

Error message

Could not find network %s on VMWare compute resource

What it means

Error "Could not find network %s on VMWare compute resource" thrown in theforeman/foreman.

Source

Thrown at app/models/compute_resources/foreman/model/vmware.rb:687

    def display_type=(type)
      attrs[:display] = type.downcase
    end

    def humanized_display_type
      self.class.supported_display_types[display_type]
    end

    def self.provider_friendly_name
      "VMware"
    end

    def vm_compute_attributes(vm)
      vm_attrs = super
      dc_networks = networks
      interfaces = vm.interfaces || []
      vm_attrs[:interfaces_attributes] = interfaces.each_with_index.each_with_object({}) do |(interface, index), hsh|
        network = dc_networks.detect { |n| [n.id, n.name].include?(interface.network) }
        raise Foreman::Exception.new(N_("Could not find network %s on VMWare compute resource"), interface.network) unless network
        interface_attrs = {}
        interface_attrs[:compute_attributes] = {}
        interface_attrs[:mac] = interface.mac
        interface_attrs[:compute_attributes][:network] = network.id
        interface_attrs[:compute_attributes][:type] = interface.type.to_s.split('::').last
        hsh[index.to_s] = interface_attrs
      end
      vm_attrs[:scsi_controllers] = vm.scsi_controllers.map do |controller|
        controller.attributes
      end
      vm_attrs[:nvme_controllers] = vm.nvme_controllers.map do |controller|
        controller.attributes
      end
      vm_attrs
    end

    def normalize_vm_attrs(vm_attrs)
      normalized = slice_vm_attributes(vm_attrs, ['cpus', 'firmware', 'guest_id', 'annotation', 'resource_pool_id', 'image_id'])

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/models/compute_resources/foreman/model/vmware.rb:687 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/7779d4b5732fd6d5. Report an issue: GitHub.