lost and found ( for me ? )

Fedora 17 64bit : boxgrinder 0.10.1 libvirt delivery plugin

Here’s an explanation of how to build a VM and deploy it in a KVM host with boxgrinder libvirt delivery plugin.

[root@fc17 ~]# uname -ri
3.3.7-1.fc17.x86_64 x86_64

[root@fc17 ~]# cat /etc/fedora-release
Fedora release 17 (Beefy Miracle)

install boxgrinder via yum
[root@fc17 ~]# yum install -y *boxgrinder*

[root@fc17 ~]# boxgrinder-build --version | head -1
BoxGrinder Build 0.10.1

make a working directory
[root@fc17 ~]# mkdir boxgrinder_works
[root@fc17 ~]# cd boxgrinder_works/

make a template file
[root@fc17 boxgrinder_works]# cat centos6-jeos.appl
name: "centos6-jeos"
summary: CentOS 6 Core

os:
 name: centos
 version: 6
 password: centos

hardware:
 cpus: 1
 memory: 256
 partitions:
   "/":
     size: 5  # 5GB
   "swap":
     size: 0.5  # 0.5GB

repos:
 - name: "rbel6"
   baseurl: "http://rbel.frameos.org/stable/el6/#BASE_ARCH#/"

packages:
 - coreutils
 - openssh-server

build centos6 jeos and deploy it in “/var/lib/libvirt/images” directory.
[root@fc17 boxgrinder_works]# boxgrinder-build centos6-jeos.appl -d libvirt --delivery-config connection_uri:qemu:///system,image_delivery_uri:/var/lib/libvirt/images

building the VM
[root@fc17 boxgrinder_works]# boxgrinder-build centos6-jeos.appl -d libvirt --delivery-config connection_uri:qemu:///system,image_delivery_uri:/var/lib/libvirt/images
I, [2012-06-05T00:03:12.223041 #2978]  INFO -- : Validating appliance definition from centos6-jeos.appl file...
I, [2012-06-05T00:03:12.224695 #2978]  INFO -- : Appliance definition is valid.
I, [2012-06-05T00:03:12.232729 #2978]  INFO -- : Building 'centos6-jeos' appliance for x86_64 architecture.
I, [2012-06-05T00:03:12.236035 #2978]  INFO -- : Resolving packages added to centos6-jeos appliance definition file...
I, [2012-06-05T00:03:38.005527 #2978]  INFO -- : All additional packages for centos6-jeos appliance successfully resolved.
I, [2012-06-05T00:03:38.005846 #2978]  INFO -- : Building centos6-jeos appliance...
supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/3.3.7-1.fc17.x86_64 is a directory
picked vmlinuz-3.3.7-1.fc17.x86_64 because modpath /lib/modules/3.3.7-1.fc17.x86_64 exists
checking modpath /lib/modules/3.3.4-5.fc17.x86_64 is a directory
picked vmlinuz-3.3.4-5.fc17.x86_64 because modpath /lib/modules/3.3.4-5.fc17.x86_64 exists
supermin helper [00000ms] finished creating kernel
supermin helper [00001ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00001ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00007ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00014ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [00098ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [00098ms] adding kernel modules
supermin helper [00196ms] finished creating appliance
supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = /tmp/guestfs.gIaqbT/kernel, initrd = /tmp/guestfs.gIaqbT/initrd, appliance = /tmp/guestfs.gIaqbT/root
supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/3.3.7-1.fc17.x86_64 is a directory
picked vmlinuz-3.3.7-1.fc17.x86_64 because modpath /lib/modules/3.3.7-1.fc17.x86_64 exists
checking modpath /lib/modules/3.3.4-5.fc17.x86_64 is a directory
picked vmlinuz-3.3.4-5.fc17.x86_64 because modpath /lib/modules/3.3.4-5.fc17.x86_64 exists
supermin helper [00000ms] finished creating kernel
supermin helper [01219ms] finished mke2fs
supermin helper [01220ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [01220ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [05841ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [05881ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [17090ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [17095ms] adding kernel modules
supermin helper [30948ms] closing ext2 filesystem
supermin helper [30948ms] finished creating appliance
W, [2012-06-05T00:11:50.557966 #2978]  WARN -- : Loading SELinux policy failed. SELinux may be not fully initialized.
I, [2012-06-05T00:12:00.319755 #2978]  INFO -- : Executing post operations after build...
I, [2012-06-05T00:12:00.694046 #2978]  INFO -- : Base image for centos6-jeos appliance was built successfully.
I, [2012-06-05T00:12:00.718734 #2978]  INFO -- : Copying disk build/appliances/x86_64/centos/6/centos6-jeos/1.0/centos-plugin/centos6-jeos-sda.raw to: /var/lib/libvirt/images...
I, [2012-06-05T00:12:48.573367 #2978]  INFO -- : Determining remotely.
I, [2012-06-05T00:12:50.454926 #2978]  INFO -- : Defining domain centos6-jeos-1-0-centos-6-x86_64-raw

centos jeos VM has been deployed !
[root@fc17 boxgrinder_works]# virsh list --all
Id    Name                           State
----------------------------------------------------
-     centos6-jeos-1-0-centos-6-x86_64-raw shut off


virsh # dumpxml centos6-jeos-1-0-centos-6-x86_64-raw
<domain type='qemu'>
 <name>centos6-jeos-1-0-centos-6-x86_64-raw</name>
 <uuid>4e2aeb27-2aa4-2751-ad51-a0ac798466b8</uuid>
 <description>CentOS 6 Core</description>
 <memory unit='KiB'>262144</memory>
 <currentMemory unit='KiB'>262144</currentMemory>
 <vcpu>1</vcpu>
 <os>
   <type arch='x86_64' machine='pc-0.15'>hvm</type>
   <boot dev='hd'/>
 </os>
 <features>
   <pae/>
 </features>
 <clock offset='utc'/>
 <on_poweroff>destroy</on_poweroff>
 <on_reboot>restart</on_reboot>
 <on_crash>destroy</on_crash>
 <devices>
   <emulator>/usr/bin/qemu-system-x86_64</emulator>
   <disk type='file' device='disk'>
     <driver name='qemu' type='raw'/>
     <source file='/var/lib/libvirt/images/centos6-jeos-sda.raw'/>
     <target dev='hda' bus='ide'/>
     <address type='drive' controller='0' bus='0' target='0' unit='0'/>
   </disk>
   <controller type='usb' index='0'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
   </controller>
   <controller type='ide' index='0'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
   </controller>
   <interface type='network'>
     <mac address='52:54:00:91:44:2b'/>
     <source network='default'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
   </interface>
   <serial type='pty'>
     <target port='0'/>
   </serial>
   <console type='pty'>
     <target type='serial' port='0'/>
   </console>
   <input type='mouse' bus='ps2'/>
   <graphics type='vnc' port='-1' autoport='yes'/>
   <video>
     <model type='cirrus' vram='9216' heads='1'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
   </video>
   <memballoon model='virtio'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
   </memballoon>
 </devices>
</domain>

virsh #



start the VM
virsh # start centos6-jeos-1-0-centos-6-x86_64-raw
Domain centos6-jeos-1-0-centos-6-x86_64-raw started

virsh # list --all
Id    Name                           State
----------------------------------------------------
1     centos6-jeos-1-0-centos-6-x86_64-raw running





No comments:

Post a Comment

Note: Only a member of this blog may post a comment.