1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 惠普服务器ilo默认地址_使用ILO进行HP服务器管理的Docker容器

惠普服务器ilo默认地址_使用ILO进行HP服务器管理的Docker容器

时间:2023-08-18 03:55:10

相关推荐

惠普服务器ilo默认地址_使用ILO进行HP服务器管理的Docker容器

惠普服务器ilo默认地址

Origin in Russian起源于俄语

Well, you can wonder — why would I use docker container for such a purpose? What's the problem to enter web-interface of ILO and manage server as usual?

好吧,您可能想知道-为什么我要使用Docker容器来实现此目的? 进入ILO的Web界面并照常管理服务器有什么问题?

The same thought I had when I've got a few old servers that required a reprovision. The servers are located in different continent and the only interface I had it was just a web interface of ILO. And when I had to enter a few manual commands via Virtual Console I discovered that it's hardly possible.

当我有几台需要重新配置的旧服务器时,我也有同样的想法。 这些服务器位于不同的大陆,我拥有的唯一接口只是ILO的Web接口。 当我不得不通过虚拟控制台输入一些手动命令时,我发现几乎不可能。

For various sorts of Virtual Console of servers (both HP and Dells) usually Java web applets are used. But Firefox and Chrome don't support them anymore and the newest IcedTea doesn't work with those old system anyway. So I had a few options:

对于服务器(HP和Dell)的各种虚拟控制台,通常使用Java Web小程序。 但是Firefox和Chrome不再支持它们,而最新的IcedTea也不适合那些旧系统。 所以我有几个选择:

To install in parallel old versions of browsers and Java, trying to find a required combination, on my system. This option was filtered out, since I don't want to pollute my system just because of few console commands.要在我的系统上并行安装旧版本的浏览器和Java,并尝试找到所需的组合。 此选项已被滤除,因为我不想因为控制台命令很少而污染系统。 Create a virtual machine with old systems, install there Java 6 and use Virtual Console as before.使用旧系统创建虚拟机,在其中安装Java 6并像以前一样使用虚拟控制台。 The same as in point 2, but with container, not a virtual machine. Since a few my colleagues hit the same problem, I'd prefer to pass them one bash command to run Virtual Console instead of sharing Virtual Machine disk, passwords for it, etc etc.与第2点相同,但使用容器而不是虚拟机。 由于一些同事遇到了相同的问题,因此我宁愿向他们传递一个bash命令来运行虚拟控制台,而不是共享虚拟机磁盘,其密码等。

(To be honest, point 3 I made only after point 2).

(老实说,第3点仅在第2点之后提出)。

Point 3 is what we are going to implement today.

第三点是我们今天要实施的。

I've been inspired mostly by these two projects:

我主要受以下两个项目的启发:

docker-baseimage-gui

docker-baseimage-gui

docker-firefox-java

docker-firefox-java

Actually, the first project docker-baseimage-gui contains already all needed configs and tools to start desktop apps in browser within a container. Usually you define specific environment variables and your app will become accessible via browser (websocket) or VNC. In our case we start with Firefox and VNC, websocket didn't work well.

实际上,第一个项目docker-baseimage-gui已经包含了在容器中的浏览器中启动桌面应用程序所需的所有配置和工具。 通常,您定义特定的环境变量,然后您的应用将可以通过浏览器(websocket)或VNC访问。 在我们的例子中,我们从Firefox和VNC开始,websocket不能很好地工作。

Firstly, let's install required packages: Java 6 and IcedTea:

首先,让我们安装必需的软件包:Java 6和IcedTea:

RUN echo "deb /ubuntu precise main universe" > /etc/apt/sources.list && \apt-get update && \apt-get -y upgrade && \apt-get -y install firefox \nano curl \icedtea-6-plugin \icedtea-netx \openjdk-6-jre \openjdk-6-jre-headless \tzdata-java

Now let's open the web page of ILO interface in Firefox and enter credentials there. Start Firefox:

现在,让我们在Firefox中打开ILO界面的网页,然后在其中输入凭据。 启动Firefox:

RUN bash -c 'echo "exec openbox-session &" >> ~/.xinitrc' && \bash -c 'echo "firefox \${HILO_HOST}">> ~/.xinitrc' && \bash -c 'chmod 755 ~/.xinitrc'

Variable HILO_HOST is URL of our ILO interface, for example.

变量HILO_HOST是我们的ILO界面的URL,例如

For automation let's add authentication. ILO login is executed via simple POST request, in response you get session_key value and then pass this value in GET request. Let's discover session_key with curl if environment variables HILO_USER and HILO_PASS are defined:

对于自动化,让我们添加身份验证。 通过简单的POST请求执行ILO登录,作为响应,您获取session_key值,然后在GET请求中传递此值。 如果定义了环境变量HILO_USER和HILO_PASS,让我们发现带有curl的session_key:

export HOME=/configexport HILO_HOST=${HILO_HOST%%/}SESSION_KEY=""data="{\"method\":\"login\",\"user_login\":\"${HILO_USER}\",\"password\":\"${HILO_PASS}\"}"if [[ -n "${HILO_USER}" && -n "${HILO_PASS}" ]]; thenSESSION_KEY=$(curl -k -X POST "${HILO_HOST}/json/login_session" -d "$data" 2>/dev/null | grep -Eo '"session_key":"[^"]+' | sed 's/"session_key":"//')fiecho "SESSION_KEY=$SESSION_KEY"echo $SESSION_KEY > /session_key

After we wrote session_key in containers we can start VNC server:

在容器中写入session_key之后,我们可以启动VNC服务器:

exec x11vnc -forever -create

Now just connect with VNC client to port 5900 (or what you defined in your choice) to localhost and enter the Virtual Console of HP server.

现在,只需将VNC客户端连接到本地主机的端口5900(或您选择的端口),然后输入HP服务器的虚拟控制台即可。

The code is located in git repository docker-ilo-client.

该代码位于git存储库docker-ilo-client中 。

Full one line command to connect to ILO Virtual Console:

完整的一行命令可连接到ILO虚拟控制台:

docker run -d --rm --name ilo-client -p 5900:5900 -e HILO_HOST=https://ADDRESS_OF_YOUR_HOST -e HILO_USER=SOME_USERNAME -e HILO_PASS=SOME_PASSWORD sshnaidm/docker-ilo-client

where ADDRESS_OF_YOUR_HOST is hostname of ILO, SOME_USERNAME is login and SOME_PASSWORD is password for ILO.

其中ADDRESS_OF_YOUR_HOST是ILO的主机名,SOME_USERNAME是登录名,SOME_PASSWORD是ILO的密码。

Next just go with any VNC client to addressvnc://localhost:5900.

接下来,只需与任何VNC客户端一起访问vnc://localhost:5900

Pull requests and comments are more than welcome.

拉取请求和评论非常受欢迎。

The similar project for connection to Dell IDRAC servers is here: docker-idrac6.

用于连接到Dell IDRAC服务器的类似项目在这里: docker-idrac6 。

翻译自: /en/post/452516/

惠普服务器ilo默认地址

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。