{"record":{"id":"671f8611cf8163bd","repo":"theforeman/foreman","slug":"the-console-is-not-available-because-the-vm-is-not","errorCode":null,"errorMessage":"The console is not available because the VM is not powered on","messagePattern":"The console is not available because the VM is not powered on","errorType":"exception","errorClass":"Foreman::Exception","httpStatus":null,"severity":"error","filePath":"app/models/compute_resources/foreman/model/vmware.rb","lineNumber":613,"sourceCode":"        \"firmware\" => args[:firmware],\n        \"secure_boot\" => args[:secure_boot],\n      }\n\n      opts['transform'] = (args[:volumes].first[:thin] == 'true') ? 'sparse' : 'flat' unless args[:volumes].empty?\n\n      vm_model = new_vm(raw_args)\n      opts['interfaces'] = vm_model.interfaces\n      opts['volumes'] = vm_model.volumes\n      if args[:user_data] && valid_cloudinit_for_customspec?(args[:user_data])\n        opts[\"customization_spec\"] = client.cloudinit_to_customspec(args[:user_data])\n        opts[\"extraConfig\"] = opts[\"customization_spec\"][\"extraConfig\"] if opts[\"customization_spec\"].key?(\"extraConfig\")\n      end\n      client.servers.get(client.vm_clone(opts)['new_vm']['id'])\n    end\n\n    def console(uuid)\n      vm = find_vm_by_uuid(uuid)\n      raise Foreman::Exception, N_('The console is not available because the VM is not powered on') unless vm.ready?\n\n      case display_type\n      when 'vmrc'\n        vmrc_console(vm)\n      else\n        vnc_console(vm)\n      end\n    end\n\n    def vnc_console(vm)\n      values = { :port => unused_vnc_port(vm.hypervisor), :password => random_password(8), :enabled => true }\n      vm.config_vnc(values)\n      WsProxy.start(:host => vm.hypervisor, :host_port => values[:port], :password => values[:password]).merge(:type => 'vnc')\n    end\n\n    def vmrc_console(vm)\n      {\n        :name => vm.name,","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/models/compute_resources/foreman/model/vmware.rb#L595-L631","documentation":"Error \"The console is not available because the VM is not powered on\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/models/compute_resources/foreman/model/vmware.rb:613 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}