有没有类似Setup x86的网页克隆工具,在线求回答的英文 请高手指点

查看:2681|回复:10
助理工程师
SUN 在x86 平台上虚拟化技术目前有以下3类:
1.Solairs 容器和zone
2.VirtualBox
3.XEN ——SUN xVM
前两者大家应该都有所熟悉了,但基于solaris 内核的xen虚拟化技术知道的人还不多。
让我们从今天开始,一起来学习solaris上的xen虚拟化技术吧!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
《配置opensolaris 为xVM dom0的方法》
通过下面的步骤,我们可以将OpenSolaris( 2008.11 或2009.06版本)配置为 xVM dom0.
创建一个单独的构建环境 (非必须): $ pfexec beadm create -a -d xvm xvm
安装必要的软件包: $ pfexec beadm mount xvm /tmp/xvm-be
$ pfexec pkg -R /tmp/xvm-be install SUNWvirt-manager SUNWxvm SUNWvdisk SUNWvncviewer
$ pfexec beadm umount xvm
复制代码如果你运行的是最近版本的 OpenSolaris, 你可以通过软件包更新服务安装 xvm-gui 软件包集合来代替以上步骤。
编辑GRUB菜单的menu.lst 文件,为使用xVM添加一个启动选项。这一步对beadm 重新引导进入Xen环境是必需的。&&
在/rpool/boot/grub/menu.lst文件中添加以下内容
#============ ADD For xVM=============
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/xvm
kernel$ /boot/$ISADIR/xen.gz
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=text
module$ /platform/i86pc/$ISADIR/boot_archive
#============ End of LIBBE entry =============
重新启动系统,如果grub菜单默认没用选择xvm条目,手动选择使用xvm一项引导。
启用 xVM 服务. $ svcadm enable -r xvm/ svcadm enable -r xvm/domains
复制代码现在你可以安装 guest domains 了。
Oracle Freeware for your Art Life& && && &
助理工程师
本帖最后由 云杉上的蝴蝶 于
18:10 编辑
系统管理配置
目前针对Solaris dom0s 有一些强烈建议的配置步骤。
限制ZFS ARC
ZFS是集成在Solaris内核中的,如果我们把ZFS看成是一块磁盘陈列卡,那么ARC就是陈列卡上的缓存。
目前ZFS与dom0的互动能力比较差,很容易贪食所有的可用内存。所以有必要对ARC使用的物理内存进行限制。
方法是在/etc/system文件中加入以下条目: set zfs:zfs_arc_max = 0x
复制代码以上设定限制ARC可用的最大物理内存为256MB。
此设定需要重新启动系统来生效!
通过此Xen选项可以限制dom0使用的物理内存大小。例如在你有4G内存的情况下,可以限制dom0可用的物理内存为1G。
方法是修改/rpool/boot/grub/menu.lst文件中相应的kernel$ 条目最后添加dom0_mem 选项: …
kernel$ /boot/$ISADIR/xen.gz dom0_mem=1024M
复制代码使用一个dump 文件系统
xend 默认的将在/var/xen/dump目录下保存当domain崩溃时的系统dump。为防止这些dump文件填满root文件系统,你可使用一个专门的ZFS 文件系统来存放这些dumps # zfs create -o mountpoint=/var/xen/dump,quota=4G rpool/xendumps
复制代码以上命令在root 文件系统所在的ZFS存储池 rpool上创建一个新的ZFS文件系统xenddumps挂载到xend存储系统崩溃dump文件的默认目录,并限制dumps可占用的最大磁盘存储空间为4G。
开发人员配置
如果你正从事Xen或Solaris的开发工作,还有一组非常有用的设置。
启用 libvirt 调试
要启用libvirt调试,你需要安装 xVM调试软件包。你可以调试libvirt客户端例如virsh : # LIBVIRT_DEBUG=1 virsh list
复制代码调试信息将输出在控制台上。调试libvirtd有点困难。首先,确保您具有核心管理权限,设定方法如下: # coreadm -e global -e global-setid -e log -g /var/cores/core.%f.%p
& &&&global core file pattern: /var/cores/core.%f.%p
& &&&global core file content: default
& && & init core file pattern: core
& && & init core file content: default
& && && && &global core dumps: enabled
& && & per-process core dumps: enabled
& && &global setid core dumps: enabled
per-process setid core dumps: disabled
& &&&global core dump logging: enabled
复制代码启用 libvirtd日志的方法如下: # svccfg -s virtd
svc:/system/xvm/virtd& setenv LIBVIRT_DEBUG 1
svc:/system/xvm/virtd& end
# svcadm refresh virtd
# echo -e &*.debug\t/var/adm/debuglog& &&/etc/syslog.conf
# touch /var/adm/debuglog
# svcadm restart system-log
# svcadm restart virtd
Serial console
强烈建议设置一个串口终端,那样您将可以捕捉任何来自Xen本身的警告消息。恐慌的邮件可能。如果Solaris设置了使用ttya ,Xen就应该可以使用串口终端。
修改/rpool/boot/grub/menu.lst文件中相应的kernel$ 条目最后添加console选项启用Xen串口终端: …
kernel$ /boot/$ISADIR/xen.gz console=com1 com1=auto dom0_mem=1024M
复制代码启用VNC连接
注意,以下设置将允许任意主机通过VNC会话访问你的主机。
首先确定没有客户主机在运行: # svccfg -s xend &&EOF
setprop config/vnc-listen = astring: &0.0.0.0&
# svcadm refresh xend
# svcadm restart xend
启用客户机迁移
注意:这将运行任意主机迁移domain(客户机)到你的主机上! # node=uname -n
# ip=getent hosts $node | awk '{print $1}'
# svccfg -s xend &&EOF
setprop config/xend-relocation-address = astring: &$ip&
setprop config/xend-relocation-hosts-allow = astring: &.*&
EOF# svcadm refresh xend
# svcadm restart xend
Oracle Freeware for your Art Life& && && &
助理工程师
本帖最后由 云杉上的蝴蝶 于
02:10 编辑
使用 virt-install 安装虚拟主机和客户操作系统
注意:本文内容针对xVM 3.3,老版本的操作方式可能有所不同。
virt-install命令行工具用来安装新的虚拟主机(guest domains)。安装常规,你需要指定客户操作系统(软件)的安装源、虚拟主机的磁盘存储、网络和其他一些参数。然后你将经历客户操作系统的安装流程。一旦virt-install执行完成,客户操作系统也就安装好了,随后你可以通过virsh命令行工具来进行配置。如果你想使用图形界面的虚拟机(guest)安装工具,可以使用virt-manager。 virt-install必须在root用户下运行。
下面会展示一些常用的virt-install命令选项。更详细的内容可以参见 和官方文档 .
配置磁盘存储
--disk 选项允许你为虚拟机指定磁盘存储。xVM支持多种不同类型的存储设备,以下为一些最常见的做法。
配置一个 ZFS 卷 --disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol
复制代码以上示例创建一个10Gb的ZFS卷。ZFS卷可以使用所有的ZFS特性(校验、快照、克隆等)。不过,这也意味着在进行虚拟机迁移时必须使用专门的方法来移动存储设备(ZFS卷)到其他主机系统上,所以如果你要使用实时迁移,ZFS卷不是一个好的选择。
配置本地文件系统上的虚拟磁盘(vdisk) --disk path=/guests/dom1/disk0,size=10,driver=tap,subdriver=vdisk,format=vmdk
复制代码VMDK格式的 是virt-install命令默认的缺省参数,如果指定的目录路径不存在,将被自动创建,vdisk的配置信息和映像文件都存放在此目录下。vdisk的快照和其他功能由vdiskadm提供。
xVM不仅支持VMware的VMDK格式虚拟磁盘,也支持微软的VHD格式(使用format=vhd)和VirtualBox的VDI(使用format=vdi)格式。目前VMDK受到最广泛的支持并且被认为是性能最好的!
配置NFS上的虚拟磁盘 --disk path=/net/nfshost/guests/dom1/disk0,size=10,driver=tap,subdriver=vdisk,format=vmdk
复制代码虚拟磁盘也可以存放在NFS服务器上。对于实时迁移来说这是好的选择,但是记得,在每台主机的dom0中虚拟磁盘所在NFS目录的挂载路径必须一致。
要在NFS上成功创建虚拟磁盘,dom0主机上的xvm用户必须对相应的NFS共享目录具有写权限。
This may involve setting ACLs on the NFS host, or simply a chown of the containing directory to the xvm user or user ID 60.
Configuring an iSCSI volume
--disk path=/alias/iscsi/dom1/disk0,driver=phy,subdriver=iscsi
iSCSI is a networked block device. The example above uses a pre-existing iSCSI volume with the alias iscsi/dom1/disk0. This is useful if you have already configured iSCSI on your dom0 and have volumes available in iscsiadm list target.
In addition to an alias, a volume can be specified by its LUN and target ID: path=/discover/0/iqn..sun:02:d5ab1c26-0a7a-c6b4-98f8-d6d267eb2561. In general, it's simpler to use the Alias given for the volume.
Finally, you can create a static config, in which case the volume isdiscovered, configured, and de-configured for you automatically. Forexample, given an iSCSI target at 192.168.0.70, LUN 0, and a target ID,you might specify path=/static/192.168.0.70/0/iqn..sun:02:d5ab1c26-0a7a-c6b4-98f8-d6d267eb2561.
Configuring a raw physical disk
--disk path=/dev/dsk/c0t1d0s4,driver=phy
You can use a block device accessible to dom0 for guest storage. Thiscan be the best-performing method, but doesn't allow any kind ofhigher-level facilities such as snapshotting. It is also difficult tolive-migrate if the device refers to a local disk drive.
Configuring a raw file--disk path=/guests/dom1/disk0.img,size=10,driver=file
Raw files are not recommended: it's almost always better to use oneof the above methods instead. In particular, attempting to use rawfiles on a ZFS filesystem will be woefully slow.
Configuring networking
You can specify networking for the guest via the --networkoption. Almost always, you will want to share a bridge amongst guestdomains, but you can also dedicate an unused NIC, or perform host-onlynetworking via an etherstub.
Most likely, you will want your guest OS to use DHCP to configureits networking setup. For this to work, a DHCP server must be availableon the virtual network. By default, virt-install will automatically create a random MAC address for the guest with the Xen .If, however, your DHCP server doesn't hand out addresses to unknownclients, you will need to specific a MAC address configured as a clienton the DHCP server. In addition, most PXE and JumpStart setups requirea specified MAC address.
The mac= setting for the --network option can beused to do this: be careful to specify a valid MAC address - not muchvalidation is done. In the examples, we presume that you don't needthis option.
If you are running Xen on a laptop with a wireless connection asyour primary NIC, you cannot use bridged mode, as the wireless chipsetstypically reject any unknown MAC addresses. In this case, you can usean etherstub.
Configuring a bridge
--network bridge=e1000g0
Bridged networking is used for ethernet-based sharing of a physicalnetwork resource. In the example above, a VNIC is created on top of thedom0 interface e1000g0. Alternatively, you can just specify --network bridge, in which case a host NIC will be automatically chosen (typically, the first UPinterface on which a VNIC can be created). In fact, this is preferred,as it allows a guest domain's config to be migrated to host machinesusing a different NIC as the bridge.
Any traffic for the guest's MAC address is sent to the guest via the VNIC. VNICs configured on the system can be shown via dladm show-vnic. This VNIC is automatically removed once the domain is no longer running.
Configuring a dedicated NICSpecifying a network-setup script of vif-dedicated allowsa guest to directly use a NIC on the host, without going through aVNIC. The NIC should not be configured on the host dom0. As of June2009, it's not possible to configure this via virt-install.
FIXME: explain how to set up
Configuring an etherstub
dladm create-etherstub stub0
dladm set-linkprop -p mtu=1500 stub0
... --network bridge=stub0
If you specify an etherstub as your bridge NIC, then you have a form ofhost-only networking: no packets can leave the virtual network createdon top of stub0, as it is not connected to any physical interface. An MTU of 1500 (not the default 9000) is required.
You would typically then install from an ISO. For a networkinstallation to work, you'll have to provide network services on top ofthe etherstub (for example, another guest might be connected to theetherstub to provide an NFS server).
Configuring a VLAN
--network bridge,vlanid=2
To configure a guest to use a particular VLAN ID, use the vlanid setting. For more information, see .
Configuring bandwidth control--network bridge,capped-bandwidth=200M
The capped-bandwidth setting configures Crossbow bandwidth control. For more information, see .
Configuring a network mask--extra-args &-B subnet-mask=255.255.254.0&
If you have a non-standard network mask, the guest OS's default maynot be sufficient. This example tells a Solaris guest to use a mask of255.255.254.0. Any such options are guest-specific. Note that the --extra-args option only apples to -paravirt installations.
Accessing the guest consoleBy default, virt-install will attempt to connect to theguest's console when it starts, to allow an interactive installation.If you want to use a text-console install, the --nographics option can be used. In that case, the guests' console is routed to the terminal from which you invoke virt-install.
Alternatively, specifying --vnc will configure a virtualframe-buffer. In general, this works for both HVM and para-virtualguests, but there are some variations, as shown below.
If you're running virt-install in a graphical environment (that is, $DISPLAY is set, then it will start a VNC viewer connected to the guest console for you. Otherwise, you will see a message like this:
Unable to connect
DISPLAY is not set.&&Please connect to localhost:5900
Domain installation still in progress. Waiting for domain to complete installation.
Keep the virt-install process running, and connect to theVNC viewer given. Note that if you are connecting from a remote host(not dom0), you will have to configure
before starting virt-install.
Oracle Freeware for your Art Life& && && &
初级工程师
虚拟主机(guest -domN )安装示例:
Solaris& opensolaris
从ISO安装opensolaris Guest
virt-install --paravirt --name dom1 --ram 1024 --nographics \
--os-type=solaris --os-variant=opensolaris \
--network bridge \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
--location /isos/osol-200906.iso
从ISO /isos/osol-200906.iso 安装opensolaris到一个ZFS 卷上。1G内存是安装Solaris 的最小内存建议值。因为Solaris上不支持para-virtualized 帧缓冲,所以我们需要使用文本交互模式来安装。在客户操作系统启动后,可以参照下一楼的内容来访问图像安装向导。
注意:opensolaris目前默认需要通过DHCP来配置网络。
Installing a Solaris 10 guest from an ISO virt-install --hvm --name dom1 --ram 1024 --vnc \
--os-type=solaris --os-variant=solaris10 \
--network bridge \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
--cdrom /isos/s10u7.iso
Solaris 10 only supports HVM mode. It's recommended to use at least Solaris 10 Update 7, though earlier versions also work.
Installing a Solaris guest with PXE virt-install --hvm --name dom1 --ram 1024 --vnc \
--os-type=solaris --os-variant=solaris10 \
--network bridge,mac=00:16:3e:1b:e8:18 \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
Presuming you have a PXE server set up waiting for the given MAC address,this example will start up an Solaris guest via PXE boot. Note that only HVM guests support PXE currently.
Installing a Solaris Nevada guest over NFS virt-install --paravirt --name dom1 --ram 1024 --nographics \
--os-type=solaris --os-variant=opensolaris \
--network bridge,mac=00:16:3e:1b:e8:18 \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
--location nfs:netinstall.:/export/nv/x/latest/ \
--extra-args &-B subnet-mask=255.255.254.0&
This is similar to the OpenSolaris ISO install, except that we'reinstalling over NFS. In this case, we've chosen to specify a particularMAC address. We also have a non-standard subnet mask, so need to addthat. Unlike OpenSolaris, Nevada has a text installer, so you caninstall directly from the console (this is recommended).
从ISO安装 Windows guest virt-install --hvm --name dom1 --ram 512 --vnc \
--os-type=windows --os-variant=win2k \
--network bridge \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
--cdrom /isos/windowsxp.iso
因为Windows 不具备Full-PV 模块,我们需要特别的指定虚拟化类型( --hvm)并使用--cdrom选项指定iso文件的位置来进行安装。安装Windows 客户机系统的过程中,客户机需要重新启动数次。virt-install将保持运行状态直到客户机重新启动,在安装完全完成以前,不要更改cdrom中的安装媒体。
Installing a Linux guest over HTTP virt-install --paravirt --name dom1 --ram 1024 --vnc \
--os-type=linux --os-variant=fedora8 \
--network bridge \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
--location http://fedora.mirror.facebook.net/linux/releases/10/Fedora/x86_64/os/
Some versions of Linux, such as CentOS, Fedora, and others, caninstall directly from HTTP. Choose a suitable mirror nearest your hostdom0.
Note that some Linux versions such as Fedora 10 will , and also have problems starting X: a text install via VNC works, however.
Some distributions allow you to change the RTC setting (for example,Fedora has a &System clock uses UTC& checkbox). If there is such anoption, leave it as UTC: even though Solaris dom0 uses a localtime RTC,the system ensures the RTC is virtualized correctly for Linux, as longas you specify the --os-type flag.
Installing a Linux guest from an ISO image mount -F hsfs /isos/opensuse11.iso /mnt
share -o ro /mnt
virt-install --paravirt --name dom1 --ram 1024 --vnc \
--os-type=linux --os-variant=sles10 \
--network bridge \
--disk path=/tank/guests/dom1/disk0,size=10,driver=phy,subdriver=zvol \
--location nfs::/mnt
If you cannot do an HTTP install, your other option is to use NFS-over-ISO. Since Linux is unable to do --paravirt installs from an ISO image, you have to share the ISO image over NFS, and install that way.
Make sure to specify the FQDN of your NFS host. Typical Linuxinstallations insist on using DNS to resolve the names, so won't beable to find partial names like nfshost.domain.
Oracle Freeware for your Art Life& && && &
初级工程师
本帖最后由 云杉上的蝴蝶 于
00:25 编辑
How to Set up OpenSolaris 2008.11 or later as a Paravirtual Guest
安装 Paravirtual Opensolaris 虚拟主机(Guest Domain/DomU) 的方法
对照Opensolaris官网xVM 社区页面的说明,操作步骤如下:
To start the installation of the OpenSolaris 2008.11 or later release, run the following commands:
//官网的示例是使用zfs zvol 作为虚拟机的虚拟硬盘,所以示例中第一步就是创建一个新的zvol。
# zfs create rpool/zvol
# zfs create -V 10G rpool/zvol/domu-220-root
//然后是安装新的虚拟机(guest domain)
# virt-install --nographics --paravirt --ram 1024 --name domu-220 -f
/dev/zvol/dsk/rpool/zvol/domu-220-root -l /isos/osol-2008.11.iso
//官网示例是使用virt-install命令来创建新domain ,其实我也可以使用xen 的GUI管理工具的新建主机向导来操作。
//这个工具在opensolaris 称为:“Virtual Machine Manager” ,在opensolaris 桌面的 “应用程序”-&“系统工具”菜单下。
//具体使用示例参见: 这篇主题11楼的内容。
Note - This procedure assumes that your server is set up to assign dynamic addresses. If you want to assign static addresses, specify the --mac option.
//上面这句官网的说明意为: opensolaris默认使用动态模式分配网卡地址,如果要分配静态地址,需要使用--mac 设定相应的静态mac地址。
For the purposes of this installation, choose the defaults on the console for the two questions regarding the server setup.
//新虚拟机的初始配置完成会自动启动,并尝试从指定的操作系统安装源(系统安装盘的iso文件)引导虚拟机。同时会自动打开一个连接到虚拟机的字符终端窗口。
//常规的,opensolaris 的live cd 在引导过程中会提示你选择键盘语言类型和默认的桌面语言。
After the OpenSolaris 2008.11 Live CD has finished booting, a VNC session is available from within the guest domain.
/*因为此时虚拟机的控制终端窗口是字符终端模式,所以opensolaris live cd 完成引导后,你只能在终端看到”opensolaris console login “的提示,而不会像在HVM模式其他虚拟主机软件上安装时出现登录后的图像用户界面。这时,我们就需要通过vnc连接到虚拟机,以操作图形界面进行后续的安装opensolaris到硬盘的工作。
opensolaris live cd 完成系统引导后默认会开启vnc服务*/
//官网给出的vnc连接方法如下:
You can connect to the guest domain's VNC session as follows:
# domid=`virsh domid domu-220`
# ip=`/usr/lib/xen/bin/xenstore-read /local/domain/$domid/ipaddr/0`
# port=`/usr/lib/xen/bin/xenstore-read /local/domain/$domid/guest/vnc/port`
# /usr/lib/xen/bin/xenstore-read /local/domain/$domid/guest/vnc/passwd
# vncviewer $ip:$port
//在dom0上打开一个终端
//首先通过virsh 获取虚拟机的id (xen/xVM 中称为domid),并将virsh取到的domid 赋值给系统shell 变量domid
//然后使用xenstore-read 工具,从虚拟机配置数据库中读取虚拟主机的当前IP 和vnc 服务的端口号,并把命令返回赋值给shell 变量 ip 和port
//随后最关键的一步:通过 xenstore-read工具,从虚拟机配置数据库中读取虚拟机vnc 连接的密码。
//最后将ip和port shell变量作为vncviewer的参数启动vncviewer 连接到虚拟机。
Enter the given password at the VNC password prompt. This will bring up a VNC session.
//vncviewer 会提示你输入vnc连接的验证密码,输入刚才通过xenstore-read读取到的密码。(区分大小写)
//如果密码通过验证,你就能看到opensolaris 的桌面了!
在实际操作中,你可能会和我一样遇到一个问题,按照官网示例执行以下命令无法成功获取vnc连接验证密码:
root@qhoxvm: /usr/lib/xen/bin/xenstore-read /local/domain/$domid/guest/vnc/passwd
/usr/lib/xen/bin/xenstore-read: couldn't read path /local/domain/virsh
通过查阅xen与vnc的相关文档和不断的尝试,终于找到了正确的方法:
下面是我的操作步骤:
1.使用VM manager 的向导完成新虚拟机的配置
2.在guest domain的控制台出现opensolaris console login 的提示后 首先使用 jack / jack (uname/pwd) 登陆终端。
3.su 到root 用户,默认密码是opensolaris
4. ifconfig -a 查看到之前分配给虚拟机的网卡设备名称 (xnf0)
//xVM 结合了Crossbow 网络虚拟化技术,默认会自动在Dom0 中创建一块虚拟网卡(可以动感 dladm show-link 命令查看到),并且自动桥接到指定的物理网卡。
5.ifconfig xnf0 xx.xx.xx.xx //在虚拟机中为网卡设定一个静态ip地址,(否则你需要配置一台dhcp服务器来为guest domain 分配IP)
6.回到dom0 的桌面,在&Virtual Machine Manager&主窗口中你会看到目前系统上的主机列表 最前面有个ID ,这个值就是domid,所以我们不必使用终端命令来获取。
(Domain-0 的id 是 0,其他Guest Domain 的ID是系统自动分配的。)
/*通过终端命令获取domid 的方法是:首先在终端输入 命令: virsh ,然后在 virsh # 提示符下输入 domid xxxxx(虚拟主机的名称),然后virsh程序会返回主机名对应的domid ,最后输入quit 退出virsh 虚拟机调试程序。
7.输入以下命令获取vnc 的连接验证密码
root@qhoxvm: /usr/lib/xen/bin/xenstore-read /local/domain/6/guest/vnc/passwd
//6 是那部虚拟机对应的domid
8.在dom0 的终端输入vncviewer 命令启动vnc 客户端 ,然后输入刚才在虚拟机的终端中设置的网卡IP,当vnc viewer提示输入连接验证密码时,输入刚才得到的vnc 连接密码,然后你就能看opensolaris 的桌面了。
//因为用Virtual Machine Manager 中的向导创建的新虚拟机,虚拟机配置程序自动创建的虚拟网卡是默认桥接到指定的物理网卡的,所以在虚拟机中给网卡设定了IP后,就可以从局域网中的其他主机用vnc客户端连接到这部虚拟机进行操作。
最后,点击Opensolaris桌面上 的快捷方式将Opensolaris安装到硬盘。
Oracle Freeware for your Art Life& && && &
助理工程师
New Network Options, Including Limiting Bandwidth and Setting a VLAN ID, for VirtualNetwork Interfaces Attached to a Guest
VLAN IDs are used to separate each guest domain'snetwork traffic from other guest domains and from dom0.Bandwidth limits define throughput of a communication path.
Both VLAN ID and bandwidth limits can be provided:
Through virt-install
Through the XML domU configuration file and virsh attach-interface
Through the .py domU configuration file andxm network-attach
New conventions for network options are present in virt-install.
virt-install, With new -w/--network OptionThenetwork related options are now grouped into one option, -w or --network. Earlier network options, such as mac=, are now grouped into properties of the -w or --network option. The properties are separated by commas.
For example:
#virt-install ...--network mac=a:b:c:d:e:f,bridge=bge0,vlanid=1,capped-bandwidth=100M\
& && && && && & --network mac=g:h:i:j:k:l,bridge=bge1,vlanid=2,capped-bandwidth=200M...
The four supported properties of the -w or --network option are:'mac', 'bridge', 'capped-bandwidth' and 'vlanid'. The 'mac' and 'bridge' propertiesare converted fromearlier options. The new 'capped-bandwidth' and 'vlanid' properties were added forspecifying the VLAN ID and the bandwidth limit.
The dladm(1M) command and its -v option are leveraged to set the VLAN ID and bandwidth limit for virtual network interfaces ofguest domains managed by the hypervisor.&&
Bandwidth limit is specified as an integerwith one of the scale suffixes K, M, or G (for Kbps, Mbps, or Gbps, the same format used in thedladm(1M) command line).
The minimum bandwidth supported is 1.2Mbps.
Providing Bandwidth Limit Information and Setting VLAN ID through virshA new option, --capped-bandwidth, has been added to the virshattach-interface command line syntax. The option is used to provide bandwidthlimit information while attaching a new virtual interface to a guest domain:
--capped-bandwidth &bandwidth_string&
where bandwidth_string is an integer with one of the scale suffixes K, M, orG (for Kbps, Mbps, or Gbps, which is the same format used in thedladm command line).For example:
# virsh attach-interface domu bridge bge0 --capped-bandwidth 100M
Bandwidth can also be specified in XML format configuration file with anew XML elment, 'cappedbandwidth', under 'networkresource' elment,which is also new.Three attributes are set for cappedbandwidth to express the bandwidth limit:
The supported units are 'gigabit', 'megabit' and 'kilobit'.
The supported periods are 'second', 'millisecond' and 'microsecond'.
The value is an integer that expresses the amount of data in unit allowed to betransferred in the specified period of time.
The minimum bandwidth supported is 1.2Mbps.
Another new option, --vlanid, has also been added to the virshattach-interface command line syntax. This option is used to specify the VLAN ID while attaching a new virtual interface to a guest domain:
--vlanid &vid&
For example:
# virsh attach-interface domu bridge bge0 --vlanid 2
VLAN ID can also be specified in an XML format configuration file with a new XML element, vlan, where the attribute is the ID.
The following example shows the usage of the new options:
& & &interface type='bridge'&
& && &&source bridge='e1000g1'/&
& && &&vlan id='1'/&
& && &&networkresource&
& && &&&&cappedbandwidth unit='megabit' period='second' value='100'/&
& && &&/networkresource&
& & &/interface&
Providing VLAN ID and Bandwidth Limit Information through xmThe current xm command line supportsspecifying bandwidth limit for a virtual interface by using the 'rate' option. For example:
#xm network-attach domu rate=100Mb/s
The minimum bandwidth supported is 1.2Mbps.
The current .py configuration file format also supportsspecifying a bandwidth limit for a specific virtual NIC device.
The bandwidth is set by using the 'rate' property when defining a virtual NIC device. For example:
vif = [ 'bridge=bge0,rate=100Mb/s' ]
xend string format is used to specify bandwidth limit. The minimum bandwidth supported is 1.2Mbps.The new option 'vlanid' added to the xm network-attachcommand line syntax is used to specify the VLAN ID for the attached virtual interface.&&For example:
#xm network-attach domu vlanid=2
An example for setting vlanid= in the .py file is:
vif = [ 'bridge=bge0,vlanid=1' ]
Oracle Freeware for your Art Life& && && &
助理工程师
不都图形化了么,还整命令行干啥
初级工程师
饭要一口口吃!
Oracle Freeware for your Art Life& && && &
助理工程师
solaris 10 系统安装完成后,默认就允许使用vncviewer、Xmanager 等工具远程连接登录服务器的图形用户界面,但是opesolaris出于安全性设计默认没有开发远程GUI登录,可以通过以下设置企业opensolaris的远程GUI 登录。
How to Set Up VNC to provide Solaris domU graphical login with gdm
& & * Enable XDMCP for GDM
# printf '[xdmcp]\nEnable=true\n' &&/etc/X11/gdm/custom.conf
# svcadm restart gdm
& & * Make sure GDM is running
# svcadm enable -s gdm
& & * Set X11-server to listen to tcp port.
# svccfg -s x11-server
svc:/application/x11/x11-server&
svc:/application/x11/x11-server& setprop options/tcp_listen=true
& & * Turn on xvnc-inetd services.
# svcadm enable xvnc-inetd
How to Set Up VNC to provide Solaris domU graphical login with cde
& & * Turn on xdmcp.
# svccfg -s cde-login
svc:/application/graphical-login/cde-login&
svc:/application/graphical-login/cde-login& setprop dtlogin/args=&&
& & * Set X11-server to listen to tcp port.
# svccfg -s x11-server
svc:/application/x11/x11-server&
svc:/application/x11/x11-server& setprop options/tcp_listen=true
& & * Turn on xvnc-inetd services.
# svcadm enable xvnc-inetd
& & * You should now be able to get a Solaris login console from the remote host by using vncviewer.
# vncviewer domU:0
Oracle Freeware for your Art Life& && && &
助理工程师
Virt-Manager的使用示例
启动并以root登录opensolaris xVM(xen) Dom0后,从[应用程序]菜单的[系统工具]菜单项中可以看到名为[虚拟系统管理]的项目。
这个就算xen的GUI管理工具
单击此条目后将出现以下窗口:
单击“connect”即可连接到Xen Server(本机的Dom0),然后就能看到Virt-Manager的主界面
选中Domain-0 条目,在由键菜单中点击“Detail”可查看Dom0 的系统资源详细配置信息!
Dom0 的运行状态
这里可以动态调整domain可用的最大内存数
这里可以动态调整Domain可用的vCPU数。
下面示例Guest Domain(DomU,或通俗得称:虚拟机)的配置。
首先选择主界面(如第二张图)上的“File”菜单,选择“New Machine”,随后将看到新建虚拟机的向导首页!
之后的步骤需要说明的地方都直接在图上直接做了批注,有不明白的大家可以更贴提出!
如果选择使用虚拟磁盘文件的话,设置如下图
Oracle Freeware for your Art Life& && && &
助理工程师
本帖最后由 云杉上的蝴蝶 于
23:48 编辑
今天做了一些实验,证实了xen guest domain (domU)的虚拟网卡确实是动态创建的,每一次重新启动,domU的domid都会变化(自增),使用dladm show-list 看到的xen创建的虚拟网卡名字也是跟着domid 变化的。
另外在通过virsh dumpxml 导出domU配置文件,修改硬件配置,然后使用virsh define 将修改后的硬件配置应用到虚拟机的实验中,发现domU虚拟网卡只能设定为桥接、NAT 到物理网卡设备,不能使用任何形式的虚拟网卡(比如用dladm 创建的虚拟网卡或传统的类似hostname.eth0:1形式的虚拟网卡)。
否则在启动虚拟机时xm 调用虚拟网卡配置脚步会出错,导致domU启动失败。这一点做的要比VirtualBox要差。
特别是每次domU重新启动都会改变虚拟网卡的设备名,将导致某些特定的应用受到限制。
比如:如果网卡设备名改变,mac也跟着变,在domU上配置的iSCSI target 和 initiator的IQN是不是也会改变甚至失效呢!
Oracle Freeware for your Art Life& && && &

我要回帖

更多关于 回答的英文 的文章

 

随机推荐