Oracle OVM 간단 사용기

뭐... 일단 뜻하든... 뜻하지 않든...

OVM을 테스트 하게 되었는데...

Xen-Server 제품에 비해서... 상당히 까다로운???

셋팅이 필요하다... ㅡ.ㅡ;;

Xen-center 는 되게 간단 간단해서... 편했는데... OVM  Shared Storage 잡는데 2일 걸렸다...ㅡ.ㅡ;;

일단... 좀 더 테스트 해 보구... 추가적인 사용기 올리도록 한다.



ps. 그나 저나... 블로그 사진은 어떻게 보이개 해야되나...ㅠㅠㅠ
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/12/03 18:47 2008/12/03 18:47
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/582

Trackback URL : http://blog.blog.n-nuri.com/trackback/582

Leave a comment
[로그인][오픈아이디란?]
출처 : http://kbase.redhat.com/faq/FAQ_103_10986.shtm
작성사의 요청이 있을경우 자삭 합니다.

Issue:
When I try to install Windows XP or Windows (Server) 2003 as a fully virtualized guest under Red Hat Enterprise Linux 5 using Xen, I can start the installation using virt-manager, but Windows installer is hung at "Setup is starting Windows" stage. How can I proceed further?
Resolution:

The error "Setup is starting Windows" is a symptom of the Windows installer not recognizing the underlying HVM (hardware virtual machine), in particular the ACPI controller. However, these options don't work as expected if the guest OS is the 64bit version of Window XP or Windows Server 2003.

Currently, the version of XEN shipping with Red Hat Enterprise Linux 5 does not support 64bit installations of Windows XP and Windows Server 2003.

With 32 bit guests, either of the below will fix this issue:

The first option is during installation, when Windows says to press F6 to install additional drivers, press F5 instead of F6. This will then prompt the user to select the machine and ACPI controller type. Then from the next dialog box select "Standard PC" and continue the installation as usual.

The second method includes the known work around for Windows not seeing cdrom after first reboot as well as getting past the earlier error message.

Install Windows through virt-manager. When it starts installation of Windows, close the vnc console and run xm shutdown guest from a root console. In these examples, guest refers to the name of the guest in question.

Edit /etc/xen/guest and add the cdrom to the disk section. Change the following line:

disk = [ 'file:/var/lib/xen/images/guest,hda,w']

to

disk = ['file:/var/lib/xen/images/guest,hdx,w','phy:/dev/hdx,hdx:cdrom,r']

Replace /dev/hdx with the exact device of the system's cdrom or dvd drive. It can also be specified by file:/path/to/XP.iso for iso images.

Add boot = "d" under the disk section. Change acpi = 1 to acpi = 0. Lastly, run xm create guest.

After this, Windows XP should boot normally and not hang at "setup is starting Windows".

Remove the boot = "d" line from the configuration file before starting the machine on the first reboot.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/08/13 13:54 2008/08/13 13:54
, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/559

Trackback URL : http://blog.blog.n-nuri.com/trackback/559

Leave a comment
[로그인][오픈아이디란?]

[xen] xen man page

출처 : http://linux.die.net/man/1/xm
작성자 요청시 자삭 함.

xm(1) - Linux man page

Name

xm - Xen management user interface

Synopsis

xm <subcommand> [args]

Description

The xm program is the main interface for managing Xen guest domains. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains, enable or pin VCPUs, and attach or detach virtual block devices.

The basic structure of every xm command is almost always:

xm <subcommand> <domain-id> [OPTIONS]
Where subcommand is one of the sub commands listed below, domain-id is the numeric domain id, or the domain name (which will be internally translated to domain id), and OPTIONS are sub command specific options. There are a few exceptions to this rule in the cases where the sub command in question acts on all domains, the entire machine, or directly on the xen hypervisor. Those exceptions will be clear for each of those sub commands.

Note

All xm operations rely upon the Xen control daemon, aka xend. For any xm commands to run xend must also be running. For this reason you should start xend as a service when your system first boots using xen.

Most xm commands require root privileges to run due to the communications channels used to talk to the hypervisor. Running as non root will return an error.

Most xm commands act asynchronously, so just because the xm command returned, doesn't mean the action is complete. This is important, as many operations on domains, like create and shutdown, can take considerable time (30 seconds or more) to bring the machine into a fully compliant state. If you want to know when one of these actions has finished you must poll through xm list periodically.

Domain Subcommands

The following sub commands manipulate domains directly, as stated previously most commands take domain-id as the first parameter.

console domain-id
Attach to domain domain-id's console. If you've set up your Domains to have a traditional log in console this will look much like a normal text log in screen.

This uses the back end xenconsole service which currently only works for para-virtual domains.

The attached console will perform much like a standard serial console, so running curses based interfaces over the console is not advised. Vi tends to get very odd when using it over this interface.

create [-c] configfile [name=value]..
The create sub command requires a configfile and can optional take a series of name value pairs that add to or override variables defined in the config file. See xmdomain.cfg for full details of that file format, and possible options used in either the configfile or Name=Value combinations.

Configfile can either be an absolute path to a file, or a relative path to a file located in /etc/xen.

Create will return as soon as the domain is started. This does not mean the guest OS in the domain has actually booted, or is available for input.

OPTIONS

-c

Attache console to the domain as soon as it has started. This is useful for determining issues with crashing domains.

EXAMPLES
with config file
xm create Fedora4
This creates a domain with the file /etc/xen/Fedora4, and returns as soon as it is run.
without config file
xm create /dev/null ramdisk=initrd.img \
   kernel=/boot/vmlinuz-2.6.12.6-xenU \
   name=ramdisk nics=0 vcpus=1 \
   memory=64 root=/dev/ram0
This creates the domain without using a config file (more specifically using /dev/null as an empty config file), kernel and ramdisk as specified, setting the name of the domain to "ramdisk", also disabling virtual networking. (This example comes from the xm-test test suite.)
destroy domain-id
Immediately terminate the domain domain-id. This doesn't give the domain OS any chance to react, and it the equivalent of ripping the power cord out on a physical machine. In most cases you will want to use the shutdown command instead.
domid domain-name
Converts a domain name to a domain id using xend's internal mapping.
domname domain-id
Converts a domain id to a domain name using xend's internal mapping.
help [--long]
Displays the short help message (i.e. common commands).

The --long option prints out the complete set of xm subcommands, grouped by function.

list [--long | --label] [domain-id, ...]
Prints information about one or more domains. If no domains are specified it prints out information about all domains.

An example format for the list is as follows:

Name                         ID Mem(MiB) VCPUs State  Time(s)
Domain-0                      0       98     1 r-----  5068.6
Fedora3                     164      128     1 r-----     7.6
Fedora4                     165      128     1 ------     0.6
Mandrake2006                166      128     1 -b----     3.6
Mandrake10.2                167      128     1 ------     2.5
Suse9.2                     168      100     1 ------     1.8
Name is the name of the domain. ID the domain numeric id. Mem is the size of the memory allocated to the domain. VCPUS is the number of VCPUS allocated to domain. State is the run state (see below). Time is the total run time of the domain as accounted for by Xen.

STATES

The State field lists 6 states for a Xen Domain, and which ones the current Domain is in.
r - running
The domain is currently running on a CPU
b - blocked
The domain is blocked, and not running or runnable. This can be caused because the domain is waiting on IO (a traditional wait state) or has gone to sleep because there was nothing else for it to do.
p - paused
The domain has been paused, usually occurring through the administrator running xm pause. When in a paused state the domain will still consume allocated resources like memory, but will not be eligible for scheduling by the Xen hypervisor.
s - shutdown
The guest has requested to be shutdown, rebooted or suspended, and the domain is in the process of being destroyed in response.
c - crashed
The domain has crashed, which is always a violent ending. Usually this state can only occur if the domain has been configured not to restart on crash. See xmdomain.cfg for more info.
d - dying
The domain is in process of dying, but hasn't completely shutdown or crashed.
LONG OUTPUT
If --long is specified, the output for xm list is not the table view shown above, but instead is an S-Expression representing all information known about all domains asked for. This is mostly only useful for external programs to parse the data.

Note: there is no stable guarantees on the format of this data. Use at your own risk.

LABEL OUTPUT
If --label is specified, the security labels are added to the output of xm list and the lines are sorted by the labels (ignoring case). The --long option prints the labels by default and cannot be combined with --label. See the ACCESS CONTROL SUBCOMMAND section of this man page for more information about labels.
NOTES
The Time column is deceptive. Virtual IO (network and block devices) used by Domains requires coordination by Domain0, which means that Domain0 is actually charged for much of the time that a DomainU is doing IO . Use of this time value to determine relative utilizations by domains is thus very suspect, as a high IO workload may show as less utilized than a high CPU workload. Consider yourself warned.
mem-max domain-id mem
Specify the maximum amount of memory the Domain is able to use. Mem is specified in megabytes.

The mem-max value may not correspond to the actual memory used in the Domain, as it may balloon down it's memory to give more back to the OS .

mem-set domain-id mem
Set the domain's used memory using the balloon driver. Because this operation requires cooperation from the domain operating system, there is no guarantee that it will succeed.

Warning: there is no good way to know in advance how small of a mem-set will make a domain unstable and cause it to crash. Be very careful when using this command on running domains.

migrate domain-id host [options]
Migrate a domain to another Host machine. Xend must be running on other host machine, it must be running the same version of xen, it must have the migration TCP port open and accepting connections from the source host, and there must be sufficient resources for the domain to run (memory, disk, etc).

Migration is pretty complicated, and has many security implications, please read the Xen Users Guide to ensure you understand the ramifications and limitations on migration before attempting it in production.

OPTIONS

-l, --live
Use live migration. This will migrate the domain between hosts without shutting down the domain. See the Xen Users Guide for more information.
-r, --resource Mbs
Set maximum Mbs allowed for migrating the domain. This ensures that the network link is not saturated with migration traffic while attempting to do other useful work.
pause domain-id
Pause a domain. When in a paused state the domain will still consume allocated resources such as memory, but will not be eligible for scheduling by the Xen hypervisor.
reboot [options] domain-id
Reboot a domain. This acts just as if the domain had the reboot command run from the console. The command returns as soon as it has executed the reboot action, which may be significantly before the domain actually reboots.

The behavior of what happens to a domain when it reboots is set by the on_reboot parameter of the xmdomain.cfg file when the domain was created.

OPTIONS

-a, --all
Reboot all domains
-w, --wait
Wait for reboot to complete before returning. This may take a while, as all services in the domain will have to be shut down cleanly.
restore state-file
Build a domain from an xm save state file. See save for more info.
save domain-id state-file
Saves a running domain to a state file so that it can be restored later. Once saved, the domain will no longer be running on the system, thus the memory allocated for the domain will be free for other domains to use. xm restore restores from this state file.

This is roughly equivalent to doing a hibernate on a running computer, with all the same limitations. Open network connections may be severed upon restore, as TCP timeouts may have expired.

shutdown [options] domain-id
Gracefully shuts down a domain. This coordinates with the domain OS to perform graceful shutdown, so there is no guarantee that it will succeed, and may take a variable length of time depending on what services must be shutdown in the domain. The command returns immediately after signally the domain unless that -w flag is used.

The behavior of what happens to a domain when it reboots is set by the on_shutdown parameter of the xmdomain.cfg file when the domain was created.

OPTIONS

-a

Shutdown all domains. Often used when doing a complete shutdown of a Xen system.

-w

Wait for the domain to complete shutdown before returning.

sysrq domain-id letter
Send a Magic System Request signal to the domain. For more information on available magic sys req operations, see sysrq.txt in your Linux Kernel sources.
unpause domain-id
Moves a domain out of the paused state. This will allow a previously paused domain to now be eligible for scheduling by the Xen hypervisor.
vcpu-set domain-id vcpu-count
Enables the vcpu-count virtual CPUs for the domain in question. Like mem-set, this command can only allocate up to the maximum virtual CPU count configured at boot for the domain.

If the vcpu-count is smaller than the current number of active VCPUs, the highest number VCPUs will be hotplug removed. This may be important for pinning purposes.

Attempting to set the VCPUs to a number larger than the initially configured VCPU count is an error. Trying to set VCPUs to < 1 will be quietly ignored.

vcpu-list [domain-id]
Lists VCPU information for a specific domain. If no domain is specified, VCPU information for all domains will be provided.
vcpu-pin domain-id vcpu cpus
Pins the the VCPU to only run on the specific CPUs. The keyword all can be used to apply the cpus list to all VCPUs in the domain.

Normally VCPUs can float between available CPUs whenever Xen deems a different run state is appropriate. Pinning can be used to restrict this, by ensuring certain VCPUs can only run on certain physical CPUs.

Xen Host Subcommands

dmesg [-c]

Reads the Xen message buffer, similar to dmesg on a Linux system. The buffer contains informational, warning, and error messages created during Xen's boot process. If you are having problems with Xen, this is one of the first places to look as part of problem determination.

OPTIONS

-c, --clear
Clears Xen's message buffer.
info
Print information about the Xen host in name : value format. When reporting a Xen bug, please provide this information as part of the bug report.

Sample xen domain info looks as follows (lines wrapped manually to make the man page more readable):

host                   : talon
release                : 2.6.12.6-xen0
version                : #1 Mon Nov 14 14:26:26 EST 2005
machine                : i686
nr_cpus                : 2
nr_nodes               : 1
sockets_per_node       : 2
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 696
hw_caps                : 0383fbff:00000000:00000000:00000040
total_memory           : 767
free_memory            : 37
xen_major              : 3
xen_minor              : 0
xen_extra              : -devel
xen_caps               : xen-3.0-x86_32
xen_pagesize           : 4096
platform_params        : virt_start=0xfc000000
xen_changeset          : Mon Nov 14 18:13:38 2005 +0100
                         7793:090e44133d40
cc_compiler            : gcc version 3.4.3 (Mandrakelinux
                         10.2 3.4.3-7mdk)
cc_compile_by          : sdague
cc_compile_domain      : (none)
cc_compile_date        : Mon Nov 14 14:16:48 EST 2005
xend_config_format     : 2
FIELDS
Not all fields will be explained here, but some of the less obvious ones deserve explanation:
hw_caps
A vector showing what hardware capabilities are supported by your processor. This is equivalent to, though more cryptic, the flags field in /proc/cpuinfo on a normal Linux machine.
free_memory
Available memory (in MB ) not allocated to Xen, or any other Domains.
xen_caps
The xen version, architecture. Architecture values can be one of: x86_32, x86_32p (i.e. PAE enabled), x86_64, ia64.
xen_changeset
The xen mercurial changeset id. Very useful for determining exactly what version of code your Xen system was built from.
log

Print out the xend log. This log file can be found in /var/log/xend.log.

top

Executes the xentop command, which provides real time monitoring of domains. Xentop is a curses interface, and reasonably self explanatory.

Virtual Device Commands

Most virtual devices can be added and removed while guests are running. The effect to the guest OS is much the same as any hotplug event.

BLOCK DEVICES

block-attach domain-id be-dev fe-dev mode [bedomain-id]
Create a new virtual block device. This will trigger a hotplug event for the guest.

OPTIONS

domain-id
The domain id of the guest domain that the device will be attached to.
be-dev
The device in the backend domain (usually domain 0) to be exported. This can be specified as a physical partition (phy:sda7) or as a file mounted as loopback (file://path/to/loop.iso).
fe-dev
How the device should be presented to the guest domain. It can be specified as either a symbolic name, such as /dev/hdc, for common devices, or by device id, such as 0x1400 (/dev/hdc device id in hex).
mode
The access mode for the device from the guest domain. Supported modes are w (read/write) or r (read-only).
bedomain-id
The back end domain hosting the device. This defaults to domain 0.
EXAMPLES
Mount an ISO as a Disk
xm block-attach guestdomain file://path/to/dsl-2.0RC2.iso /dev/hdc ro

This will mount the dsl iso as /dev/hdc in the guestdomain as a read only device. This will probably not be detected as a cdrom by the guest, but mounting /dev/hdc manually will work.

block-detach domain-id devid
Destroy a domain's virtual block device. devid must be the device id given to the device by domain 0. You will need to run xm block-list to determine that number.
block-list [-l|--long] domain-id
List virtual block devices for a domain. The returned output is formatted as a list or as an S-Expression if the '--long' option was given.
NETWORK DEVICES
network-attach domain-id [script=scriptname] [ip=ipaddr] [mac=macaddr] [bridge=bridge-name] [backend=bedomain-id]
Creates a new network device in the domain specified by domain-id. It takes the following optional options:

OPTIONS

script=scriptname
Use the specified script name to bring up the network. Defaults to the default setting in xend-config.sxp for vif-script.
ip=ipaddr
Passes the specified IP Address to the adapter on creation.
mac=macaddr
The MAC address that the domain will see on its Ethernet device. If the device is not specified it will be randomly generated with the 00:16:3e vendor id prefix.
bridge=bridge-name
The name of the bridge to attach the vif to, in case you have more than one. This defaults to
backend=bedomain-id
The backend domain id. By default this is domain 0.
network-detach domain-id devid
Removes the network device from the domain specified by domain-id. devid is the virtual interface device number within the domain (i.e. the 3 in vif22.3).
network-list [-l|--long] domain-id
List virtual network interfaces for a domain. The returned output is formatted as a list or as an S-Expression if the '--long' option was given.
VIRTUAL TPM DEVICES
vtpm-list [-l|--long] domain-id
Show the virtual TPM device for a domain. The returned output is formatted as a list or as an S-Expression if the '--long' option was given.

Access Control Subcommands

Access Control in Xen consists of two components: (i) The Access Control Policy ( ACP ) defines security labels and access rules based on these labels. (ii) The Access Control Module ( ACM ) makes access control decisions by interpreting the policy when domains require to communicate or to access resources. The Xen access control has sufficient mechanisms in place to enforce the access decisions even against maliciously acting user domains (mandatory access control).

Access rights for domains in Xen are determined by the domain security label only and not based on the domain Name or ID . The ACP specifies security labels that can then be assigned to domains and resources. Every domain must be assigned exactly one security label, otherwise access control decisions could become indeterministic. ACPs are distinguished by their name, which is a parameter to most of the subcommands described below. Currently, the ACP specifies two ways to interpret labels:

(1) Simple Type Enforcement: Labels are interpreted to decide access of domains to comunication means and virtual or physical resources. Communication between domains as well as access to resources are forbidden by default and can only take place if they are explicitly allowed by the security policy. The proper assignment of labels to domains controls the sharing of information (directly through communication or indirectly through shared resources) between domains. This interpretation allows to control the overt (intended) communication channels in Xen.

(2) Chinese Wall: Labels are interpreted to decide which domains can co-exist (be run simultaneously) on the same system. This interpretation allows to prevent direct covert (unintended) channels and mitigates risks caused by imperfect core domain isolation (trade-off between security and other system requirements). For a short introduction to covert channels, please refer to http://www.multicians.org/timing-chn.html.

The following subcommands help you to manage security policies in Xen and to assign security labels to domains. To enable access control security in Xen, you must compile Xen with ACM support enabled as described under "Configuring Security" below. There, you will find also examples of each subcommand described here.

makepolicy policy
Compiles the XML source representation of the security policy. It creates a mapping (.map) as well as a binary (.bin) version of the policy. The compiled policy can be loaded into Xen with the loadpolicy subcommand or can be configured to be loaded at boot time with the cfgbootpolicy subcommand.
policy is a dot-separated list of names. The last part is the file name pre-fix for the policy xml file. The preceding name parts are translated into the local path pointing to the policy xml file relative to the global policy root directory (/etc/xen/acm-security/policies). For example, example.chwall_ste.client_v1 denotes the policy file example/chwall_ste/client_v1-security_policy.xml relative to the global policy root directory.
loadpolicy policy
Loads the binary representation of the policy into Xen. The binary representation can be created with the makepolicy subcommand.
cfgbootpolicy policy [kernelversion]
Configures policy as the boot policy for Xen. It copies the binary policy representation into the /boot directory and adds a module line specifying the binary policy to the /boot/grub/menu.lst file. If your boot configuration includes multiple Xen boot titles, then use the kernelversion parameter to select the proper title.
dumppolicy
Prints the current security policy state information of Xen.
labels [policy] [type=dom|res|any]
Lists all labels of a type (domain, resource, or both) that are defined in the policy. Unless specified, the default policy is the currently enforced access control policy. The default for type is 'dom'. The labels are arranged in alphabetical order.
addlabel label dom configfile [policy]
addlabel label res resource [policy]
Adds the security label with name label to a domain configfile (dom) or to the global resource label file for the given resource (res). Unless specified, the default policy is the currently enforced access control policy. This subcommand also verifies that the policy definition supports the specified label name.
rmlabel dom configfile
rmlabel res resource
Works the same as the addlabel command (above), except that this command will remove the label from the domain configfile (dom) or the global resource label file (res).
getlabel dom configfile
getlabel res resource
Shows the label for the given configfile or resource
resources
Lists all resources in the global resource label file. Each resource is listed with its associated label and policy name.
dry-run configfile
Determines if the specified configfile describes a domain with a valid security configuration for type enforcement. The test shows the policy decision made for each resource label against the domain label as well as the overall decision.
CONFIGURING SECURITY
In xen_source_dir/Config.mk set the following parameters:
ACM_SECURITY ?= y
ACM_DEFAULT_SECURITY_POLICY ?= \
    ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY
Then recompile and install xen and the security tools and then reboot:
cd xen_source_dir/xen; make clean; make; cp xen.gz /boot;
cd xen_source_dir/tools/security; make install;
reboot into xen
COMPILING A SECURITY POLICY
This step creates client_v1.map and client_v1.bin files in /etc/xen/acm-security/policies/example/chwall_ste.
xm makepolicy example.chwall_ste.client_v1
LOADING A SECURITY POLICY
This step activates client_v1.bin as new security policy in Xen. You can use the dumppolicy subcommand before and afterwards to see the change in the Xen policy state.
xm loadpolicy example.chwall_ste.client_v1
CONFIGURING A BOOT SECURITY POLICY
This configures the boot loader to load client_v1.bin at boot time. During system start, the ACM configures Xen with this policy and Xen enforces this policy from then on.
xm cfgbootpolicy example.chwall_ste.client_v1
LISTING SECURITY LABELS
This subcommand shows all labels that are defined and which can be attached to domains.
xm labels example.chwall_ste.client_v1 type=dom
will print for our example policy:
dom_BoincClient
dom_Fun
dom_HomeBanking
dom_NetworkDomain
dom_StorageDomain
dom_SystemManagement
ATTACHING A SECURITY LABEL TO A DOMAIN
The addlabel subcommand can attach a security label to a domain configuration file, here a HomeBanking label. The example policy ensures that this domain does not share information with other non-hombanking user domains (i.e., domains labeled as dom_Fun or dom_Boinc) and that it will not run simultaneously with domains labeled as dom_Fun.

We assume that the specified myconfig.xm configuration file actually instantiates a domain that runs workloads related to home-banking, probably just a browser environment for online-banking.

xm addlabel dom_HomeBanking dom myconfig.xm
The very simple configuration file might now look as printed below. The addlabel subcommand added the access_control entry at the end of the file, consisting of a label name and the policy that specifies this label name:
kernel = "/boot/vmlinuz-2.6.16-xen"
ramdisk="/boot/U1_home_banking_ramdisk.img"
memory = 164
name = "homebanking"
vif = [ '' ]
dhcp = "dhcp"
access_control = ['policy=example.chwall_ste.client_v1,
                   label=dom_HomeBanking']
Security labels must be assigned to domain configurations because these labels are essential for making access control decisions as early as during the configuration phase of a newly instantiated domain. Consequently, a security-enabled Xen hypervisor will only start domains that have a security label configured and whose security label is consistent with the currently enforced policy. Otherwise, starting the domain will fail with the error condition "operation not permitted".
ATTACHING A SECURITY LABEL TO A RESOURCE
The addlabel subcommand can also be used to attach a security label to a resource. Following the home banking example from above, we can label a disk resource (e.g., a physical partition or a file) to make it accessible to the home banking domain. The example policy provides a resource label, res_LogicalDiskPartition1(hda1), that is compatible with the HomeBanking domain label.
xm addlabel "res_LogicalDiskPartition1(hda1)" res phy:hda6
After labeling this disk resource, it can be attached to the domain by adding a line to the domain configuration file. The line below attaches this disk to the domain at boot time.
disk = [ 'phy:hda6,sda2,w' ]
Alternatively, the resource can be attached after booting the domain by using the block-attach subcommand.
xm block-attach homebanking phy:hda6 sda2 w
Note that labeled resources cannot be used when security is turned off. Any attempt to use labeled resources with security turned off will result in a failure with a corresponding error message. The solution is to enable security or, if security is no longer desired, to remove the resource label using the rmlabel subcommand.
STARTING AND LISTING LABELED DOMAINS
xm create myconfig.xm

xm list --label

  Name         ID ...  Time(s)  Label
  homebanking  23 ...      4.4  dom_HomeBanking
  Domain-0      0 ...   2658.8  dom_SystemManagement
LISTING LABELED RESOURCES
xm resources

  phy:hda6
      policy: example.chwall_ste.client_v1
      label:  res_LogicalDiskPartition1(hda1)
  file:/xen/disk_image/disk.img
      policy: example.chwall_ste.client_v1
      label:  res_LogicalDiskPartition2(hda2)
POLICY REPRESENTATIONS
We distinguish three representations of the Xen access control policy: the source XML version, its binary counterpart, and a mapping representation that enables the tools to deterministically translate back and forth between label names of the XML policy and label identifiers of the binary policy. All three versions must be kept consistent to achieve predictable security guarantees.

The XML version is the version that users are supposed to create or change, either by manually editing the XML file or by using the Xen policy generation tool (xensec_gen). After changing the XML file, run the makepolicy subcommand to ensure that these changes are reflected in the other versions. Use, for example, the subcommand cfgbootpolicy to activate the changes during the next system reboot.

The binary version of the policy is derived from the XML policy by tokenizing the specified labels and is used inside Xen only. It is created with the makepolicy subcommand. Essentially, the binary version is much more compact than the XML version and is easier to evaluate during access control decisions.

The mapping version of the policy is created during the XML-to-binary policy translation (makepolicy) and is used by the Xen management tools to translate between label names used as input to the tools and their binary identifiers (ssidrefs) used inside Xen.

Examples

See Also

xmdomain.cfg(5), xentop(1)

Author

Sean Dague <sean at dague dot net>
Daniel Stekloff <dsteklof at us dot ibm dot com>
Reiner Sailer <sailer at us dot ibm dot com>

Bugs

Referenced By

virsh(1), virt-top(1)
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/04/29 13:45 2008/04/29 13:45
,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/525

Trackback URL : http://blog.blog.n-nuri.com/trackback/525

Leave a comment
[로그인][오픈아이디란?]

사용자 삽입 이미지


centos 5.1 기준입니다. RHEL 5.1도 비슷하지 싶은데... 다를수도 있습니다.

Xen 을 사용할려구 /etc/xen/script 에 등록한

ex) my-script 를 실행 하였고...

정상적으로 보이지만 virt-manager - Connect host network  의

Shared physical device 에 장치가 올라오지 않을경우???

원인은 virt-manager 버그가 있습니다.

제가 관련하여 올렸던 글 이구요

http://www.linuxquestions.org/questions/linux-enterprise-47/help-me...-centos-5.1-on-xen-bridge-630203/

센트쪽에 이슈 등록이 되어 있는 부분 이네요

http://bugs.centos.org/view.php?id=2516 

^^
아무쪼록... 저 같은 문제가 발생된분들이... 잘 해결 되시길...^^

첨부 1 : 파일 첨부 합니다. connection.py.patch 파일을 다운 받으셔서 connection.py 파일에 패치 하시면 됩니다.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2008/03/30 09:08 2008/03/30 09:08
, , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/518

Trackback URL : http://blog.blog.n-nuri.com/trackback/518

Leave a comment
[로그인][오픈아이디란?]
출처 :http://www-128.ibm.com/developerworks/kr/library/l-xen/

Xen의 시대: 리눅스를 가상화 하여 애플리케이션 테스트하기

샌드박스(sandbox)를 만들어 애플리케이션 관리하기

developerWorks
문서 옵션
이 페이지를 이메일로 보내기

이 페이지를 이메일로 보내기


난이도 : 초급

Bryan Clark, Interaction Designer, Red Hat

2005 년 3 월 15 일

Xen은 리눅스 커널에서 사용할 수 있는 가상화 기술로서 원래 시스템에 피해를 주지 않고도 기존 환경에서 리눅스가 실행되는 것처럼 새로운 업그레이드를 마무리 및 테스트할 수 있는 기술이다. 이 글에서 Fedora Core를 사용하여 Xen을 설치하는 방법을 설명하겠다. 설치한 후에는 어느 배포판의 Xen이나 똑같이 작동된다. 리눅스의 가상화를 연구하고 새로운 소프트웨어의 테스트에 샌드박스를 사용할 때의 이점과 이 샌드박스를 같은 리눅스 박스에 여러 가상 머신들을 실행하는 장소로 사용하는 것에 대해 설명하겠다.

기존 소프트웨어의 꾸준한 향상과 버그 픽스(bug fixes)가 이루어지는 오픈 소스 세계는 유동적이다. 최첨단 소프트웨어 업그레이드는 전력 투구해야 하는 작업이다. 소프트웨어 업그레이드의 난점은 업그레이드가 완료된 후에 애플리케이션이 어떻게 작동할지 예상할 수 없다는 점이다. 대부분의 소프트웨어 패키징 시스템은 롤백(rollback) 기능을 제공하지만 이것으로 충분하지 않다. 새로운 업데이트들을 아무것에도 영향을 끼치지 않는 환경에서 테스트 및 실행해보는 것이 가장 이상적일 것이다.

운동장에 뛰노는 아이들처럼, 여러분에게도 마음껏 뛰놀 수 있는 샌드박스(sandbox)라는 것이 있다.

가상화(Virtualization)는 애플리케이션과 시스템을 같은 하드웨어에 있는 다른 것들과 분리시키는데 활용된다. 리눅스는 하드웨어 에뮬레이터(hardware emulators )부터 순수한 하드웨어 가상화까지 여러 가지 형태의 가상화를 지원한다. 최근 급부상하고 있는 기술이 캠브리지 대학교에서 개발한 Xen이다. Xen은 전대미문의 퍼포먼스와 보안성 때문에 주목을 끌고 있다.

Xen

캠브리지 대학교의 연구 프로젝트로 개발된 Xen은 오픈 소스 커뮤니티에서 많은 도움을 받았다. Xen은 paravirtualizing VMM (Virtual Machine Monitor)이다. OS가 선택 영역에서 변경되어 하이퍼바이저(hypervisor)로 호출되지만, 그 OS에서 실행되는 애플리케이션은 변경되지 않는다. VMWare 같은 가상화 시스템이(실행 OS를 변경할 필요가 없는) 진정한 가상화를 표방하지만, 퍼포먼스에 영향을 미칠 수 있는 머신 코드는 여전히 변환해야 한다.

Xen은 변경된 OS가 필요하기 때문에, Xen 아키텍쳐로 포팅되지 않는 한 현재 리눅스 커널을 Xen 하이퍼바이저(hypervisor)에서 실행할 수 없다. 하지만 현재 시스템이 Xen 아키텍쳐로 포팅된 새로운 리눅스 커널을 사용할 수 있다면 기존 시스템을 변경 하지 않고 실행할 수 있다.


그림 1. Xen 아키텍쳐
The simple Xen architecture

Xen 찾기

Xen의 소스 코드는 프로젝트 페이지(참고자료)를 참조하기 바란다. 리눅스를 이미 실행하고 있다면, 패키지 업데이트 또는 설치를 통해 Xen을 설치할 수 있다. 다음은 Xen을 포함하고 있는 배포판이다.

여러분의 배포판을 체크하라. 위 리스트에 있는 것이 아니라면, 소스코드를 직접 사용해야 한다. 배포판의 설치 프로시저 외에도 어떤 배포판의 Xen에서도 모든 것이 똑같이 작동한다.

Fedora Core

내 컴퓨터는 Fedora Core 3을 실행하고 있기 때문에, Fedora Core를 설치하여 실행하는 것에 대해 설명하겠다.

Fedora는 Xen 사용자 커뮤니티를 이미 형성하고 있다. 비록 패키지들은 최근에야 개발 채널로 옮겨졌다. Fedora에서 Xen을 사용하는 사람들이 많기 때문에, 온라인에서 많은 성공 스토리를 참조할 수 있다.




위로


Xen 설치하기

빠른 설치와 실행을 위해 이 섹션에서는 참고자료 섹션의 Quick Start Guide에 초점을 맞추겠다. Quick Start Guide도 매번 변경된다.

이 기본 머신에 최소한의 서버를 설치하는 것으로 시작한다. 기본 머신은 하이퍼바이저(hypervisor)이고, 어떤 서버 애플리케이션도 실행하지 않는다. 이 머신 상단에서 실행되는 Xen 서버에 원하는 패키지들을 설치할 기회가 생길 것이다. 그렇게 되면 아직 실행하지 않아도 되는 애플리케이션은 설치 할 필요가 없다.

시스템을 실행시켰다면 Fedora의 최신 개발 버전(rawhide)으로 업데이트 해야 할 것이다. /etc/yum.repos.d/ 디렉토리의 엘리먼트로 가서 fedora-devel.repo를 제외한 모든 것을 enabled=0으로 변경한다. fedora-devel.repo는 enabled=1로 변경한다.

이제 여러분만의 yum 리파지토리(repository)가 설정 되었으니, 머신을 업데이트하여 최신 Xen 릴리스를 사용할 수 있다.


Listing 1. FC3를 업데이트하여 Xen 패키지 설치하기
yum updateyum install xen kernel-xen0 kernel-xenU

다음에는 더미 파일시스템(dummy filesystem)을 만든다.


Listing 2. Xen 서버 파일시스템 포맷팅 및 설치
mkdir -p /xen/basedd if=/dev/zero of=/root/base.img bs=1M count=1 seek=1024mkfs.ext3 /root/base.imgmount -o loop /root/base.img /xen/base

Xen 서버 파일시스템이 포맷 및 마운트(mount) 되면, 이 파일시스템에서 실행될 패키지들을 설치한다. Xen 서버에서 웹 서버를 실행하려면, 웹 서버 패키지 세트를 설치해야 한다. (경고: 시간이 조금 걸린다. yum을 실행시킨 다음 산책을 다녀와라.)


Listing 3. Xen 서버 패키지 설치하기
yum --installroot=/xen/base -y groupinstall web-server \		--enablerepo=base --disablerepo=development

(잘 되었는지 확인하라.)

이제 모든 패키지들을 설치했지만, 간단한 fstab 파일을 살펴봐야 한다. 이것은 Xen 서버들에게 루트(root) 장치 sda1이 될 것을 말해준다. 이 루트 디바이스는 실제로 하이퍼바이저(hypervisor)에서 온 가상화된 장치이다. 하지만 여러분의 서버는 이것을 인식하지 못한다.


Listing 4. Xen 서버 fstab 파일
/dev/sda1		/		ext3	defaults	1 1none			/dev/pts	devpts  gid=5,mode=620	0 0none                    /dev/shm        tmpfs   defaults	0 0none                    /proc           proc    defaults	0 0none                    /sys            sysfs   defaults	0 0

정상적인 Fedora 설치 없이는 어떤 fstab도 만들어지지 않는다. Fedora의 향후 버전에는 이 문제를 다루는 툴이 포함될 것이다.

마지막으로 시스템을 올바르게 실행할 해킹 작업이 필요하다. Xen은 현재 initrd 문제가 있다. 따라서 시스템을 부팅하려면 몇 가지 장치 코드를 만들어야 한다. 그런 다음 원활히 작동하도록 하기 위해 TLS 라이브러리를 이동한다. 이들은 Xen과의 인터랙팅(interact)이 잘 안된다. 그럴 경우 이 파일시스템을 언마운트(unmount) 할 수 있다.


Listing 5. 마지막 해킹
for i in console null zero ; do MAKEDEV -d /xen/base/dev -x $i ; donemv /lib/tls /lib/tls.disabledmv /xen/base/lib/tls /xeb/base/lib/tls.disabledumount /xen/base/




위로


Xen 실행하기

힘들게 설정했기 때문에 머신을 재부팅하고, Xen 커널을 사용하기 시작한다. 아마도 과도한 프린트아웃을 보게 될 것이다. TLS 라이브러리에 대한 무시무시한 메시지도 보게 될 것이다. (그 메시지 때문에 이전 섹션으로 다시 가야 할지도 모른다.)

Xen에는 실행하는 각 서버 마다 설정 파일이 필요하다. 모든 서버에 하나의 동적 설정 파일을 만들 수 있지만, 두 개의 정적 설정 파일을 만들 것을 권한다. 여러분도 알다시피, 이 디스크 레이블은 파일 이미지가 sda1 장치라는 것을 알려준다.


Listing 6. Xen 서버 설정 파일
/etc/xen/basekernel ="/boot/vmlinuz-2.6.10-1.1141_FC4xenU"memory = 64name = "BaseServer"nics = 1disk = ['file:/root/base.img,sda1,w']root = "/dev/sda1 ro"/etc/xen/testkernel ="/boot/vmlinuz-2.6.10-1.1141_FC4xenU"memory = 64name = "TestServer"nics = 1disk = ['file:/root/test.img,sda1,w']root = "/dev/sda1 ro"

서버를 실행하려면 xend start 명령어로 Xen 서비스를 시작하고, xm create base 명령어로 베이스 config 파일에서 BaseServer를 만든다. 이렇게 하면 Xen 게스트가 될 수 있고 부팅된 것을 볼 수 있다. 게스트 콘솔(guest console)에서 나가려면 Ctrl-]을 누르고 하이퍼바이저 콘솔(hypervisor console)로 간다.




위로


Xen 사용하기

이제 설정을 편집하고 시스템이 두 개의 Xen 서버를 실행하도록 설정할 것이다. 이런 힘든 작업에 대한 보상은 무엇일까?

같은 커널에서 실행되는 시스템이 두 개가 되었다. BaseServer가 웹 서비스를 정상적으로 실행하기 원하는 안정적인 환경을 나타낸다면 TestServer는 Fedora가 제공하는 최신 소프트웨어 업데이트를 나타낸다. 이 테스트서 시스템을 지속적으로 업그레이드 하여, 모든 새로운 버전의 소프트웨어를 업데이트 한다. 이 TestServer를 BaseServer로서 실행할 수 있다.

BaseServer 설정하기

BaseServer가 실행될 때가 아파치 httpd 서비스를 설정할 좋은 때이다. ssl.conf 파일을 /etc/httpd/conf.d/ 디렉토리에서 빼내어 ssl을 종료한다. 그렇지 않으면 이 서버에 대한 인증을 만들어야 한다. 또한 아파치 사용자를 이 시스템에 추가해야 한다.

Xen 하이퍼바이저(hypervisor)는 가상 네트워크 장치를 자동으로 제공한다. 이 서비스에서 dhcp를 실행할 수 있다면, dhclient eth0만 실행하라. BaseServer에 대한 IP 주소가 생긴다.

TestServer 설정하기

BaseServer를 설정했다면 BaseServer 콘솔에서 poweroff를 실행하여 인스턴스(instance)를 중지한다. BaseServer에서 이미 로그아웃 했다면 xm console BaseServer를 사용하여 액세스 권한을 다시 얻는다.

cp /root/base.img /root/test.img를 사용하여 기본 이미지 파일을 복사하여, 같은 파일시스템의 중복 파일을 가질 수 있다. xm create -c test를 실행할 때 BaseServer와 같은 서버를 실행한다. 이를 TestServer라 한다. TestServer에 로그인하여 Xen 설치하기 섹션에서 했던 것과 같이 지원한다. 그리고 yum update를 실행한다.

TestServer 인스턴스(instance)는 BaseServer와 같은 구성을 갖지만, Fedora가 제공하는 최신 패키지로 업그레이드 한다. 여기에서 웹 사이트가 작동하는지를 확인한다.




위로


맺음말

간단한 설명과 예제로 Xen을 설치하여 시행하는데 도움이 될 수 있길 바란다. LVM의 활용법이나 머신 간 Xen 서버의 네트워크 마이그레이션 방법은 다루지 않았다. Xen에 대한 자세한 내용은 아래 참고자료 섹션을 참조하기 바란다.




위로


참고자료




위로


필자소개

Bryan Clark: 인터랙션 디자이너, Red Hat.

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 삐꾸강아쥐

2006/07/26 10:39 2006/07/26 10:39
Response
0 Trackbacks , 0 Comments
RSS :
http://blog.blog.n-nuri.com/rss/response/192

Trackback URL : http://blog.blog.n-nuri.com/trackback/192

Leave a comment
[로그인][오픈아이디란?]