A summary about creation of kinds of xen domU

Since have worked on xen tests for some time, I decide to do a summary
of domU configurations about how to create xen domUs with xm &
vir-install. In order to use it as a quick reference, all the examples listed
below have been verified on my machine.

1) Create a solaris nevada PV domU with iso image by xm

bash-3.2# cat snv_pv.py
name = "solaris-pv"
memory = "800"
disk = [ 'file:/net/bounty/ftp/pub/CDimages/nv/76/x86/solarisdvd.iso,6,r', 'phy:/dev/dsk/c2d0s5,0,w' ]
on_shutdown = "destroy"
on_reboot = "destroy"
on_crash = "destroy"

2) Jumpstart net install a solaris nevada PV domU by xm
bash-3.2# cat snv_jump.py
name = "solaris-pv"
memory = "1024"
vif = [ 'mac=aa:ff:bb:aa:27:17' ]
kernel = "/net/bounty/export/nv/x/latest/boot/platform/i86xpv/kernel/amd64/unix"
ramdisk = "/net/bounty/export/nv/x/latest/boot/amd64/x86.miniroot"
disk = [ 'file:/export/xen_test/snv76_pv.img,0,w' ]
extra = "/platform/i86xpv/kernel/amd64/unix - install -B router-ip=10.13.21.254,
    install_media=10.13.32.48:/export/nv/x/latest,
    install_config=129.158.218.84:/work/jumpstart_domU,
    sysid_config=129.158.218.84:/work/jumpstart_domU,
    host-ip=10.13.21.150,boot-mac=aa:ff:bb:aa:27:17"
on_shutdown = "destroy"
on_reboot = "destroy"
on_crash = "destroy"

3) Create a linux PV domU by xm
bash-3.2# lofiadm -a /net/greatwall.prc/workspaces/xen-test/domUs/CentOS-5.0-x86_64-bin-DVD.iso
/dev/lofi/1
bash-3.2# mount -Fhsfs /dev/lofi/1 /mnt
bash-3.2# share /mnt

bash-3.2# cat Install_centos.py
name = "centos5-install"
memory = "512"
kernel = "/mnt/images/xen/vmlinuz"
ramdisk = "/mnt/images/xen/initrd.img"
extra = "headless ip=dhcp method=nfs:129.158.218.44:/mnt lang=en_US keymap=us ksdevice=eth0"
disk = ['file:/export/xen_test/centos.img,hda,w']
vif = ['']
on_shutdown = "destroy"
on_reboot = "destroy"
on_crash = "destroy"

4) Install solaris nevada PV domU with iso or CDROM by virt-install

Install from iso image
bash-3.2# /usr/bin/virt-install -p -n domu-x01 -r 1200 --nographics /
    -f /export/xen_test/snv76_pv.img -m "aa:ff:bb:ff:cc:cc" /
    -l /net/bounty/ftp/pub/CDimages/nv/76/x86/solarisdvd.iso

Install from CDROM
bash-3.2# /usr/bin/virt-install -p -n domu-x01 -r 1200 --nographics /
    -f /export/xen_test/snv76_pv.img -m "aa:ff:bb:ff:cc:cc" /
    -l /dev/dsk/c0t0d0s2

5) Jumpstart net install solaris nevada PV domU by virt-install
bash-3.2# /usr/bin/virt-install -d -p --nographics -n zealot /
    -f /export/xen_test/snv76_pv.img -r 1024 /
    --mac="aa:ff:bb:aa:27:17" -l "nfs:10.13.32.48:/export/nv/x/latest" /
    --autocf="nfs:129.158.218.84:/work/jumpstart_domU"

Note that in the command line above,  domU name following the option,
"-n", must be a valid hostname, which virt-install will resolve in order to
get the host-ip for installation.

6) Install solaris nevada HVM domU by virt-install
bash-3.2# /usr/bin/virt-install -v -n domu-x01 -r 1200 --vnc /
    -f /export/xen_test/snv76_pv.img -m "aa:ff:bb:ff:cc:cc" /
    --cdrom=/net/bounty/ftp/pub/CDimages/nv/76/x86/solarisdvd.iso

7) Install linux PV domU by virt-install
bash-3.2# /usr/bin/virt-install -n centos5 -p -r 1024 /
    -f /export/xen_test/centos.img -m aa:04:03:35:a8:4e /
    --nographics -l nfs:129.158.218.44:/mnt

8) Install windows HVM domU by virt-install
Firstly, enable the workaround of 6567064,
bash-3.2# svccfg -s xvm/xend setprop config/vncpasswd = astring: /"/"
bash-3.2# svcadm refresh xvm/xend
bash-3.2# svcadm restart xvm/xend

Then start the installation,
bash-3.2# /usr/bin/virt-install -v -n vista_domU -r 1024 /
    -f /export/xen_test/vista.img -m aa:04:03:35:a8:4e /
    --vnc --cdrom=/dev/dsk/c0t0d0s2 --os-type=windows

For vista domU, the option, --os-type=windows is essential.
With it ACPI will be enabled in the domU,  otherwise vista
installation program will complain that BIOS is not ACPI
compatible and refuse to go on.

9) Create a HVM domU by xm
Here's the template file:

=========================================================
# -*- mode: python; -*-
#----------------------------------------------------------------------------------------------------
# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using 'xm create'.
# You use a separate script for each domain you want to create, or
# you can set the parameters for the domain on the xm command line.
#----------------------------------------------------------------------------------------------------

import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'

#----------------------------------------------------------------------------
# Kernel image file.
kernel = "/usr/lib/xen/boot/hvmloader"

# The domain build function. HVM domain uses 'hvm'.
builder='hvm'

# Initial memory allocation (in megabytes) for the new domain.
#
# WARNING: Creating a domain with insufficient memory may cause out of
# memory errors. The domain needs enough memory to boot kernel
# and modules. Allocating less than 32MBs is not recommended.
memory = 512

# Shadow pagetable memory for the domain, in MB.
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
shadow_memory = 8

# A name for your domain. All domains must have different names.
name = "Windows-on-Solaris"

# 128-bit UUID for the domain. The default behavior is to generate a new UUID
# on each call to 'xm create'.
#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"

#-----------------------------------------------------------------------------
# the number of cpus guest platform has, default=1
vcpus=1

# enable/disable HVM guest PAE, default=0 (disabled)
#pae=0

# enable/disable HVM guest ACPI, default=0 (disabled)
#acpi=1

# enable/disable HVM guest APIC, default=0 (disabled)
#apic=1

# List of which CPUS this domain is allowed to use, default Xen picks
#cpus = "" # leave to Xen to pick
#cpus = "0" # all vcpus run on CPU0
#cpus = "0-3,5,^1" # run on cpus 0,2,3,5

# Optionally define mac and/or bridge for the network interfaces.
# Random MACs are assigned if not given.

#vif = [ 'type=ioemu' ]

#----------------------------------------------------------------------------
# Define the disk devices you want the domain to have access to, and
# what you want them accessible as.
# Each disk entry is of the form phy:UNAME,DEV,MODE
# where UNAME is the device, DEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.

#disk = [ 'file:/export/home/mydisk.raw,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]

#disk = [ 'phy:/dev/dsk/c1d0p0,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]

#disk = [ 'phy:/dev/zvol/dsk/mypool/mydisk,hdc,w', 'file:/export/home/install.iso,hda:cdrom,r' ]

#----------------------------------------------------------------------------
# Configure the behaviour when a domain exits. There are three 'reasons'
# for a domain to stop: poweroff, reboot, and crash. For each of these you
# may specify:
#
# "destroy", meaning that the domain is cleaned up as normal;
# "restart", meaning that a new domain is started in place of the old
# one;
# "preserve", meaning that no clean-up is done until the domain is
# manually destroyed (using xm destroy, for example); or
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
# The default is
#
# on_poweroff = 'destroy'
# on_reboot = 'restart'
# on_crash = 'restart'
#
# For backwards compatibility we also support the deprecated option restart
#
# restart = 'onreboot' means on_poweroff = 'destroy'
# on_reboot = 'restart'
# on_crash = 'destroy'
#
# restart = 'always' means on_poweroff = 'restart'
# on_reboot = 'restart'
# on_crash = 'restart'
#
# restart = 'never' means on_poweroff = 'destroy'
# on_reboot = 'destroy'
# on_crash = 'destroy'

on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'preserve'

# New stuff
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'

#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
#boot="cda"
boot='d'

#-----------------------------------------------------------------------------
# write to temporary files instead of disk image files
#snapshot=1

#----------------------------------------------------------------------------
# enable SDL library for graphics, default = 0
sdl=1

#----------------------------------------------------------------------------
# enable VNC library for graphics, default = 1
vnc=0

#----------------------------------------------------------------------------
# address that should be listened on for the VNC server if vnc is set.
# default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp
vnclisten="0.0.0.0"

#----------------------------------------------------------------------------
# set VNC display number, default = domid
#vncdisplay=1

#----------------------------------------------------------------------------
# try to find an unused port for the VNC server, default = 1
#vncunused=1

#----------------------------------------------------------------------------
# enable spawning vncviewer for domain's console
# (only valid when vnc=1), default = 0
vncconsole=1

vncpasswd=''

#----------------------------------------------------------------------------
# no graphics, use serial port
nographic=0

#----------------------------------------------------------------------------
# enable stdvga, default = 0 (use cirrus logic device model)
stdvga=0

#-----------------------------------------------------------------------------
# serial port re-direct to pty deivce, /dev/pts/n
# then xm console or minicom can connect
#serial='pty'
#serial='stdio'
#serial='file:/tmp/blah'
#serial='/dev/pts/0'
serial='null'


#-----------------------------------------------------------------------------
# enable sound card support, [sb16|es1370|all|..,..], default none
#soundhw='sb16'


#-----------------------------------------------------------------------------
# set the real time clock to local time [default=0 i.e. set to utc]
#localtime=1


#-----------------------------------------------------------------------------
# start in full screen
#full-screen=1


#-----------------------------------------------------------------------------
# Enable USB support (specific devices specified at runtime through the
# monitor window)
#usb=1

# Enable USB mouse support (only enable one of the following, `mouse' for
# PS/2 protocol relative mouse, `tablet' for
# absolute mouse)
#usbdevice='mouse'
#usbdevice='tablet'

=========================================================

We need to pay attention to several options in the HVM config above,
bash-3.2# more vista.py
...
# Initial memory allocation (in megabytes) for the new domain.
# WARNING: Creating a domain with insufficient memory may cause out of
# memory errors. The domain needs enough memory to boot kernel
# and modules. Allocating less than 32MBs is not recommended.
memory = 2048
# Shadow pagetable memory for the domain, in MB.
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
shadow_memory = 48
# A name for your domain. All domains must have different names.
name = "WinVista"
vif = [ 'type=ioemu' ]
disk = [ 'file:/export/xen_test/vista.img,hdc,w', 'phy:/dev/dsk/c0t0d0s2,hda:cdrom,r' ]
# boot on floppy (a), hard disk (c) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
#boot="cda"
boot='d'
#----------------------------------------------------------------------------
# enable SDL library for graphics, default = 0
sdl=0
#----------------------------------------------------------------------------
# enable VNC library for graphics, default = 1
vnc=1
#-----------------------------------------------------------------------------
# Enable USB support (specific devices specified at runtime through the
# monitor window)
usb=1
# Enable USB mouse support (only enable one of the following, `mouse' for
# PS/2 protocol relative mouse, `tablet' for
# absolute mouse)
usbdevice='mouse'
usbdevice='tablet'
【无人机】基于改进粒子群算法的无人机路径规划研究[和遗传算法、粒子群算法进行比较](Matlab代码实现)内容概要:本文围绕基于改进粒子群算法的无人机路径规划展开研究,重点探讨了在复杂环境中利用改进粒子群算法(PSO)实现无人机三维路径规划的方法,并将其与遗传算法(GA)、标准粒子群算法等传统优化算法进行对比分析。研究内容涵盖路径规划的多目标优化、避障策略、航路点约束以及算法收敛性和寻优能力的评估,所有实验均通过Matlab代码实现,提供了完整的仿真验证流程。文章还提到了多种智能优化算法在无人机路径规划中的应用比较,突出了改进PSO在收敛速度和全局寻优方面的优势。; 适合人群:具备一定Matlab编程基础和优化算法知识的研究生、科研人员及从事无人机路径规划、智能优化算法研究的相关技术人员。; 使用场景及目标:①用于无人机在复杂地形或动态环境下的三维路径规划仿真研究;②比较不同智能优化算法(如PSO、GA、蚁群算法、RRT等)在路径规划中的性能差异;③为多目标优化问题提供算法选型和改进思路。; 阅读建议:建议读者结合文中提供的Matlab代码进行实践操作,重点关注算法的参数设置、适应度函数设计及路径约束处理方式,同时可参考文中提到的多种算法对比思路,拓展到其他智能优化算法的研究与改进中。
标题中的"EthernetIP-master.zip"压缩文档涉及工业自动化领域的以太网通信协议EtherNet/IP。该协议由罗克韦尔自动化公司基于TCP/IP技术架构开发,已广泛应用于ControlLogix系列控制设备。该压缩包内可能封装了协议实现代码、技术文档或测试工具等核心组件。 根据描述信息判断,该资源主要用于验证EtherNet/IP通信功能,可能包含测试用例、参数配置模板及故障诊断方案。标签系统通过多种拼写形式强化了协议主题标识,其中"swimo6q"字段需结合具体应用场景才能准确定义其技术含义。 从文件结构分析,该压缩包采用主分支命名规范,符合开源项目管理的基本特征。解压后预期可获取以下技术资料: 1. 项目说明文档:阐述开发目标、环境配置要求及授权条款 2. 核心算法源码:采用工业级编程语言实现的通信协议栈 3. 参数配置文件:预设网络地址、通信端口等连接参数 4. 自动化测试套件:包含协议一致性验证和性能基准测试 5. 技术参考手册:详细说明API接口规范与集成方法 6. 应用示范程序:展示设备数据交换的标准流程 7. 工程构建脚本:支持跨平台编译和部署流程 8. 法律声明文件:明确知识产权归属及使用限制 该测试平台可用于构建协议仿真环境,验证工业控制器与现场设备间的数据交互可靠性。在正式部署前开展此类测试,能够有效识别系统兼容性问题,提升工程实施质量。建议用户在解压文件后优先查阅许可协议,严格遵循技术文档的操作指引,同时需具备EtherNet/IP协议栈的基础知识以深入理解通信机制。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值