Tags:
view all tags
%TOC% ---+ Cloning the sample image The way to go would be like this: * Create the root & swap partitions <verbatim>lvcreate -L 12G -n arc02_root vg_root lvcreate -L 4G -n arc02_swap vg_root mkswap /dev/vg_root/lrms02_swap -L SWAP-hdb1</verbatim> * from xen11:<verbatim>cat /scratch/sample_root.img | ssh xen14 'cat > /dev/vg_root/lrms01_root_REPLACE_THIS_DEVICE'</verbatim> * Create the xen config file <verbatim>cp /etc/xen/sample /etc/xen/arc02</verbatim> * Mount the new image <verbatim>kpartx -a /dev/vg_root/arc02_root mount /dev/mapper/arc02_root1 /mnt</verbatim> * run =./finalize_xen_guest.sh HOSTNAME MAC= * Umount the image <verbatim>cd / umount /mnt kpartx -d /dev/vg_root/arc02_root</verbatim> NOTE-NOTE-NOTE: Avoid using the dash (-) in the name of the images, because it triggers a bug (added by FG, 20100825) ---+ Creation of a Xen Sample image We begin from a working virtual machine *already shut down*, that we cloned somewhere with dd like this: <verbatim>lvcreate -L 12G -n sample_root vg_root dd if=/dev/vg_root/ui64_root of=/dev/vg_root/sample_root</verbatim> Then, we need to create a /etc/xen/sample file with this content: <verbatim>name = "@@SIMPLENAME@@" vcpus = 2 memory = 4096 disk = ['phy:/dev/vg_root/@@SIMPLENAME@@_root,xvda,w', 'phy:/dev/vg_root/@@SIMPLENAME@@_swap,xvdb,w'] vif = ['mac=@@MAC@@,bridge=xenbr0'] bootloader = "/usr/bin/pygrub" on_reboot = 'restart' on_crash = 'destroy'</verbatim> Afterward we need to mount the sample image from the xen host, but we need to map it first (it's a partitioned block device): <verbatim>kpartx -a /dev/vg_root/sample_root mount /dev/mapper/sample_root1 /mnt/</verbatim> To find the files to change, running a =grep ui64 /mnt/etc/* -R= will help. Then go file by file and change to fit this variables: * @@SIMPLENAME@@ * @@FULLNAME@@ * @@MAC@@ And this is the list of the files that were changed<verbatim>/mnt/etc/dhclient-eth0.conf /mnt/etc/hosts /mnt/etc/sysconfig/network /mnt/etc/sysconfig/networking/devices/ifcfg-eth0 /mnt/etc/sysconfig/networking/profiles/default/network</verbatim> At the end we need to umount the sample image and unmap it: <verbatim>cd / umount /mnt kpartx -d /dev/vg_root/sample_root</verbatim> -- Main.PabloFernandez - 2010-02-18
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r19
|
r17
<
r16
<
r15
<
r14
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r15 - 2011-06-08
-
MiguelGila
LCGTier2
Log In
(Topic)
LCGTier2 Web
Create New Topic
Index
Search
Changes
Notifications
Statistics
Preferences
Users
Entry point / Contact
RoadMap
ATLAS Pages
CMS Pages
CMS User Howto
CHIPP CB
Outreach
Technical
Cluster details
Services
Hardware and OS
Tools & Tips
Monitoring
Logs
Maintenances
Meetings
Tests
Issues
Blog
Home
Site map
CmsTier3 web
LCGTier2 web
PhaseC web
Main web
Sandbox web
TWiki web
LCGTier2 Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Warning: Can't find topic "".""
Account
Log In
Edit
Attach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback