{"id":183,"date":"2007-07-18T17:19:06","date_gmt":"2007-07-18T22:19:06","guid":{"rendered":"https:\/\/dillernet.com\/apple\/2007\/07\/18\/xen-domains-rhel-and-networking\/"},"modified":"2007-07-18T17:20:17","modified_gmt":"2007-07-18T22:20:17","slug":"xen-domains-rhel-and-networking","status":"publish","type":"post","link":"https:\/\/dillernet.com\/apple\/2007\/07\/18\/xen-domains-rhel-and-networking\/","title":{"rendered":"Xen Domains, RHEL and Networking"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dillernet.com\/apple\/wp-content\/uploads\/2007\/07\/xen-image.jpeg?resize=121%2C102&#038;ssl=1\" border=\"0\" height=\"102\" width=\"121\" alt=\"xen_image.jpeg\" align=\"left\" vspace=\"10\" hspace=\"10\" \/>At the office I&#8217;m deploying some new servers using Xen domains running under RHEL 5.0. We use RHEL 4.4 for our systems, and so re-deploying some of them as RHEL 4.5 (the Xen-kernel enabled version) Domains saves hardware space, money and keeps the server room cooler. Many dev servers are not utilized like production systems and so will benefit from the Xen virtualization.<\/p>\n<p>Setting up the domains is pretty straight forward, RedHat has a nice guide using their virt-manager GUI tool. There are also excellent guides at the Centos <a href=\"http:\/\/wiki.centos.org\/HowTos\/Xen\/InstallingCentOSDomU\">wiki<\/a>.<\/p>\n<p>Two things were not obvious to me, and I&#8217;m posting my findings here to help others.<\/p>\n<h3>Issue 1 Multiple networks<\/h3>\n<p>After building the domain, the first thing that stopped me was that I needed multiple networks. The virtual hosts need to be on three networks, and so I needed three virtual devices. The RedHat guide has a nice section on how to create the necessary br0 (network bridge devices) devices, so modifying the scripts to go from one br0 to three (br0, br2, br3) each corresponding to a real NIC on the host was straightforward. However, how to get the virtual devices to recognize and use these new bridges? There is only one config file for your domain, and it looks like this:<\/p>\n<pre>\n# Automatically generated xen config file\nname = \"myVirtualPony\"\nmemory = \"1024\"\ndisk = [ 'phy:\/dev\/virt_vg\/some_virtdisk,xvda,w', ]\nvif = [ 'mac=00:16:3e:3d:11:f7, bridge=xenbr0', ]\nvfb = [\"type=vnc,vncunused=1\"]\nuuid = \"fff0f6c0-60e2-xxxx-xxxx-xxxxxxxxxx\"\nbootloader=\"\/usr\/bin\/pygrub\"\nvcpus=1\non_reboot   = 'restart'\non_crash    = 'restart'\n<\/pre>\n<p>It should be obvious to any Python programmer, but it wasn&#8217;t to me initially. Eventually I realized you had to add some new attributes to the vif list. The Redhat guide has a nice python snippet to generate new MAC addresses for you. I used that to generate two more MACs, then added them in:<\/p>\n<pre>\n# Automatically generated xen config file\nname = \"myVirtualPony\"\nmemory = \"1024\"\ndisk = [ 'phy:\/dev\/virt_vg\/some_virtdisk,xvda,w', ]\nvif = [ 'mac=00:16:3e:3d:11:f7, bridge=xenbr0',\n        'mac=00:16:3e:19:11:ed, bridge=xenbr2',\n        'mac=00:16:3e:49:11:40, bridge=xenbr3', ]\nvfb = [\"type=vnc,vncunused=1\"]\nuuid = \"fff0f6c0-60e2-xxxx-xxxx-xxxxxxxxxx\"\nbootloader=\"\/usr\/bin\/pygrub\"\nvcpus=1\non_reboot   = 'restart'\non_crash    = 'restart'\n<\/pre>\n<p>Now just reboot the domain with a quick<\/p>\n<pre>\n$ xm reboot myVirtualPony\n<\/pre>\n<p>and loginto the domain. Copy the  \/etc\/sysconfig\/network-scripts\/ifcfg-eth0 to ifcfg-eth1, ifcfg-eth2 and edit them, using the new MAC addresses you created and the proper TCP\/IP info.<\/p>\n<p>There is an excellent Page on<a href=\"http:\/\/wiki.xensource.com\/xenwiki\/XenNetworking\"> Xen Networking<\/a> at Xensource Wiki. I wish I had found this when I was banging my head on this problem.<\/p>\n<h3>Issue 2 &#8211; Virtual Console<\/h3>\n<p>After my domains were setup most Xen docs talk about using the virtual console to login to your domain from the host, similar to what you can do with Solaris Zones.<\/p>\n<p>On the master host you should be able to login to the virtual console of the local domains. However, when you build your domains with RedHat&#8217;s virt-manger they don&#8217;t setup the virtual console correctly. They attach serial output to the virtual-framebuffer. So if you try and use the virtual tty, you only get the output of the kernel booting, then it stops and your terminal is stuck.<\/p>\n<p>To fix this, you can follow the directions <a href=\"http:\/\/wiki.centos.org\/TipsAndTricks\/Xen?highlight=%28Console%20handling%29\">Xen Centos Tips and Tricks<\/a> page:<\/p>\n<p>You just need to add<\/p>\n<pre>\nco:2345:respawn:\/sbin\/agetty xvc0 9600 vt100-nav\n<\/pre>\n<p>in \/etc\/inittab<\/p>\n<p>and add<\/p>\n<pre>\nxvc0\n<\/pre>\n<p>to the file \/etc\/securetty. Then do a @ telinit q to re-load the \/etc\/inittab and you should be able to use the virtual console from a tty.<\/p>\n<p>Now with that out of the way I can do this to login into my domain:<\/p>\n<pre>\nxm console myVirtualPony\n<\/pre>\n<p>Xen is fun.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the office I&#8217;m deploying some new servers using Xen domains running under RHEL 5.0. We use RHEL 4.4 for our systems, and so re-deploying some of them as RHEL 4.5 (the Xen-kernel enabled version) Domains saves hardware space, money and keeps the server room cooler. Many dev servers are not utilized like production systems [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[20,6],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-linux","category-tech"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3PE01-2X","jetpack-related-posts":[{"id":281,"url":"https:\/\/dillernet.com\/apple\/2009\/07\/07\/amazon-ec2-and-elastic-load-balancers-no-paid-amis\/","url_meta":{"origin":183,"position":0},"title":"Amazon EC2 and Elastic Load Balancers &#8211; no paid AMIs?","author":"dillera","date":"July 7, 2009","format":false,"excerpt":"I was setting up a load-balanced pair of Nodes on EC2 and ran into a snag: you can't add paid AMIs (we sometimes use the real RedHat AMIs) with the elastic load balancers! So I kicked off some Centos 5.2 images from RightScale and moved everything over. This is going\u2026","rel":"","context":"In &quot;Cloud&quot;","block_context":{"text":"Cloud","link":"https:\/\/dillernet.com\/apple\/category\/cloud\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":139,"url":"https:\/\/dillernet.com\/apple\/2007\/03\/25\/blog-changes-and-updates\/","url_meta":{"origin":183,"position":1},"title":"Blog Changes and Updates","author":"dillera","date":"March 25, 2007","format":false,"excerpt":"So it's been a while since I've posted here- but it's nothing I'm sure you haven't read on dozens of other blogs. I'm in a gadget deficit, and I switched jobs to one that keeps me much busier than I was before. I'm now working back in an office, for\u2026","rel":"","context":"In &quot;Interesting&quot;","block_context":{"text":"Interesting","link":"https:\/\/dillernet.com\/apple\/category\/interesting\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":275,"url":"https:\/\/dillernet.com\/apple\/2009\/03\/31\/conficter\/","url_meta":{"origin":183,"position":2},"title":"Conficter- sick","author":"dillera","date":"March 31, 2009","format":false,"excerpt":"Next, Conficker A enters an infinite loop, within which it generates a list of 250 domain names (rendezvous points). The name-generation function is based on a randomizing function that it seeds with the current UTC system date. The same list of 250 names is generated every 3 hours, i.e., 8\u2026","rel":"","context":"In &quot;Interesting&quot;","block_context":{"text":"Interesting","link":"https:\/\/dillernet.com\/apple\/category\/interesting\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":41,"url":"https:\/\/dillernet.com\/apple\/2005\/02\/23\/blackberry-connect-for-palm-update\/","url_meta":{"origin":183,"position":3},"title":"Blackberry Connect for Palm Update","author":"admin","date":"February 23, 2005","format":false,"excerpt":"If you were wondering (like me) if this is ever going to pan out, I got a new hit today on google regarding this. This was introduced back in May of 2004. PalmSource Mail for BlackBerry Connect Overview PalmSource Mail for BlackBerry Connect is the standard email client for Palm\u2026","rel":"","context":"In &quot;Palm&quot;","block_context":{"text":"Palm","link":"https:\/\/dillernet.com\/apple\/category\/palm\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":963,"url":"https:\/\/dillernet.com\/apple\/2024\/03\/13\/apple-internet-routing-in-2024\/","url_meta":{"origin":183,"position":4},"title":"Apple Internet Routing in 2024","author":"dillera","date":"March 13, 2024","format":false,"excerpt":"Being an AppleTalk Network Admin is hard work in 2024. This hopefully helps level some of the rough edges that are out there. I'll be updating it with more info and corrections as time permits. The guide that started it is here: https:\/\/biosrhythm.com\/?p=2767 My download with all the software, tested\u2026","rel":"","context":"In &quot;Apple&quot;","block_context":{"text":"Apple","link":"https:\/\/dillernet.com\/apple\/category\/apple\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dillernet.com\/apple\/wp-content\/uploads\/2024\/03\/MARCHintoshLogo.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dillernet.com\/apple\/wp-content\/uploads\/2024\/03\/MARCHintoshLogo.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dillernet.com\/apple\/wp-content\/uploads\/2024\/03\/MARCHintoshLogo.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":59,"url":"https:\/\/dillernet.com\/apple\/2005\/06\/21\/bgp-routing-policies-in-isp-networks\/","url_meta":{"origin":183,"position":5},"title":"BGP Routing Policies in ISP networks","author":"admin","date":"June 21, 2005","format":false,"excerpt":"For something a bit more technical, take a look at the below paper. It's short (7 pages) and gives a great overview of BGP in ISP networks- why they do it, what it does and how you can have fun with BGP. I've often wondered about BGP is really used\u2026","rel":"","context":"In &quot;Tech&quot;","block_context":{"text":"Tech","link":"https:\/\/dillernet.com\/apple\/category\/tech\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dillernet.com\/apple\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}