Esempio n. 1
0
    def get_rdp_console(self, instance):
        LOG.debug("get_rdp_console called", instance=instance)
        host = self._hostops.get_host_ip_addr()
        port = self._rdpconsoleutils.get_rdp_console_port()
        vm_id = self._vmutils.get_vm_id(instance.name)

        LOG.debug("RDP console: %(host)s:%(port)s, %(vm_id)s",
                  {"host": host, "port": port, "vm_id": vm_id})

        return ctype.ConsoleRDP(
            host=host, port=port, internal_access_path=vm_id)
Esempio n. 2
0
    def get_rdp_console(self, instance):
        """Get connection info for a rdp console."""
        LOG.debug("get_rdp_console called", instance=instance)
        if self.remote_display and self.vrde_module == constants.EXTPACK_RDP:
            host = hostutils.get_ip()
            access_path = None if self._ports['unique'] else instance.name
            port = self._get_vrde_port(instance)
            if port:
                LOG.debug("RDP console: %(host)s:%(port)s, %(path)s", {
                    "host": host,
                    "port": port,
                    "path": access_path
                })
                return console_type.ConsoleRDP(
                    host=host, port=port, internal_access_path=access_path)
            else:
                LOG.warning(i18n._LW("RDP port not found."), instance=instance)
        else:
            LOG.warning(i18n._LW("VNC console is not available for this "
                                 "instance."),
                        instance=instance)

        raise exception.ConsoleTypeUnavailable(console_type='rdp')
Esempio n. 3
0
 def get_rdp_console(self, context, instance):
     return ctype.ConsoleRDP(internal_access_path='FAKE',
                             host='fakerdpconsole.com',
                             port=6969)
Esempio n. 4
0
    def test_console_rdp(self):
        c = ctype.ConsoleRDP(host='127.0.0.1', port=8945)

        self.assertIsInstance(c, ctype.Console)