你同时也可以上传ISO镜像创建KVM的客户机:
想要删除一个Template或者是ISO文件的话,先选定想要删除的文件,再点击上方的“删除”按钮:
5创建OpenVZ容器
创建OpenVZ容器:
… 填写这些表格。一步步填写好这些参数,选择容器(OpenVZ)和你想使用的template。指定一个主机名(例如 vm1.example.com),内存和SWAP的大小,设置一个root密码,选择Virtual Network(venet)并为容器指定一个IP地址(例如 192.168.0.102),填写一个VM1D,选择一个集群节点(如果你不创建一个集群的话(参考第三章),你仅仅选择了master,而没有远程的 主机。)确定容器是否需要在主机启动的时候自动启动,并填写一到两个DNS服务器(例如 202.102.128.68和202.102.134.68).然后点击create:
选择openvz模板:
这个容器就会被创建了…,DNS没有设置,等以后再设置吧。这样的话这个容器就会被列在左侧的List 接点server1下。这个容器是停止的;要启动它,点击这个容器,然后点击右上角的启动等操作。
这时就会打开你可以控制这个容器的地方,要启动容器,只需点击右上角的启动按钮即可:
你应该能看到右上角的控制台按钮,如果你点击它,一个基于浏览器的JAVA终端界面就会弹出来,通过它你可以控制虚拟机(这对于desktop的机器特别有用;如果这个虚拟机是台服务器,你也可以通过SSH连接它(例如PuTTY)).
***注意事项***
这里注意了,2.2版本下控制台openve容器用不了,无法正常显示,而创建的VM即KVM创建的虚拟机可以正常使用,刚开始自己一直以为自己一定是哪里又做错了,还一度怀疑过是不是模板有问题,本来嘛,给出的模板是tgz的压缩文件,通过打开查看,看得出像是系统装完之后的所有文件。但是文件大小又有点让我怀疑,怎么可能3-4GB的盘装完就只有200多兆,但是鉴于网上关于proxmoxVE的教程少之又少,只有尝试搞搞。终于怀疑到是不是这个控制台有无法正常显示,其实系统已经在系统下了。在创建了一个ubuntu容器之后,把它运行起来之后,在网络中添加了一个局域网IP,
然后用ping测试竟然是通的,立马用ssh连接,顺利登录进去。自此方知2.2版本下默认openve容器不再支持终端控制台,安装了2.1版本测试一切顺利,控制台显示正常。鉴于这种情形,如果习惯了建议用2.1,要想使2.2下openve容器支持终端控制台,可以参考proxmoxVE维基的方法处理:文章链接http://pve.proxmox.com/wiki/OpenVZ_Console
如果想要2.2版本openvz容器能正常使用控制台需要做如下调整:
Debian
§ this will work for all Debian releases:
log in to the Proxmox host.
edit all inittabs under /var/lib/vz/root/ :
nano /var/lib/vz/root/*/etc/inittab
# add this
1:2345:respawn:/sbin/getty 38400 tty1
Debian Lenny 5.0
Login via SSH (or use the VNC "Shell") to your Proxmox VE host and 'vzctl enter CTID' the container:
List all running container:
proxmox-ve:~# vzlist
CTID NPROC STATUS IP_ADDR HOSTNAME
108 23 running 192.168.9.20 ubuntu-1204.proxmox.com
109 18 running 192.168.9.21 centos63-64.proxmox.com
111 15 running 192.168.9.23 centos5-64.proxmox.com
114 14 running 192.168.9.30 deb6-32.proxmox.com
115 15 running 192.168.9.31 deb7-32.proxmox.com
122 14 running 192.168.9.36 deb5.proxmox.com
Enter the container:
proxmox-ve:~# vzctl enter 122
root@debian:/# nano /etc/inittab
On the bottom of /etc/inittab just add the following line:
1:2345:respawn:/sbin/getty 38400 tty1
Save the changes and shutdown/start the container via Console.
Debian Squeeze 6.0
Same as Debian Lenny 5.0
Debian Wheezy 7.0
Same as Debian Lenny 5.0
Ubuntu
Ubuntu 12.04
Login via SSH (or use the VNC "Shell") to your Proxmox VE host and 'vzctl enter CTID' the container:
List all running container:
proxmox-ve:~# vzlist
CTID NPROC STATUS IP_ADDR HOSTNAME
108 23 running 192.168.9.20 ubuntu-1204.proxmox.com
109 18 running 192.168.9.21 centos63-64.proxmox.com
111 15 running 192.168.9.23 centos5-64.proxmox.com
114 14 running 192.168.9.30 deb6-32.proxmox.com
115 15 running 192.168.9.31 deb7-32.proxmox.com
122 14 running 192.168.9.36 deb5.proxmox.com
Enter the container:
proxmox-ve:~# vzctl enter 108
root@ubuntu-1204:/# nano /etc/init/tty1.conf
Change/Create the file that it looks exactly like this:
# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -8 38400 tty1
Save the changes and shutdown/start the container via Console.
Ubuntu 10.04
Same as Ubuntu 12.04
Centos
Centos 5
Login via SSH (or use the VNC "Shell") to your Proxmox VE host and 'vzctl enter CTID' the container:
List all running container:
proxmox-ve:~# vzlist
CTID NPROC STATUS IP_ADDR HOSTNAME
108 23 running 192.168.9.20 ubuntu-1204.proxmox.com
109 18 running 192.168.9.21 centos63-64.proxmox.com
111 15 running 192.168.9.23 centos5-64.proxmox.com
114 14 running 192.168.9.30 deb6-32.proxmox.com
115 15 running 192.168.9.31 deb7-32.proxmox.com
122 14 running 192.168.9.36 deb5.proxmox.com
Enter the container:
proxmox-ve:~# vzctl enter 111
root@centos5-64:/# nano /etc/inittab
On the bottom of /etc/inittab just add the following line:
1:2345:respawn:/sbin/agetty tty1 38400 linux
Save the changes and shutdown/start the container via Console.
Centos 6
Login via SSH (or use the VNC "Shell") to your Proxmox VE host and 'vzctl enter CTID' the container:
List all running container:
proxmox-ve:~# vzlist
CTID NPROC STATUS IP_ADDR HOSTNAME
108 23 running 192.168.9.20 ubuntu-1204.proxmox.com
109 18 running 192.168.9.21 centos63-64.proxmox.com
111 15 running 192.168.9.23 centos5-64.proxmox.com
114 14 running 192.168.9.30 deb6-32.proxmox.com
115 15 running 192.168.9.31 deb7-32.proxmox.com
122 14 running 192.168.9.36 deb5.proxmox.com
Enter the container:
proxmox-ve:~# vzctl enter 109
root@centos63-64:/# nano /etc/init/tty.conf
Change/Create the file that it looks exactly like this:
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/agetty -8 tty1 38400
Save the changes and shutdown/start the container via Console.
另外:通过集群master管理openvz容器主机:
If you still want to use the previous method (vzctl enter CTID) you can open the host "Shell" and just type 'vzctl enter CTID" to manage your containers.
通过在执行相关命令: