vNoob 09月29日 10:48
在Proxmox上部署LXC容器
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

在Proxmox服务器上部署Linux容器(LXC)是一个快速且直接的过程。首先需要在Proxmox中创建一个资源池,然后下载模板,如Ansible模板。接着,通过填写容器名称、密码、资源池、模板、磁盘大小和位置等设置来部署容器。配置IP地址为DHCP,并可选择设置DNS。部署后,容器可能需要手动启动。部署完成后,可通过浏览器访问或使用Proxmox控制台登录。此过程展示了如何使用Proxmox管理LXC容器,并简要介绍了Ansible模板。

🏢 创建资源池是部署LXC的第一步,在Proxmox的Datacenter菜单下选择Pools并创建。命名资源池时,可以选择直观的名称,如'Pool 1'。

📥 下载模板是关键步骤,在CT Templates中选择存储设备,Proxmox提供了多种模板供选择,如Ansible模板,方便后续部署。

🔧 部署容器时,需要设置容器名称、密码、选择资源池、模板、磁盘大小和位置。配置IP地址为DHCP,并可选择设置DNS。

🚀 部署后,容器可能需要手动启动。通过Proxmox控制台或浏览器访问,按照模板提供的指令进行后续配置,如创建管理员密码和API密钥。

🔍 Ansible模板实际用于Semaphore,这是一个UI工具,用于简化Ansible的配置和管理,可用于自动化任务和系统管理。

Deploying a LinuX Container(LXC) seemed like the next logical step in this Proxmox journey. The process is fairly quick and straightforward.

Before we dig in it should first be noted that although Linux Containers and Docker Containers both have “container” in the name, they are very different. I like this Pure blog discussing the differences.

Create a Pool

The first step in deploying LXC is to create a Pool in Proxmox. Click Datacenter in the left-hand pane, then select Pools under permissions, then Create. This is not necessarily an intuitive location so hopefully this screenshot helps.

I decided to be very original and name it Pool 1.

Downloading Templates

Next, we need to grab a template for use with our LXC. Select the storage device, in my case local, and then CT Templates.

In this screenshot, I already have some from previous efforts, but this will be empty on a fresh Proxmox deployment. Fortunately, if you select the Templates button there are a ton of templates to easily add to Proxmox.

And this is only a small handful. Having used Ansible in the past, I was curious how the Ansible template would look.

After choosing to download the template a status screen appears to give updates.

Deploy Container

Finally, we can deploy our container. You can either right-click the host, then Create CT or select Create CT on the top-right of the window.

Choose a name for the container and password. Select the Resource Pool created earlier. The option to proceed won’t appear until all these fields are complete.

Choose the desired template, in this case the ansible one I just downloaded.

Determine disk size and location.

For this test, I stuck with defaults for CPU and Memory.

I did however want to use DHCP for the IP address of the container.

Lastly, enter DNS settings if you like, and finish

A new task window will appear to give status updates.

In this particular instance, the container failed to start after deployment, so I needed to start it manually which succeeded.

Once deployed, I try the IP in a browser

It has instructions to console into the container in Proxmox, and login as root, using the password I configured at deployment.

Next, I am instructed to create an admin password:

Then an optional API key, this optional though so I skip it.

It then asks a few more questions about configuring an email and installing security updates, but I skip those as well as they are optional and this is just a temporary container

Then finally, it is done and I can log in.

Turns out the Ansible template is for Semaphore, which is a UI for Ansible among other things. I may poke around with it later.

That is how to deploy a LXC on Proxmox. Have a great one.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Proxmox LXC Linux容器 资源池 Ansible模板 Semaphore
相关文章