寻觅生命中的那一片浅草......

文章属于类别 虚拟化

Xen和KVM虚拟机管理工具:Convirture

又一款Xen和KVM虚拟机管理工具:Convirture
产品主页:http://www.convirture.com/index.php
分企业版和开源版

主要特性
1.开源免费
2.多平台支持,能同时支持xen和vmware等虚拟机平台的管理
3.可以实现虚拟机服务器的控制,如打开、关闭、暂停、恢复等
4.可以灵活地对虚拟机服务资源进行配置
5.实时的数据监控、如CPU、内存、硬盘等;可以查看所有的服务器配置信息,快照功能
6.虚拟服务器可实现迁移
7.可以通过管理平台快速创建虚拟机系统、创建系统采用模板化配置管理
8.可以在管理平台上实现对虚拟机的桌面化管理

ConVirt 2.0 Open Source is the leading open source product for managing Xen and KVM, enabling you to standardize and proactively manage your virtualized environment in a centralized fashion. With ConVirt, you can create and provision “gold” images, diagnose performance problems, and balance load across the data center, all from a highly interactive Web based interface and with consistent feature set across open source virtualization platforms. As an open source product, ConVirt 2.0 Open Source is free to download and use. With a large user community and the commercial backing of Convirture, companies large and small use ConVirt as the strategic solution to their virtualization management needs.

让OpenVZ 更加好支持iptables

在硬件节点内修改iptables挂载模组

vim /etc/sysconfig/iptables-config

IPTABLES_MODULES=”ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp”

vim /etc/sysconfig/vz

IPTABLES=”ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp”

重新启动VZ服务

service vz restart

放行更加多的iptables 条目

# vzctl set $CTID –numiptent 400 –save

vzctl enter $CTID

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -I INPUT -j ACCEPT -m state –state ESTABLISHED,RELATED
iptables -I FORWARD -j ACCEPT -m state –state ESTABLISHED,RELATED
iptables -I INPUT -j ACCEPT -i lo
iptables -I INPUT -p tcp –dport 25 -j ACCEPT
iptables -I INPUT -p tcp –dport 110 -j ACCEPT
iptables -I INPUT -p tcp –dport 995 -j ACCEPTiptables -I INPUT -p tcp –dport 80 -j ACCEPT
iptables -I INPUT -p tcp –dport 53 -j ACCRPTiptables -I INPUT -p udp –dport 53 -j ACCEPT
service iptables save
service iptables restart

转载自:
http://hi.baidu.com/enjoyunix/blog/item/09cc631bd1cec1dcac6e7573.html

Proxmox_KVM虚拟机无法启动

虚拟管理平台是Proxmox

虚拟的2008无法启动,怀疑是该虚拟机配置引起的问题,故尝试把cdrom删掉,结果报以下错

抄下来,在ssh上直接输入

/usr/sbin/qm set 103 –localtimie –freeze 0 –acpi 1 –kvm 1 –startdate –bootdisk ide0 –boot c –vga –cpuunits 1000

结果报几个选项是未知的,修改为

/usr/sbin/qm set 103 –freeze 0 –acpi 1 –kvm 1 —bootdisk ide0 –boot c –cpuunits 1000

执行后报以下错误

setting parameters failed – VM is locked (backup)

网上搜多了下,大多是备份时lock的,查找配置文件

locete 103.conf

/etc/qemu-server/103.conf

/var/lock/qemu-server/lock-103.conf

vi /etc/qemu-server/103.conf

发现有一行lock的,把它注释掉,就可以启动了

比较文明的解锁方法应该是

qm unlock 103

Proxmox 几个目录

Openvz的虚拟机配置文件

/etc/vz/conf

KVM的虚拟机配置文件

/etc/qemu-server/

不知道什么原因 ,虚拟出来的2008,过一段时间后 ,网络就特别慢,ping的延迟特别高,估计是虚拟出来的网络问题?

VboxHeadless & How To Swing It

About a week ago I posted a guide on how to install VirtualBox 3.0.2. While it is a great desktop virtualization solution there are a few things that leave you wanting more when it comes to a headless server. VMWare in this area still has much better solutions for managing several servers. But for small operations VirtualBox does have some options for managing your headless vm’s. This guide assumes that you already have VirtualBox 3 installed. If not I suggest you go take a look at my guide on how to perform the installation before you continue here.

Most tutorials you find out there will always suggest running thing through the sudo command as a regular user. However for this particular guide does not. The commands run here depend on the user running them. So in essence, if you follow this guide as it is written all VirtualBox settings are written to the ~/.VirtualBox/ directory. But, if you run these as root. All the configuration information would be stored in the /root/.VirtualBox/ directory.

So what we will need to continue are the following,

Remote connection to our host server (ssh is ideal)
rdesktop(linux) or Remote Desktop Connection(windows) installed to remotely connect to our headless vm’s from a remote computer
A .iso installation medium or an existing .vdi image to import.
First I’ll cover how to create a new virtual machine, afterwards I’ll go over how to import an existing virtual machine to your headless server.

Login to your Linux headless server and create a new vm. I’ve chosen to install a gentoo vm as it was the first .iso file I found on my computer.
$ VBoxManage createvm –name “Gentoo” –register
Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Virtual machine ‘Gentoo’ is created and registered.
UUID: faa5fe89-f75a-4bc9-93b2-063630353e25
Settings file: ‘/scott/.VirtualBox/Machines/Gentoo/Gentoo.xml’
Next we must set our system settings for the virtual machines use. Here I will configure it with 512 megs of memory, enable ACPI, set the first boot device to a DVD, and configure the network adapter to use NAT instead of Bridged networking.

$ VBoxManage modifyvm “Gentoo” –memory “512” –acpi on –boot1 dvd –nic1 nat
Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
After defining the system settings, we must create the virtual hard disk. I will be making mine a 10gigabyte virtual disk.$ sudo VBoxManage createhd –filename “Gentoo.vdi” –size 10000 –remember
Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Disk image created. UUID: ce4226ed-fc66-4749-ac8e-b08975a66ce8
Attach our newly created virtual hard disk to our newly created virtual machine as the first hard drive.

$ VBoxManage modifyvm “Gentoo” –hda “Gentoo.vdi”

Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
Register our installation .iso file to our virtual machine so that it may boot from it to begin the installation. Be sure to replace the path with your relevant path.

$ VBoxManage modifyvm “Gentoo” –dvd /path/to/your/install.iso

Output from previous commandVirtualBox Command Line Management Interface Version 3.0.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
We should now be ready to start our vm. This will run the vm in the terminal as a background process.

$ VBoxHeadless –startvm “Gentoo” &

Assuming everything went smoothly you can now connect to your headless vm with a RDP viewer. Be sure to replace the “YOURSERVERIP” with your host server’s IP address.$ rdesktop -a 16 YOURSERVERIP
To stop your vm from command line.

$ VBoxManage controlvm “Gentoo” savestate

Most desktop computers should already have this. Ubuntu users can use the above command to run rdesktop. If you are in Gnome, it is also located under Applications > Internet > Remote Desktop Viewer. Windows user’s can use the Remote Desktop Connection utility found under Start > Programs > Accessories > Remote Desktop Connection.
So as a closing note, I would highly recommend heading over to http://www.virtualbox.org/manual/UserManual.html#id2515738 . Sun’s documentation on VirtualBox is very well written. There are tons of other things you can do from the command line to manage your vm’s.

How to clone an OpenVZ virtual machine

I need sometimes to clone a vps in an openvz environment, so here you can find three methods to do this task:

first option:

# vzctl stop 101
Stopping VE ...
VE was stopped
VE is unmounted
# cp -r /vz/private/101 /vz/private/202
# cp /etc/vz/conf/101.conf /etc/vz/conf/202.conf
# vzctl start 202
Starting VE ...
Initializing quota ...
VE is mounted
Setting CPU units: 1000
VE start in progress...

the second option:

#mkdir /vz/private/new_VEid
#cd /vz/private/old_VEID
#tar cf - * | ( cd /vz/private/new_VEid tar xfp -)
#cp old_VEID.conf new_VEID.conf

and the third option:

# OLDVE=222 NEWVE=333 # Just an example
# vzctl stop $OLDVE
# mkdir /vz/root/$NEWVE
# cp /etc/vz/conf/$OLDVE.conf /etc/vz/conf/$NEWVE.conf
# cp -a /vz/private/$OLDVE /vz/private/$NEWVE
# vzctl start $NEWVE; vzctl start $OLDVE

from:http://www.vioan.ro/wp/2007/07/30/how-to-clone-an-openvz-virtual-machine/
2024年四月
« 5月    
1234567
891011121314
15161718192021
22232425262728
2930