From apevec at gmail.com Sun Mar 1 11:10:33 2009 From: apevec at gmail.com (Alan Pevec) Date: Sun, 1 Mar 2009 12:10:33 +0100 Subject: [Ovirt-devel] Evil nscd, evil! In-Reply-To: <49A9CF64.6070802@redhat.com> References: <20090227150056.0a64c946@tp.mains.net> <49A9CF64.6070802@redhat.com> Message-ID: <2be7262f0903010310l618c4632mfe46f52f5a729a6e@mail.gmail.com> On Sun, Mar 1, 2009 at 12:57 AM, Perry Myers wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=481796 > > The bz isn't clear on which version of livecd-tools does the nscd stop/start > hack. not in -021 and I don't see it in git either From katzj at redhat.com Mon Mar 2 03:30:12 2009 From: katzj at redhat.com (Jeremy Katz) Date: Sun, 1 Mar 2009 22:30:12 -0500 Subject: [Ovirt-devel] Evil nscd, evil! In-Reply-To: <49A9CF64.6070802@redhat.com> References: <20090227150056.0a64c946@tp.mains.net> <49A9CF64.6070802@redhat.com> Message-ID: <20090302033012.GC87399@redhat.com> On Saturday, February 28 2009, Perry Myers said: > Ian Main wrote: >> I just wanted to let everyone know so no extra time is wasted.. >> >> If you are working with the installer then IPA gets installed which starts nscd. nscd attempts to cache various things including user and group lookups which BREAKS BUILDING IMAGES (they can't unmount cleanly). This includes building the node-image. So, this is just a reminder to turn off nscd if it's running on your build box. :) > > I think newer versions of livecd-tools fixes this by turning off nscd > before building the livecd image and then turning it back on when the > creation is done. > > See the following BZ: > https://bugzilla.redhat.com/show_bug.cgi?id=481796 > > The bz isn't clear on which version of livecd-tools does the nscd > stop/start hack. Right now, the version on my workstation[1] only. The hack of turning off nscd from livecd-creator itself wasn't working, so I didn't push it to git :/ Unfortunately anything like that really is just a hack -- the only "right" thing to do is fixing nscd and prospects for that seemed grim :( Jeremy [1] Which is off right now due to the power outage in Westford or I'd post it for others to try out :) From apevec at gmail.com Mon Mar 2 10:12:07 2009 From: apevec at gmail.com (Alan Pevec) Date: Mon, 2 Mar 2009 11:12:07 +0100 Subject: [Ovirt-devel] Evil nscd, evil! In-Reply-To: <20090302033012.GC87399@redhat.com> References: <20090227150056.0a64c946@tp.mains.net> <49A9CF64.6070802@redhat.com> <20090302033012.GC87399@redhat.com> Message-ID: <2be7262f0903020212u71fe98dcp80104e47931253e6@mail.gmail.com> ok, we'll add check in ovirt-node-image Makefile to abort on pgrep nscd, until nscd is fixed. From dpierce at redhat.com Mon Mar 2 15:09:08 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 2 Mar 2009 10:09:08 -0500 Subject: [Ovirt-devel] [PATCH node] Added an [A]bort option to IPv6 configuration. Message-ID: <1236006548-26558-1-git-send-email-dpierce@redhat.com> The functionality was already there, but no menu item referenced it. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 21c22f5..ae6d7b0 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -71,7 +71,7 @@ function configure_interface esac printf "\n" - read -ep "Enable IPv6 support ([S]tatic, [D]HCPv6, A[u]to, [N]o)? " + read -ep "Enable IPv6 support ([S]tatic, [D]HCPv6, A[u]to, [N]o, or [A]bort)? " case $REPLY in S|s) read -ep "IPv6 Address: "; IPADDR=$REPLY -- 1.6.0.6 From jboggs at redhat.com Mon Mar 2 15:13:19 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 02 Mar 2009 10:13:19 -0500 Subject: [Ovirt-devel] [PATCH server] secure the perissions on the ovirt.pp manifest file In-Reply-To: <20090227163219.GA85702@redhat.com> References: <1235595875-13536-1-git-send-email-jboggs@redhat.com> <20090225211437.GA2907@redhat.com> <49A70ED1.7080900@redhat.com> <20090227163219.GA85702@redhat.com> Message-ID: <49ABF78F.3010408@redhat.com> Jeremy Katz wrote: > On Thursday, February 26 2009, Joey Boggs said: > >> Jeremy Katz wrote: >> >>> On Wednesday, February 25 2009, Joey Boggs said: >>> >>>> Secures the permissions on ovirt.pp to only allow only root read/write access all other 000 >>>> > [snip] > >> If we move the chmod right after the file is created is that better or >> wrong since the file is open while we performing the operation? Set to >> 600 as well >> > > >> ---------------------------------------------------------------- >> FileUtils.mkdir_p("/usr/share/ace/appliances/ovirt") >> config_file = File.new("/usr/share/ace/appliances/ovirt/ovirt.pp", "w") >> File.chmod 0600, '/usr/share/ace/appliances/ovirt/ovirt.pp' >> > > A quick look at the ruby docs and File.new takes a permission argument. > So config_file = File.new("/path", "w", 0600) should be better[1] > > Jeremy > > [1] And if it's not, then ruby needs fixing :-) > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > Last go at it :) diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer index 3ba9813..cb0bf15 100755 --- a/installer/bin/ovirt-installer +++ b/installer/bin/ovirt-installer @@ -292,7 +292,7 @@ END_OF_TEMPLATE # Generate the file and output it. FileUtils.mkdir_p("/usr/share/ace/appliances/ovirt") -config_file = File.new("/usr/share/ace/appliances/ovirt/ovirt.pp", "w") +config_file = File.new("/usr/share/ace/appliances/ovirt/ovirt.pp", "w", 0600) config_file.write(ERB.new(template, 0, "%>").result) config_file.close() From jboggs at redhat.com Mon Mar 2 15:19:16 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 2 Mar 2009 10:19:16 -0500 Subject: [Ovirt-devel] [PATCH server] reword selinux disable/permissive prompt Message-ID: <1236007156-5672-1-git-send-email-jboggs@redhat.com> Rewords the selinux prompt to permissive rather than disable --- installer/bin/ovirt-installer | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer index cb0bf15..8201d01 100755 --- a/installer/bin/ovirt-installer +++ b/installer/bin/ovirt-installer @@ -91,12 +91,12 @@ end if File.exist?("/usr/sbin/selinuxenabled") sestatus = system "/usr/sbin/selinuxenabled" if sestatus == true - selinux_disable = prompt_yes_no("SELinux enabled, would you like to disable it?", :default => "y") - if selinux_disable == "n" - @cli.say("Please disable selinux prior to running the installer again") + selinux_permissive = prompt_yes_no("SELinux enforing, would you like to set it permissive?", :default => "y") + if selinux_permissive == "n" + @cli.say("SELinux must be permissive or disabled prior to running the installer again") exit(0) else - @cli.say("Disabling SELinux") + @cli.say("Setting SELinux permissive") system "/usr/sbin/lokkit --selinux=permissive" system "/usr/sbin/setenforce 0" end -- 1.6.0.6 From jboggs at redhat.com Mon Mar 2 15:33:00 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 02 Mar 2009 10:33:00 -0500 Subject: [Ovirt-devel] [PATCH server] secure the perissions on the ovirt.pp manifest file In-Reply-To: <20090302151524.GA87661@redhat.com> References: <1235595875-13536-1-git-send-email-jboggs@redhat.com> <20090225211437.GA2907@redhat.com> <49A70ED1.7080900@redhat.com> <20090227163219.GA85702@redhat.com> <49ABF78F.3010408@redhat.com> <20090302151524.GA87661@redhat.com> Message-ID: <49ABFC2C.8070309@redhat.com> Jeremy Katz wrote: > On Monday, March 02 2009, Joey Boggs said: > >> Jeremy Katz wrote: >> >>> On Thursday, February 26 2009, Joey Boggs said: >>> >>>> Jeremy Katz wrote: >>>> >>>>> On Wednesday, February 25 2009, Joey Boggs said: >>>>> >>>>>> Secures the permissions on ovirt.pp to only allow only root read/write access all other 000 >>>>>> >>> [snip] >>> >>>> If we move the chmod right after the file is created is that better >>>> or wrong since the file is open while we performing the operation? >>>> Set to 600 as well >>>> >>> >>> >>>> ---------------------------------------------------------------- >>>> FileUtils.mkdir_p("/usr/share/ace/appliances/ovirt") >>>> config_file = File.new("/usr/share/ace/appliances/ovirt/ovirt.pp", "w") >>>> File.chmod 0600, '/usr/share/ace/appliances/ovirt/ovirt.pp' >>>> >>> A quick look at the ruby docs and File.new takes a permission argument. >>> So config_file = File.new("/path", "w", 0600) should be better[1] >>> >>> >> Last go at it :) >> > > Looks good > > Jeremy > pushed From imain at redhat.com Tue Mar 3 01:04:34 2009 From: imain at redhat.com (Ian Main) Date: Mon, 2 Mar 2009 17:04:34 -0800 Subject: [Ovirt-devel] [PATCH server] Various taskomatic fixes Message-ID: <1236042274-12046-1-git-send-email-imain@redhat.com> This patch fixes: - Allows deletion of pending_setup volumes (deletes db row even if it can't find the real volume). - Do not use intermediate 'starting' state in start_vm. I don't think it's really useful. Signed-off-by: Ian Main --- src/task-omatic/taskomatic.rb | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 56ee107..8d35692 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -315,9 +315,6 @@ class TaskOmatic def task_start_vm(task) db_vm = find_vm(task, false) - # Kinda silly? I dunno about these intermediate states.. - set_vm_state(db_vm, Vm::STATE_STARTING) - vm = @session.object(:class => "domain", 'uuid' => db_vm.uuid) if vm @@ -750,7 +747,10 @@ class TaskOmatic # 2) This could potentially take quite a while, so we want to spawn # off another thread to do it # result = volume.delete - raise "Error deleting volume: #{result.text}" unless result.status == 0 + + # If we don't find the volume we assume there was some error setting + # it up, so just carry on here.. + volume.delete if volume # Note: we have to nil out the task_target because when we delete the # volume object, that also deletes all dependent tasks (including this -- 1.6.0.3 From dpierce at redhat.com Tue Mar 3 15:25:54 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 3 Mar 2009 10:25:54 -0500 Subject: [Ovirt-devel] [PATCH node-image] An attempt to overcome the lack of job control WRT pinging. Message-ID: <1236093954-32044-1-git-send-email-dpierce@redhat.com> Adds an alias for ping that includes an explicit limit to 3 ping attempts. Signed-off-by: Darryl L. Pierce --- common-post.ks | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/common-post.ks b/common-post.ks index fc7bbac..8ec0295 100644 --- a/common-post.ks +++ b/common-post.ks @@ -102,3 +102,8 @@ chmod 700 /root/.ssh # fix iSCSI/LVM startup issue sed -i 's/node\.session\.initial_login_retry_max.*/node.session.initial_login_retry_max = 60/' /etc/iscsi/iscsid.conf +# root's bash profile +cat >> /root/.bashrc < References: <1236093954-32044-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0903030845l2d8b0b2au94c29f0fd2d14aa@mail.gmail.com> On Tue, Mar 3, 2009 at 4:25 PM, Darryl L. Pierce wrote: > +# root's bash profile > +cat >> /root/.bashrc < set it to expire immediately (1s) default metadata_expire is 1.5h --- ovirt.mk | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/ovirt.mk b/ovirt.mk index cc10bd7..2e7b40c 100644 --- a/ovirt.mk +++ b/ovirt.mk @@ -58,6 +58,7 @@ define write_repo_file echo "name=ovirt-local" ; \ echo "baseurl=file://$(OVIRT_CACHE_DIR)/ovirt" ; \ echo "enabled=1" ; \ + echo "metadata_expire=1" ; \ echo "gpgcheck=0") > $(OVIRT_CACHE_DIR)/ovirt-local.repo endef -- 1.6.0.6 From dpierce at redhat.com Tue Mar 3 18:25:17 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 3 Mar 2009 13:25:17 -0500 Subject: [Ovirt-devel] [PATCH node-image] An attempt to overcome the lack of job control WRT pinging. In-Reply-To: <2be7262f0903030845l2d8b0b2au94c29f0fd2d14aa@mail.gmail.com> References: <1236093954-32044-1-git-send-email-dpierce@redhat.com> <2be7262f0903030845l2d8b0b2au94c29f0fd2d14aa@mail.gmail.com> Message-ID: <20090303182517.GE4383@mcpierce-laptop.rdu.redhat.com> On Tue, Mar 03, 2009 at 05:45:15PM +0100, Alan Pevec wrote: > On Tue, Mar 3, 2009 at 4:25 PM, Darryl L. Pierce wrote: > > +# root's bash profile > > +cat >> /root/.bashrc < > Needs to be /.bashrc - this workaround is needed only for emergency > shell (Shell option in firstboot menu). > When started from init, homedir is not set, so /root/.bashrc is not sourced. I've tested this and it does source /root/.bashrc even thought $HOME is undefined. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ Is fearr Gaeilge bhriste n? B?arla cliste. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: From mmorsi at redhat.com Tue Mar 3 19:07:59 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Tue, 03 Mar 2009 14:07:59 -0500 Subject: [Ovirt-devel] Re: [PATCH server] improvements / fixes to ovirt network ui In-Reply-To: <1234910641-12314-1-git-send-email-mmorsi@redhat.com> References: <1234910641-12314-1-git-send-email-mmorsi@redhat.com> Message-ID: <49AD800F.3080505@redhat.com> Patch bump. Know everyone's busy w/ the installer and other things but was wondering if anyone had a second to take a look at this before it got stale. I made sure to thoroughly test everything included when I wrote it so a brief code review and a quick functionality verification should be all that's needed. I had also sent out an additional email with a few notes relating to these changes. It can be found here https://www.redhat.com/archives/ovirt-devel/2009-February/msg00178.html Thanks alot, -Mo From imain at redhat.com Tue Mar 3 19:30:16 2009 From: imain at redhat.com (Ian Main) Date: Tue, 3 Mar 2009 11:30:16 -0800 Subject: [Ovirt-devel] [PATCH server] Fix NFS volume creation in taskomatic Message-ID: <1236108616-23227-1-git-send-email-imain@redhat.com> This patch fixes NFS volume creation by removing bogus user/group values and just using the default permissions in libvirt. It also uses sparse files when creating volumes to allow this to happen MUCH faster thereby avoiding the QMF timeout for now. Note that this is really just a workaround for lack of threading/asynchronous calls/timeouts etc. Signed-off-by: Ian Main --- src/task-omatic/task_storage.rb | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/task-omatic/task_storage.rb b/src/task-omatic/task_storage.rb index 6465308..afc8964 100644 --- a/src/task-omatic/task_storage.rb +++ b/src/task-omatic/task_storage.rb @@ -168,9 +168,9 @@ class LibvirtPool @vol_xml.root.add_element("capacity", {"unit" => "K"}).add_text(size.to_s) @vol_xml.root.add_element("target") @vol_xml.root.elements["target"].add_element("permissions") - @vol_xml.root.elements["target"].elements["permissions"].add_element("owner").add_text(owner) - @vol_xml.root.elements["target"].elements["permissions"].add_element("group").add_text(group) - @vol_xml.root.elements["target"].elements["permissions"].add_element("mode").add_text(mode) + @vol_xml.root.elements["target"].elements["permissions"].add_element("owner").add_text(owner) if owner + @vol_xml.root.elements["target"].elements["permissions"].add_element("group").add_text(group) if group + @vol_xml.root.elements["target"].elements["permissions"].add_element("mode").add_text(mode) if mode end def shutdown @@ -260,6 +260,13 @@ class NFSLibvirtPool < LibvirtPool # FIXME: we have to add the format as raw here because of a bug in libvirt; # if you specify a volume with no format, it will crash libvirtd @vol_xml.root.elements["target"].add_element("format", {"type" => "raw"}) + + # FIXME: Add allocation 0 element so that we create a sparse file. + # This was done because qmf was timing out waiting for the create + # operation to complete. This needs to be fixed in a better way + # however. We want to have non-sparse files for performance reasons. + @vol_xml.root.add_element("allocation").add_text('0') + result = @remote_pool.createVolumeXML(@vol_xml.to_s) raise "Error creating remote pool: #{result.text}" unless result.status == 0 return result.volume -- 1.6.0.6 From dpierce at redhat.com Tue Mar 3 22:39:03 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 3 Mar 2009 17:39:03 -0500 Subject: [Ovirt-devel] [PATCH node] Disable o-c-storage on systems booted from local storage. Message-ID: <1236119943-23115-1-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-boot | 3 +++ scripts/ovirt-config-boot-wrapper | 2 +- scripts/ovirt-config-storage | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index 40b3a6b..3ee0665 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -155,6 +155,9 @@ EOF # mark new Root ready to go, reboot() in ovirt-function switches it to active lvrename HostVG RootNew RootUpdate + # remove the o-c-storage script symlink so it won't show in the firstboot menu + rm -f /etc/ovirt-config-setup.d/98_* + rm -rf $tmpdir log "done." } diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper index 4ac742a..5264bed 100755 --- a/scripts/ovirt-config-boot-wrapper +++ b/scripts/ovirt-config-boot-wrapper @@ -15,7 +15,7 @@ Please ensure that you have configured the local storage \n\ and networking correctly on the previous menu before \n\ continuing." printf "\n\n" - read -p "Do you wish to continue? (Y|N)? " + read -p "Do you wish to continue (Y/n)? " r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]') if [ "$r" == "Y" ]; then mount_live \ diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index c9225f7..c2ab88e 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -15,6 +15,12 @@ die() { warn "$*"; exit 1; } trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +# check that we're not booted from local storage; if so then exit with an error +grep \/dev\/HostVG\/Root /proc/cmdline > /dev/null +if [ 0 -eq $? ]; then + die "You cannot configure storage on a running system. Please boot from CD/USB to configure local storage." +fi + default_overcommit=0.5 default_boot_size=50 -- 1.6.0.6 From sseago at redhat.com Tue Mar 3 22:49:25 2009 From: sseago at redhat.com (Scott Seago) Date: Tue, 03 Mar 2009 17:49:25 -0500 Subject: [Ovirt-devel] [PATCH server] Fix NFS volume creation in taskomatic In-Reply-To: <1236108616-23227-1-git-send-email-imain@redhat.com> References: <1236108616-23227-1-git-send-email-imain@redhat.com> Message-ID: <49ADB3F5.3040709@redhat.com> Ian Main wrote: > This patch fixes NFS volume creation by removing bogus user/group > values and just using the default permissions in libvirt. It also > uses sparse files when creating volumes to allow this to happen > MUCH faster thereby avoiding the QMF timeout for now. Note that > this is really just a workaround for lack of threading/asynchronous > calls/timeouts etc. > > Signed-off-by: Ian Main > > ACK works for me. Scott From imain at redhat.com Tue Mar 3 22:49:28 2009 From: imain at redhat.com (Ian Main) Date: Tue, 3 Mar 2009 14:49:28 -0800 Subject: [Ovirt-devel] [PATCH server] Fix dbomatic qpid reconnect Message-ID: <1236120568-3390-1-git-send-email-imain@redhat.com> This patch uses the managed connection arrangement in the qpid library which uses a separate thread to manage the qpid connection; a much better way to go. Signed-off-by: Ian Main --- src/db-omatic/db_omatic.rb | 55 ++++++++++++++----------------------------- 1 files changed, 18 insertions(+), 37 deletions(-) diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb index 6dc02fb..96202f4 100755 --- a/src/db-omatic/db_omatic.rb +++ b/src/db-omatic/db_omatic.rb @@ -40,7 +40,6 @@ class DbOmatic < Qpid::Qmf::Console @cached_objects = {} @heartbeats = {} @broker = nil - @session = Qpid::Qmf::Session.new(:console => self) do_daemon = true @@ -74,49 +73,33 @@ class DbOmatic < Qpid::Qmf::Console end @logger.info "dbomatic started." - get_credentials('qpidd') + ensure_credentials database_connect - qpid_ensure_connected - - end - - - # FIXME: This should move into a library but I think we'll need - # to make some sort of singleton class for these applications so we can - # share the logger and qpid variables etc. It's getting to show itself - # as a problem but I don't want to go crazy right now as we're supposed - # to be in freeze. :) - def qpid_ensure_connected() - - return if @broker and @broker.connected? - sleepy = 2 + server, port = nil + (1..4).each do + server, port = get_srv('qpidd', 'tcp') + break if server + @logger.error "Unable to determine qpid server from DNS SRV record" if not server + sleep(10) + end - while true do - begin - server, port = get_srv('qpidd', 'tcp') - raise "Unable to determine qpid server from DNS SRV record" if not server + raise "Unable to determine server and port from DNS SRV records" if not server - @broker = @session.add_broker("amqp://#{server}:#{port}", :mechanism => 'GSSAPI') + @logger.info "Connecting to amqp://#{server}:#{port}" + @session = Qpid::Qmf::Session.new(:console => self, :manage_connections => true) + @broker = @session.add_broker("amqp://#{server}:#{port}", :mechanism => 'GSSAPI') + end - # Connection succeeded, go about our business. - @logger.info "Connected to amqp://#{server}:#{port}" - return - rescue Exception => msg - @logger.error "Error connecting to qpidd: #{msg}" - @logger.error msg.backtrace - end - sleep(sleepy) - sleepy *= 2 - sleepy = 120 if sleepy > 120 + def ensure_credentials() + get_credentials('qpidd') - begin - # Could also be a credentials problem? Try to get them again.. + Thread.new do + while true do + sleep(3600) get_credentials('qpidd') - rescue Exception => msg - @logger.error "Error getting qpidd credentials: #{msg}" end end end @@ -370,8 +353,6 @@ class DbOmatic < Qpid::Qmf::Console while true sleep(5) - qpid_ensure_connected - synchronize do # Get seconds from the epoch t = Time.new.to_i -- 1.6.0.6 From sseago at redhat.com Tue Mar 3 22:49:55 2009 From: sseago at redhat.com (Scott Seago) Date: Tue, 03 Mar 2009 17:49:55 -0500 Subject: [Ovirt-devel] [PATCH server] Various taskomatic fixes In-Reply-To: <1236042274-12046-1-git-send-email-imain@redhat.com> References: <1236042274-12046-1-git-send-email-imain@redhat.com> Message-ID: <49ADB413.2030707@redhat.com> Ian Main wrote: > This patch fixes: > > - Allows deletion of pending_setup volumes (deletes db row even if it > can't find the real volume). > - Do not use intermediate 'starting' state in start_vm. I don't think > it's really useful. > ACK. works for me. Scott From imain at redhat.com Tue Mar 3 23:00:50 2009 From: imain at redhat.com (Ian Main) Date: Tue, 3 Mar 2009 15:00:50 -0800 Subject: [Ovirt-devel] [PATCH server] Fix taskomatic qpid reconnect Message-ID: <1236121250-3805-1-git-send-email-imain@redhat.com> This patch uses the managed connection arrangement in the qpid library which uses a separate thread to manage the qpid connection. This is the same as was done for dbomatic in the previous patch. Signed-off-by: Ian Main --- src/task-omatic/taskomatic.rb | 58 +++++++++++++--------------------------- 1 files changed, 19 insertions(+), 39 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 8d35692..eb8e2ae 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -60,9 +60,6 @@ class TaskOmatic @sleeptime = 2 @nth_host = 0 - @session = Qpid::Qmf::Session.new() - @broker = nil - do_daemon = true opts = OptionParser.new do |opts| @@ -98,43 +95,31 @@ class TaskOmatic @logger = Logger.new(STDERR) end + ensure_credentials - # this has to be after daemonizing now because it could take a LONG time to - # actually connect if qpidd isn't running yet etc. - qpid_ensure_connected - - end - - def qpid_ensure_connected() - - return if @broker and @broker.connected? - - sleepy = 2 - - while true do - begin - server, port = get_srv('qpidd', 'tcp') - raise "Unable to determine qpid server from DNS SRV record" if not server + server, port = nil + (1..4).each do + server, port = get_srv('qpidd', 'tcp') + break if server + @logger.error "Unable to determine qpid server from DNS SRV record" if not server + sleep(10) + end - @broker = @session.add_broker("amqp://#{server}:#{port}", :mechanism => 'GSSAPI') + @session = Qpid::Qmf::Session.new(:manage_connections => true) + @logger.info "Connecting to amqp://#{server}:#{port}" + @broker = @session.add_broker("amqp://#{server}:#{port}", :mechanism => 'GSSAPI') - # Connection succeeded, go about our business. - @logger.info "Connected to amqp://#{server}:#{port}" - return + end - rescue Exception => msg - @logger.error "Error connecting to qpidd: #{msg}" - @logger.error msg.backtrace - end - sleep(sleepy) - sleepy *= 2 - sleepy = 120 if sleepy > 120 + def ensure_credentials() + get_credentials('qpidd') + get_credentials('libvirt') - begin - # Could also be a credentials problem? Try to get them again.. + Thread.new do + while true do + sleep(3600) get_credentials('qpidd') - rescue Exception => msg - @logger.error "Error getting qpidd credentials: #{msg}" + get_credentials('libvirt') end end end @@ -804,8 +789,6 @@ class TaskOmatic end end - qpid_ensure_connected - tasks.each do |task| task.time_started = Time.now @@ -867,9 +850,6 @@ class TaskOmatic end end -get_credentials('libvirt') -get_credentials('qpidd') - taskomatic = TaskOmatic.new() taskomatic.mainloop() -- 1.6.0.6 From apevec at gmail.com Tue Mar 3 23:27:19 2009 From: apevec at gmail.com (Alan Pevec) Date: Wed, 4 Mar 2009 00:27:19 +0100 Subject: [Ovirt-devel] [PATCH node] Disable o-c-storage on systems booted from local storage. In-Reply-To: <1236119943-23115-1-git-send-email-dpierce@redhat.com> References: <1236119943-23115-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0903031527o114fb10el126823492056b77d@mail.gmail.com> > + ? ?# remove the o-c-storage script symlink so it won't show in the firstboot menu > + ? ?rm -f /etc/ovirt-config-setup.d/98_* > + But this won't be persisted, change will be only done in the running writeable dm-snapshot. You need dynamic check in o-c-setup, to skip disk partitioning option if booted from HostVG. Also 98_* is '98_Local install and reboot', should be '00_Disk Partitioning' From sseago at redhat.com Wed Mar 4 15:51:05 2009 From: sseago at redhat.com (Scott Seago) Date: Wed, 04 Mar 2009 10:51:05 -0500 Subject: [Ovirt-devel] [PATCH server] reword selinux disable/permissive prompt In-Reply-To: <1236007156-5672-1-git-send-email-jboggs@redhat.com> References: <1236007156-5672-1-git-send-email-jboggs@redhat.com> Message-ID: <49AEA369.708@redhat.com> Joey Boggs wrote: > Rewords the selinux prompt to permissive rather than disable > > --- > installer/bin/ovirt-installer | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer > index cb0bf15..8201d01 100755 > --- a/installer/bin/ovirt-installer > +++ b/installer/bin/ovirt-installer > @@ -91,12 +91,12 @@ end > if File.exist?("/usr/sbin/selinuxenabled") > sestatus = system "/usr/sbin/selinuxenabled" > if sestatus == true > - selinux_disable = prompt_yes_no("SELinux enabled, would you like to disable it?", :default => "y") > - if selinux_disable == "n" > - @cli.say("Please disable selinux prior to running the installer again") > + selinux_permissive = prompt_yes_no("SELinux enforing, would you like to set it permissive?", :default => "y") > + if selinux_permissive == "n" > + @cli.say("SELinux must be permissive or disabled prior to running the installer again") > exit(0) > else > - @cli.say("Disabling SELinux") > + @cli.say("Setting SELinux permissive") > system "/usr/sbin/lokkit --selinux=permissive" > system "/usr/sbin/setenforce 0" > end > ACK. no functional changes here, but the wording is now correct. Scott From jason.guiditta at gmail.com Wed Mar 4 15:54:04 2009 From: jason.guiditta at gmail.com (Jason Guiditta) Date: Wed, 4 Mar 2009 10:54:04 -0500 Subject: [Ovirt-devel] [PATCH server] remove selinux disable, selinux is handled in the installer configurator now, required libvirt, but not disable it In-Reply-To: <1235594928-13163-1-git-send-email-jboggs@redhat.com> References: <1235594928-13163-1-git-send-email-jboggs@redhat.com> Message-ID: ACK, works for me. On Wed, Feb 25, 2009 at 3:48 PM, Joey Boggs wrote: > This removes an unnecessary selinux disable in the installer, the > configuration now handles selinux and sets to permissive. Also libvirt was > being disabled, we should not care if it's running or not. dnsmasq still > works with it enabled. > > --- > installer/modules/ovirt/manifests/ovirt.pp | 8 +------- > 1 files changed, 1 insertions(+), 7 deletions(-) > > diff --git a/installer/modules/ovirt/manifests/ovirt.pp > b/installer/modules/ovirt/manifests/ovirt.pp > index 960f4db..e177015 100644 > --- a/installer/modules/ovirt/manifests/ovirt.pp > +++ b/installer/modules/ovirt/manifests/ovirt.pp > @@ -109,11 +109,6 @@ class ovirt::setup { > notify => Service[qpidd] > } > > - exec { "disable_selinux" : > - command => "/usr/sbin/lokkit --selinux=disabled", > - require => Package["ovirt-server"] > - } > - > service {"httpd" : > enable => true, > require => Package[httpd], > @@ -121,8 +116,7 @@ class ovirt::setup { > } > > service {"libvirt" : > - enable => false, > - require => Package[libvirt], > + require => Package[libvirt] > } > > service {"ovirt-host-browser" : > -- > 1.6.0.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Daire.Byrne at framestore.com Wed Mar 4 15:52:00 2009 From: Daire.Byrne at framestore.com (Daire Byrne) Date: Wed, 4 Mar 2009 15:52:00 +0000 (GMT) Subject: [Ovirt-devel] QCOW2 image support? In-Reply-To: <381234480.31561236181639024.JavaMail.root@mailbox1> Message-ID: <1299378403.31581236181920669.JavaMail.root@mailbox1> Cheers for the info. I like how oVirt is shaping up and will keep a close eye on your progress. When we it has a few more of our required features I will endeavour to contribute. Regards, Daire ----- "Hugh O. Brock" wrote: > On Thu, Feb 26, 2009 at 09:02:44PM -0500, Perry Myers wrote: > > Daire Byrne wrote: > >> Okay, thanks. Maybe the press release is talking more about the > >> Qumranet solutions that were acquired. Are there plans to give oVirt > >> the ability to schedule and migrate machines based on load etc. or will > >> this be managed by a separate system (via libvirt)? Is oVirt only > >> supposed to be used for used the initial provisioning? > > > > There are plans to provide migration based on load in oVirt. I don't > > think that'll be part of core libvirt, but it will be part of oVirt. > > oVirt is not just for initial provisioning. It's about managing the > > guest through it's entire lifecycle, monitoring it, tracking state and > > eventually neat things like chargeback. Hugh is heading up this effort, > > so I'll let him elaborate :) > > oVirt server, as part of the cloud management bits we are now building > into it, will be able to automatically migrate machines to guarantee > SLA (for example). I wouldn't expect to see that feature before ~6 > months from now however (although patches are, as always, welcome...) From dpierce at redhat.com Wed Mar 4 15:57:19 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 4 Mar 2009 10:57:19 -0500 Subject: [Ovirt-devel] [PATCH node] Disable o-c-storage on systems booted from local storage. Message-ID: <1236182239-22547-1-git-send-email-dpierce@redhat.com> NOTE: This patch is reworked to remove the Partitioning option from the o-c-setup menu if booted from disk, as well as disabling o-c-storage directly. Removes the o-c-storage item from the o-c-setup menu if booted from local storage. Also, if the admin runs o-c-storage directly the script will exit with an error. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-boot-wrapper | 2 +- scripts/ovirt-config-setup | 21 ++++++++++++++++++--- scripts/ovirt-config-storage | 5 +++++ scripts/ovirt-functions | 12 ++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper index 4ac742a..5264bed 100755 --- a/scripts/ovirt-config-boot-wrapper +++ b/scripts/ovirt-config-boot-wrapper @@ -15,7 +15,7 @@ Please ensure that you have configured the local storage \n\ and networking correctly on the previous menu before \n\ continuing." printf "\n\n" - read -p "Do you wish to continue? (Y|N)? " + read -p "Do you wish to continue (Y/n)? " r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]') if [ "$r" == "Y" ]; then mount_live \ diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup index 8db8ffd..ccbb27e 100755 --- a/scripts/ovirt-config-setup +++ b/scripts/ovirt-config-setup @@ -13,11 +13,26 @@ CONTINUE="Continue Stateless Boot" declare -a OPTIONS +can_include_item() { + if is_booted_from_local_disk; then + if [[ $1 =~ Partitioning ]]; then + return 0 + else + return 1 + fi + else + return 1 + fi +} + for cfg in $CONFIG_DIR/*; do label=$(basename "$cfg") - # Assume label is actually XX_Some Text. So strip of the first 3 characters - label=${label:3} - OPTIONS[${#OPTIONS[*]}]="$label" + can_include_item "$label" + if [ 1 -eq $? ]; then + # Assume label is actually XX_Some Text. So strip of the first 3 characters + label=${label:3} + OPTIONS[${#OPTIONS[*]}]="$label" + fi done OPTIONS[${#OPTIONS[*]}]="$DEBUG_SHELL" OPTIONS[${#OPTIONS[*]}]="$CONTINUE" diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index c9225f7..d8c93e0 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -15,6 +15,11 @@ die() { warn "$*"; exit 1; } trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +# check that we're not booted from local storage; if so then exit with an error +if is_booted_from_local_disk; then + die "You cannot configure storage on a running system. Please boot from CD/USB to configure local storage." +fi + default_overcommit=0.5 default_boot_size=50 diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 6ee8940..5573487 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -92,6 +92,18 @@ is_auto_install() { fi } +# return 1 if booted from local disk +# return 0 if booted from other media +is_booted_from_local_disk() { + grep \/dev\/HostVG\/Root /proc/cmdline > /dev/null + + if [ $? -eq 0 ]; then + return 0 + else + return 1 + fi +} + # was firstboot menu already shown? # state is stored in persistent config partition is_firstboot() { -- 1.6.0.6 From jason.guiditta at gmail.com Wed Mar 4 15:50:52 2009 From: jason.guiditta at gmail.com (Jason Guiditta) Date: Wed, 4 Mar 2009 10:50:52 -0500 Subject: [Ovirt-devel] [PATCH server] cobbler-import cleanup part 1 In-Reply-To: <1235748834-23269-1-git-send-email-jboggs@redhat.com> References: <1235748834-23269-1-git-send-email-jboggs@redhat.com> Message-ID: ACK, this worked fine for me On Fri, Feb 27, 2009 at 10:33 AM, Joey Boggs wrote: > This part moves part of the sed functionality from cobbler-import directly > into the cobbler manifest for better control of the configuration. > Also removes some of the unnecessary lines that are echoed back that are > not even visible to the user. > > --- > installer/modules/ovirt/files/cobbler-import | 11 ----------- > installer/modules/ovirt/manifests/cobbler.pp | 22 ++++++++++++++++++++++ > 2 files changed, 22 insertions(+), 11 deletions(-) > > diff --git a/installer/modules/ovirt/files/cobbler-import > b/installer/modules/ovirt/files/cobbler-import > index d516c68..752bd85 100644 > --- a/installer/modules/ovirt/files/cobbler-import > +++ b/installer/modules/ovirt/files/cobbler-import > @@ -61,21 +61,10 @@ cobbler system add --netboot-enabled=1 > --profile=oVirt-Node-$node_arch \ > cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ > --name=node5 --mac=00:16:3e:12:34:59 --kopts="ovirt_init=scsi" > > -# TODO use Augeas 0.3.0 Inifile lens > -sed -i -e "s/^module = authn_denyall.*/module = authn_configfile/" \ > - /etc/cobbler/modules.conf > -sed -i -e "s/^server:.*/server: '192.168.50.2'/" \ > - -e "s/^next_server:.*/next_server: '192.168.50.2'/" \ > - /etc/cobbler/settings > sed -i -e '/kernel /a \\tIPAPPEND 2' /etc/cobbler/pxe/pxesystem.template > sed -i -e "s/^ONTIMEOUT.*/ONTIMEOUT oVirt-Node-$node_arch/" \ > /etc/cobbler/pxe/pxedefault.template > > service cobblerd restart > cobbler sync > -cobbler list > > -set +x > -set +e > -echo "Add new oVirt Nodes as Cobbler systems to make them PXE boot oVirt > Node image directly." > -echo "oVirt-Node-$node_arch is also default boot option in Cobbler menu" > diff --git a/installer/modules/ovirt/manifests/cobbler.pp > b/installer/modules/ovirt/manifests/cobbler.pp > index ed9f3c9..89b22b1 100644 > --- a/installer/modules/ovirt/manifests/cobbler.pp > +++ b/installer/modules/ovirt/manifests/cobbler.pp > @@ -121,7 +121,29 @@ class cobbler::bundled { > require => [File["/usr/sbin/cobbler-import"], > > Service["cobblerd"],Package[ovirt-node-image],Package[livecd-tools]] > } > + file_replacement{"settings_auth_module": > + file => "/etc/cobbler/settings", > + pattern => "module = authn_denyall", > + replacement => "module = authn_configfile", > + require => Package[cobbler], > + notify => Service[cobblerd] > + } > + > + file_replacement{"settings_server": > + file => "/etc/cobbler/settings", > + pattern => "server: 127.0.0.1", > + replacement => "server: $mgmt_ipaddr", > + require => Package[cobbler], > + notify => Service[cobblerd] > + } > > + file_replacement{"settings_next_server": > + file => "/etc/cobbler/settings", > + pattern => "next_server: 127.0.0.1", > + replacement => "next_server: $mgmt_ipaddr", > + require => Package[cobbler], > + notify => Service[cobblerd] > + } > > } > > -- > 1.6.0.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jboggs at redhat.com Wed Mar 4 16:04:12 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 04 Mar 2009 11:04:12 -0500 Subject: [Ovirt-devel] Re: [PATCH server] remove selinux disable, selinux is handled in the installer configurator now, required libvirt, but not disable it In-Reply-To: <1235594928-13163-1-git-send-email-jboggs@redhat.com> References: <1235594928-13163-1-git-send-email-jboggs@redhat.com> Message-ID: <49AEA67C.8080808@redhat.com> Joey Boggs wrote: > This removes an unnecessary selinux disable in the installer, the configuration now handles selinux and sets to permissive. Also libvirt was being disabled, we should not care if it's running or not. dnsmasq still works with it enabled. > > --- > installer/modules/ovirt/manifests/ovirt.pp | 8 +------- > 1 files changed, 1 insertions(+), 7 deletions(-) > > diff --git a/installer/modules/ovirt/manifests/ovirt.pp b/installer/modules/ovirt/manifests/ovirt.pp > index 960f4db..e177015 100644 > --- a/installer/modules/ovirt/manifests/ovirt.pp > +++ b/installer/modules/ovirt/manifests/ovirt.pp > @@ -109,11 +109,6 @@ class ovirt::setup { > notify => Service[qpidd] > } > > - exec { "disable_selinux" : > - command => "/usr/sbin/lokkit --selinux=disabled", > - require => Package["ovirt-server"] > - } > - > service {"httpd" : > enable => true, > require => Package[httpd], > @@ -121,8 +116,7 @@ class ovirt::setup { > } > > service {"libvirt" : > - enable => false, > - require => Package[libvirt], > + require => Package[libvirt] > } > > service {"ovirt-host-browser" : > pushed From jboggs at redhat.com Wed Mar 4 16:04:29 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 04 Mar 2009 11:04:29 -0500 Subject: [Ovirt-devel] Re: [PATCH server] cobbler-import cleanup part 1 In-Reply-To: <1235748834-23269-1-git-send-email-jboggs@redhat.com> References: <1235748834-23269-1-git-send-email-jboggs@redhat.com> Message-ID: <49AEA68D.50905@redhat.com> Joey Boggs wrote: > This part moves part of the sed functionality from cobbler-import directly into the cobbler manifest for better control of the configuration. > Also removes some of the unnecessary lines that are echoed back that are not even visible to the user. > > --- > installer/modules/ovirt/files/cobbler-import | 11 ----------- > installer/modules/ovirt/manifests/cobbler.pp | 22 ++++++++++++++++++++++ > 2 files changed, 22 insertions(+), 11 deletions(-) > > diff --git a/installer/modules/ovirt/files/cobbler-import b/installer/modules/ovirt/files/cobbler-import > index d516c68..752bd85 100644 > --- a/installer/modules/ovirt/files/cobbler-import > +++ b/installer/modules/ovirt/files/cobbler-import > @@ -61,21 +61,10 @@ cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ > cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ > --name=node5 --mac=00:16:3e:12:34:59 --kopts="ovirt_init=scsi" > > -# TODO use Augeas 0.3.0 Inifile lens > -sed -i -e "s/^module = authn_denyall.*/module = authn_configfile/" \ > - /etc/cobbler/modules.conf > -sed -i -e "s/^server:.*/server: '192.168.50.2'/" \ > - -e "s/^next_server:.*/next_server: '192.168.50.2'/" \ > - /etc/cobbler/settings > sed -i -e '/kernel /a \\tIPAPPEND 2' /etc/cobbler/pxe/pxesystem.template > sed -i -e "s/^ONTIMEOUT.*/ONTIMEOUT oVirt-Node-$node_arch/" \ > /etc/cobbler/pxe/pxedefault.template > > service cobblerd restart > cobbler sync > -cobbler list > > -set +x > -set +e > -echo "Add new oVirt Nodes as Cobbler systems to make them PXE boot oVirt Node image directly." > -echo "oVirt-Node-$node_arch is also default boot option in Cobbler menu" > diff --git a/installer/modules/ovirt/manifests/cobbler.pp b/installer/modules/ovirt/manifests/cobbler.pp > index ed9f3c9..89b22b1 100644 > --- a/installer/modules/ovirt/manifests/cobbler.pp > +++ b/installer/modules/ovirt/manifests/cobbler.pp > @@ -121,7 +121,29 @@ class cobbler::bundled { > require => [File["/usr/sbin/cobbler-import"], > Service["cobblerd"],Package[ovirt-node-image],Package[livecd-tools]] > } > + file_replacement{"settings_auth_module": > + file => "/etc/cobbler/settings", > + pattern => "module = authn_denyall", > + replacement => "module = authn_configfile", > + require => Package[cobbler], > + notify => Service[cobblerd] > + } > + > + file_replacement{"settings_server": > + file => "/etc/cobbler/settings", > + pattern => "server: 127.0.0.1", > + replacement => "server: $mgmt_ipaddr", > + require => Package[cobbler], > + notify => Service[cobblerd] > + } > > + file_replacement{"settings_next_server": > + file => "/etc/cobbler/settings", > + pattern => "next_server: 127.0.0.1", > + replacement => "next_server: $mgmt_ipaddr", > + require => Package[cobbler], > + notify => Service[cobblerd] > + } > > } > > pushed From jboggs at redhat.com Wed Mar 4 16:04:39 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 04 Mar 2009 11:04:39 -0500 Subject: [Ovirt-devel] Re: [PATCH server] reword selinux disable/permissive prompt In-Reply-To: <1236007156-5672-1-git-send-email-jboggs@redhat.com> References: <1236007156-5672-1-git-send-email-jboggs@redhat.com> Message-ID: <49AEA697.502@redhat.com> Joey Boggs wrote: > Rewords the selinux prompt to permissive rather than disable > > --- > installer/bin/ovirt-installer | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer > index cb0bf15..8201d01 100755 > --- a/installer/bin/ovirt-installer > +++ b/installer/bin/ovirt-installer > @@ -91,12 +91,12 @@ end > if File.exist?("/usr/sbin/selinuxenabled") > sestatus = system "/usr/sbin/selinuxenabled" > if sestatus == true > - selinux_disable = prompt_yes_no("SELinux enabled, would you like to disable it?", :default => "y") > - if selinux_disable == "n" > - @cli.say("Please disable selinux prior to running the installer again") > + selinux_permissive = prompt_yes_no("SELinux enforing, would you like to set it permissive?", :default => "y") > + if selinux_permissive == "n" > + @cli.say("SELinux must be permissive or disabled prior to running the installer again") > exit(0) > else > - @cli.say("Disabling SELinux") > + @cli.say("Setting SELinux permissive") > system "/usr/sbin/lokkit --selinux=permissive" > system "/usr/sbin/setenforce 0" > end > pushed From slinabery at redhat.com Wed Mar 4 18:22:25 2009 From: slinabery at redhat.com (Steve Linabery) Date: Wed, 4 Mar 2009 12:22:25 -0600 Subject: [Ovirt-devel] Re: [PATCH server] reword selinux disable/permissive prompt In-Reply-To: <49AEA697.502@redhat.com> References: <1236007156-5672-1-git-send-email-jboggs@redhat.com> <49AEA697.502@redhat.com> Message-ID: <20090304182225.GB23365@redhat.com> On Wed, Mar 04, 2009 at 11:04:39AM -0500, Joey Boggs wrote: > Joey Boggs wrote: >> Rewords the selinux prompt to permissive rather than disable >> >> --- >> installer/bin/ovirt-installer | 8 ++++---- >> 1 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer >> index cb0bf15..8201d01 100755 >> --- a/installer/bin/ovirt-installer >> +++ b/installer/bin/ovirt-installer >> @@ -91,12 +91,12 @@ end >> if File.exist?("/usr/sbin/selinuxenabled") >> sestatus = system "/usr/sbin/selinuxenabled" >> if sestatus == true >> - selinux_disable = prompt_yes_no("SELinux enabled, would you like to disable it?", :default => "y") >> - if selinux_disable == "n" >> - @cli.say("Please disable selinux prior to running the installer again") >> + selinux_permissive = prompt_yes_no("SELinux enforing, would you like to set it permissive?", :default => "y") >> + if selinux_permissive == "n" >> + @cli.say("SELinux must be permissive or disabled prior to running the installer again") >> exit(0) >> else >> - @cli.say("Disabling SELinux") >> + @cli.say("Setting SELinux permissive") >> system "/usr/sbin/lokkit --selinux=permissive" >> system "/usr/sbin/setenforce 0" >> end >> > pushed > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel this introduces a typo ("enforing"). s From jboggs at redhat.com Wed Mar 4 18:23:58 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 04 Mar 2009 13:23:58 -0500 Subject: [Ovirt-devel] Re: [PATCH server] reword selinux disable/permissive prompt In-Reply-To: <20090304182225.GB23365@redhat.com> References: <1236007156-5672-1-git-send-email-jboggs@redhat.com> <49AEA697.502@redhat.com> <20090304182225.GB23365@redhat.com> Message-ID: <49AEC73E.9050408@redhat.com> Steve Linabery wrote: > On Wed, Mar 04, 2009 at 11:04:39AM -0500, Joey Boggs wrote: > >> Joey Boggs wrote: >> >>> Rewords the selinux prompt to permissive rather than disable >>> >>> --- >>> installer/bin/ovirt-installer | 8 ++++---- >>> 1 files changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer >>> index cb0bf15..8201d01 100755 >>> --- a/installer/bin/ovirt-installer >>> +++ b/installer/bin/ovirt-installer >>> @@ -91,12 +91,12 @@ end >>> if File.exist?("/usr/sbin/selinuxenabled") >>> sestatus = system "/usr/sbin/selinuxenabled" >>> if sestatus == true >>> - selinux_disable = prompt_yes_no("SELinux enabled, would you like to disable it?", :default => "y") >>> - if selinux_disable == "n" >>> - @cli.say("Please disable selinux prior to running the installer again") >>> + selinux_permissive = prompt_yes_no("SELinux enforing, would you like to set it permissive?", :default => "y") >>> + if selinux_permissive == "n" >>> + @cli.say("SELinux must be permissive or disabled prior to running the installer again") >>> exit(0) >>> else >>> - @cli.say("Disabling SELinux") >>> + @cli.say("Setting SELinux permissive") >>> system "/usr/sbin/lokkit --selinux=permissive" >>> system "/usr/sbin/setenforce 0" >>> end >>> >>> >> pushed >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> > > this introduces a typo ("enforing"). > > s > fixed/pushed From jboggs at redhat.com Wed Mar 4 22:00:35 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 4 Mar 2009 17:00:35 -0500 Subject: [Ovirt-devel] [PATCH appliance] add livecd-tools and ovirt-node-image-pxe dependency for appliance Message-ID: <1236204035-11974-1-git-send-email-jboggs@redhat.com> --- ovirt-appliance.ks | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/ovirt-appliance.ks b/ovirt-appliance.ks index 202babc..5919064 100644 --- a/ovirt-appliance.ks +++ b/ovirt-appliance.ks @@ -50,9 +50,11 @@ cobbler qemu-img ovirt-release ovirt-node-image +ovirt-node-image-pxe ovirt-server ovirt-server-installer lokkit +livecd-tools %post # cleanup rpmdb to allow non-matching host and chroot RPM versions -- 1.6.0.6 From apevec at gmail.com Wed Mar 4 23:30:13 2009 From: apevec at gmail.com (Alan Pevec) Date: Thu, 5 Mar 2009 00:30:13 +0100 Subject: [Ovirt-devel] [PATCH appliance] add livecd-tools and ovirt-node-image-pxe dependency for appliance In-Reply-To: <1236204035-11974-1-git-send-email-jboggs@redhat.com> References: <1236204035-11974-1-git-send-email-jboggs@redhat.com> Message-ID: <2be7262f0903041530l362fd0e6mda3bef2ef26119c@mail.gmail.com> > ?ovirt-node-image > +ovirt-node-image-pxe > ?ovirt-server > ?ovirt-server-installer > ?lokkit > +livecd-tools should be just: -ovirt-node-image +ovirt-node-image-pxe I've just pushed ovirt-node-image.spec fix which adds livecd-tools dep to ovirt-node-image and -pxe subpkg already requires main o-n-i From sseago at redhat.com Thu Mar 5 00:13:30 2009 From: sseago at redhat.com (Scott Seago) Date: Wed, 04 Mar 2009 19:13:30 -0500 Subject: [Ovirt-devel] [PATCH server] updated appliance configuration for iscsi/nfs support In-Reply-To: <1235776552-1100-1-git-send-email-jboggs@redhat.com> References: <1235776552-1100-1-git-send-email-jboggs@redhat.com> Message-ID: <49AF192A.3050507@redhat.com> Joey Boggs wrote: > This adds back in appliance iscsi/nfs functionality that has been missing since the switch to the new installer. Adds an appliance::bundled puppet class that is only used by the appliance installation configuration. > --- > .../appliances/ovirt-appliance/ovirt-appliance.pp | 1 + > .../modules/ovirt/files/ovirt-appliance-setup | 4 + > installer/modules/ovirt/files/ovirt-storage | 73 +++++++++ > installer/modules/ovirt/manifests/appliance.pp | 160 ++++++++++++++++++++ > installer/modules/ovirt/manifests/init.pp | 2 +- > 5 files changed, 239 insertions(+), 1 deletions(-) > create mode 100755 installer/modules/ovirt/files/ovirt-appliance-setup > create mode 100755 installer/modules/ovirt/files/ovirt-storage > create mode 100644 installer/modules/ovirt/manifests/appliance.pp > > diff --git a/installer/appliances/ovirt-appliance/ovirt-appliance.pp b/installer/appliances/ovirt-appliance/ovirt-appliance.pp > index 125edf9..ffeceba 100644 > --- a/installer/appliances/ovirt-appliance/ovirt-appliance.pp > +++ b/installer/appliances/ovirt-appliance/ovirt-appliance.pp > @@ -44,3 +44,4 @@ include tftp::bundled > include postgres::bundled > include freeipa::bundled > include ovirt::setup > +include appliance::bundled > diff --git a/installer/modules/ovirt/files/ovirt-appliance-setup b/installer/modules/ovirt/files/ovirt-appliance-setup > new file mode 100755 > index 0000000..e3ab63d > --- /dev/null > +++ b/installer/modules/ovirt/files/ovirt-appliance-setup > @@ -0,0 +1,4 @@ > +for i in `seq 1 5`; do; /bin/dd if=/dev/null of=/ovirtiscsi/iSCSI$i bs=1 count=1 seek=5G; done" > + > +for i in `seq 1 5`; do; /bin/dd if=/dev/zero of=/ovirtnfs/disk$i.dsk bs=1 count=1 seek=5G;done", > + > OK so I finally got my appliance up. The storage pools were there but the above-referenced files weren't created. There seem to be two problems here: 1) nothing actually calls this script that I can see. The puppet manifest just creates the file 2) the script fails to run when I attempted it manually as it's got syntax errors. Scott > diff --git a/installer/modules/ovirt/files/ovirt-storage b/installer/modules/ovirt/files/ovirt-storage > new file mode 100755 > index 0000000..e923500 > --- /dev/null > +++ b/installer/modules/ovirt/files/ovirt-storage > @@ -0,0 +1,73 @@ > +#!/bin/bash > +# > +# ovirt-storage Set up storage for oVirt Server Appliance > +# > +# chkconfig: 3 96 4 > +# description: oVirt Appliance Storage Services > +# > + > +# Source functions library > +. /etc/init.d/functions > +TARGET_ID=32101 > + > +prog="ovirt-storage" > +num_iscsi_luns=5 > + > +start() { > + echo -n "Starting $prog: " > + > + # Set up the fake iscsi target > + tgtadm --lld iscsi --op new --mode target --tid $TARGET_ID \ > + -T ovirtpriv:storage > + > + # > + # Now associate them to the LVs > + # > + for i in `seq 1 $num_iscsi_luns` ; do > + tgtadm --lld iscsi --op new --mode logicalunit --tid $TARGET_ID \ > + --lun $i -b /ovirtiscsi/iSCSI$i > + done > + > + # > + # Now make them available > + # > + tgtadm --lld iscsi --op bind --mode target --tid $TARGET_ID -I ALL > + > + echo_success > + echo > +} > + > +stop() { > + echo -n "Stopping $prog: " > + > + # stop access to the iscsi target > + tgtadm --lld iscsi --op unbind --mode target --tid $TARGET_ID -I ALL > + > + # unbind the LUNs > + for i in `seq 1 $num_iscsi_luns` ; do > + tgtadm --lld iscsi --op delete --mode logicalunit --tid $TARGET_ID --lun $i > + done > + > + # shutdown the target > + tgtadm --lld iscsi --op delete --mode target --tid $TARGET_ID > + > + echo_success > + echo > +} > + > +case "$1" in > + start) > + start > + ;; > + stop) > + stop > + ;; > + restart) > + stop > + start > + ;; > + *) > + echo "Usage: $0 {start|stop|restart}" > + exit 2 > +esac > + > diff --git a/installer/modules/ovirt/manifests/appliance.pp b/installer/modules/ovirt/manifests/appliance.pp > new file mode 100644 > index 0000000..9579837 > --- /dev/null > +++ b/installer/modules/ovirt/manifests/appliance.pp > @@ -0,0 +1,160 @@ > +#-- > +# Copyright (C) 2008 Red Hat Inc. > +# > +# This library is free software; you can redistribute it and/or > +# modify it under the terms of the GNU Lesser General Public > +# License as published by the Free Software Foundation; either > +# version 2.1 of the License, or (at your option) any later version. > +# > +# This library is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +# Lesser General Public License for more details. > +# > +# You should have received a copy of the GNU Lesser General Public > +# License along with this library; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > +# > +# Author: Joey Boggs > +#-- > + > +class appliance::bundled { > + > +$nfs_changes = [ > + "set /files/etc/sysconfig/nfs/MOUNTD_PORT 892" > +] > + > +augeas {"nfs_config": > + changes => $nfs_changes, > + notify => Service["nfs"] > +} > + > +$nfslock_changes = [ > + "set /files/etc/sysconfig/nfs/LOCKD_TCPPORT 32803", > + "set /files/etc/sysconfig/nfs/LOCKD_UDPPORT 32769", > + "set /files/etc/sysconfig/nfs/STATD_PORT 662" > +] > + > +augeas {"nfslock_config": > + changes => $nfslock_changes, > + notify => Service["nfslock"] > +} > + > +#file {"/boot/grub/splash.xpm.gz": > +# source => "puppet:///ovirt/ovirt-splash.xpm.gz" > +#} > + > +firewall_rule {"tgtd": destination_port => '3260'} > +firewall_rule {"nfsd": destination_port => '2049'} > +firewall_rule {"rpcbind": destination_port => '111'} > +firewall_rule {"rpcbind-udp": destination_port => '111', protocol => 'udp'} > +firewall_rule {"rpc.mountd": destination_port => '892'} > +firewall_rule {"rpc.mountd-udp": destination_port => '892', protocol => 'udp'} > +firewall_rule {"rpc.statd": destination_port => '662'} > +firewall_rule {"rpc.statd-udp": destination_port => '662', protocol => 'udp'} > + > +service {"nfs": > + ensure => "running", > + enable => true, > + require => Service["network"] > +} > + > +service {"nfslock": > + ensure => "running", > + enable => true > +} > + > +service {"network": > + ensure => "running", > + enable => true > +} > + > +file{"/mnt/data/ovirtiscsi": > + ensure => directory > +} > + > +file{"/ovirtiscsi": > + ensure => directory > +} > + > +file{"/ovirtnfs": > + ensure => directory > +} > + > +file{"/mnt/data/ovirtnfs": > + ensure => directory > +} > + > +mount{"/ovirtiscsi": > + atboot => true, > + ensure => mounted, > + fstype => bind, > + options => bind, > + device => "/mnt/data/ovirtiscsi", > + require => [File["/mnt/data/ovirtiscsi"],File["/ovirtiscsi"]] > +} > + > +mount{"/ovirtnfs": > + atboot => true, > + ensure => mounted, > + fstype => bind, > + options => bind, > + device => "/mnt/data/ovirtnfs", > + require => [File["/mnt/data/ovirtnfs"],File["/ovirtnfs"]] > +} > + > +file {"/usr/sbin/ovirt-appliance-setup": > + source => "puppet:///ovirt/ovirt-appliance-setup", > + mode => 755 > +} > + > +single_exec{"ovirtnfs_export": > + command => '/bin/echo "/ovirtnfs 192.168.50.0/24(rw,no_root_squash)" >> /etc/exports', > + notify => Service[nfs] > +} > + > +file{"/mnt/data/cobblernfs": > + ensure => directory > +} > + > +file{"/cobblernfs": > + ensure => directory > +} > + > +mount{"/cobblernfs": > + atboot => true, > + ensure => mounted, > + fstype => bind, > + options => bind, > + device => "/mnt/data/ovirtnfs", > + require => [File["/mnt/data/ovirtnfs"],File["/cobblernfs"]] > +} > + > +single_exec{"cobbler_nfs_export": > + command => '/bin/echo "/cobblernfs 192.168.50.0/24(rw,no_root_squash)" >> /etc/exports', > + notify => Service[nfs], > + require => Mount["/cobblernfs"] > +} > + > + > +file {"/etc/init.d/ovirt-storage": > + source => "puppet:///ovirt/ovirt-storage", > + mode => 755 > +} > + > +service {"ovirt-storage": > + ensure => "running", > + enable => true, > + require => [File["/etc/init.d/ovirt-storage"],File["/usr/sbin/ovirt-appliance-setup"]] > +} > + > +package{"scsi-target-utils": > + ensure => installed > +} > + > +package{"iscsi-initiator-utils": > + ensure => installed > +} > + > + > +} > diff --git a/installer/modules/ovirt/manifests/init.pp b/installer/modules/ovirt/manifests/init.pp > index 87f6832..a09cea1 100644 > --- a/installer/modules/ovirt/manifests/init.pp > +++ b/installer/modules/ovirt/manifests/init.pp > @@ -6,4 +6,4 @@ import "ovirt/freeipa.pp" > import "ovirt/ovirt.pp" > import "ovirt/postgres.pp" > import "appliance_base/single_exec.pp" > - > +import "ovirt/appliance.pp" > From apevec at gmail.com Thu Mar 5 00:43:03 2009 From: apevec at gmail.com (Alan Pevec) Date: Thu, 5 Mar 2009 01:43:03 +0100 Subject: [Ovirt-devel] [PATCH node] Disable o-c-storage on systems booted from local storage. In-Reply-To: <1236182239-22547-1-git-send-email-dpierce@redhat.com> References: <1236182239-22547-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0903041643t7712b4abw1cc1bf32f4c47c2c@mail.gmail.com> ack and pushed with some edits to align with weird shell logic (0 return code = true) > - ? ?read -p "Do you wish to continue? (Y|N)? " > + ? ?read -p "Do you wish to continue (Y/n)? " pushed this as a separate cosmetic patch From apevec at gmail.com Thu Mar 5 01:30:52 2009 From: apevec at gmail.com (Alan Pevec) Date: Thu, 5 Mar 2009 02:30:52 +0100 Subject: [Ovirt-devel] [PATCH node-image] An attempt to overcome the lack of job control WRT pinging. In-Reply-To: <20090303182517.GE4383@mcpierce-laptop.rdu.redhat.com> References: <1236093954-32044-1-git-send-email-dpierce@redhat.com> <2be7262f0903030845l2d8b0b2au94c29f0fd2d14aa@mail.gmail.com> <20090303182517.GE4383@mcpierce-laptop.rdu.redhat.com> Message-ID: <2be7262f0903041730k16c017f2j333e7717a7b383ba@mail.gmail.com> On Tue, Mar 3, 2009 at 7:25 PM, Darryl L. Pierce wrote: > On Tue, Mar 03, 2009 at 05:45:15PM +0100, Alan Pevec wrote: >> On Tue, Mar 3, 2009 at 4:25 PM, Darryl L. Pierce wrote: >> > +# root's bash profile >> > +cat >> /root/.bashrc <> >> Needs to be /.bashrc - this workaround is needed only for emergency >> shell (Shell option in firstboot menu). >> When started from init, homedir is not set, so /root/.bashrc is not sourced. > > I've tested this and it does source /root/.bashrc even thought $HOME is > undefined. right, works for F10 ack and pushed From jason.guiditta at gmail.com Thu Mar 5 18:20:09 2009 From: jason.guiditta at gmail.com (Jason Guiditta) Date: Thu, 5 Mar 2009 13:20:09 -0500 Subject: [Ovirt-devel] [PATCH server] Fix taskomatic qpid reconnect In-Reply-To: <1236121250-3805-1-git-send-email-imain@redhat.com> References: <1236121250-3805-1-git-send-email-imain@redhat.com> Message-ID: ACK, taskomatic seems to still work fine after this patch On Tue, Mar 3, 2009 at 6:00 PM, Ian Main wrote: > This patch uses the managed connection arrangement in the qpid library > which uses a separate thread to manage the qpid connection. This is > the same as was done for dbomatic in the previous patch. > > Signed-off-by: Ian Main > --- > src/task-omatic/taskomatic.rb | 58 > +++++++++++++--------------------------- > 1 files changed, 19 insertions(+), 39 deletions(-) > > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index 8d35692..eb8e2ae 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -60,9 +60,6 @@ class TaskOmatic > @sleeptime = 2 > @nth_host = 0 > > - @session = Qpid::Qmf::Session.new() > - @broker = nil > - > do_daemon = true > > opts = OptionParser.new do |opts| > @@ -98,43 +95,31 @@ class TaskOmatic > @logger = Logger.new(STDERR) > end > > + ensure_credentials > > - # this has to be after daemonizing now because it could take a LONG > time to > - # actually connect if qpidd isn't running yet etc. > - qpid_ensure_connected > - > - end > - > - def qpid_ensure_connected() > - > - return if @broker and @broker.connected? > - > - sleepy = 2 > - > - while true do > - begin > - server, port = get_srv('qpidd', 'tcp') > - raise "Unable to determine qpid server from DNS SRV record" if not > server > + server, port = nil > + (1..4).each do > + server, port = get_srv('qpidd', 'tcp') > + break if server > + @logger.error "Unable to determine qpid server from DNS SRV record" > if not server > + sleep(10) > + end > > - @broker = @session.add_broker("amqp://#{server}:#{port}", > :mechanism => 'GSSAPI') > + @session = Qpid::Qmf::Session.new(:manage_connections => true) > + @logger.info "Connecting to amqp://#{server}:#{port}" > + @broker = @session.add_broker("amqp://#{server}:#{port}", :mechanism > => 'GSSAPI') > > - # Connection succeeded, go about our business. > - @logger.info "Connected to amqp://#{server}:#{port}" > - return > + end > > - rescue Exception => msg > - @logger.error "Error connecting to qpidd: #{msg}" > - @logger.error msg.backtrace > - end > - sleep(sleepy) > - sleepy *= 2 > - sleepy = 120 if sleepy > 120 > + def ensure_credentials() > + get_credentials('qpidd') > + get_credentials('libvirt') > > - begin > - # Could also be a credentials problem? Try to get them again.. > + Thread.new do > + while true do > + sleep(3600) > get_credentials('qpidd') > - rescue Exception => msg > - @logger.error "Error getting qpidd credentials: #{msg}" > + get_credentials('libvirt') > end > end > end > @@ -804,8 +789,6 @@ class TaskOmatic > end > end > > - qpid_ensure_connected > - > tasks.each do |task| > > task.time_started = Time.now > @@ -867,9 +850,6 @@ class TaskOmatic > end > end > > -get_credentials('libvirt') > -get_credentials('qpidd') > - > taskomatic = TaskOmatic.new() > taskomatic.mainloop() > > -- > 1.6.0.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.guiditta at gmail.com Thu Mar 5 18:20:52 2009 From: jason.guiditta at gmail.com (Jason Guiditta) Date: Thu, 5 Mar 2009 13:20:52 -0500 Subject: [Ovirt-devel] [PATCH server] Fix dbomatic qpid reconnect In-Reply-To: <1236120568-3390-1-git-send-email-imain@redhat.com> References: <1236120568-3390-1-git-send-email-imain@redhat.com> Message-ID: ACK, dbomatic seems to still work fine after this patch. On Tue, Mar 3, 2009 at 5:49 PM, Ian Main wrote: > This patch uses the managed connection arrangement in the qpid library > which uses a separate thread to manage the qpid connection; a much > better way to go. > > Signed-off-by: Ian Main > --- > src/db-omatic/db_omatic.rb | 55 > ++++++++++++++----------------------------- > 1 files changed, 18 insertions(+), 37 deletions(-) > > diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb > index 6dc02fb..96202f4 100755 > --- a/src/db-omatic/db_omatic.rb > +++ b/src/db-omatic/db_omatic.rb > @@ -40,7 +40,6 @@ class DbOmatic < Qpid::Qmf::Console > @cached_objects = {} > @heartbeats = {} > @broker = nil > - @session = Qpid::Qmf::Session.new(:console => self) > > do_daemon = true > > @@ -74,49 +73,33 @@ class DbOmatic < Qpid::Qmf::Console > end > @logger.info "dbomatic started." > > - get_credentials('qpidd') > + ensure_credentials > > database_connect > - qpid_ensure_connected > - > - end > - > - > - # FIXME: This should move into a library but I think we'll need > - # to make some sort of singleton class for these applications so we > can > - # share the logger and qpid variables etc. It's getting to show > itself > - # as a problem but I don't want to go crazy right now as we're > supposed > - # to be in freeze. :) > - def qpid_ensure_connected() > - > - return if @broker and @broker.connected? > > - sleepy = 2 > + server, port = nil > + (1..4).each do > + server, port = get_srv('qpidd', 'tcp') > + break if server > + @logger.error "Unable to determine qpid server from DNS SRV > record" if not server > + sleep(10) > + end > > - while true do > - begin > - server, port = get_srv('qpidd', 'tcp') > - raise "Unable to determine qpid server from DNS SRV > record" if not server > + raise "Unable to determine server and port from DNS SRV records" > if not server > > - @broker = @session.add_broker("amqp://#{server}:#{port}", > :mechanism => 'GSSAPI') > + @logger.info "Connecting to amqp://#{server}:#{port}" > + @session = Qpid::Qmf::Session.new(:console => self, > :manage_connections => true) > + @broker = @session.add_broker("amqp://#{server}:#{port}", > :mechanism => 'GSSAPI') > + end > > - # Connection succeeded, go about our business. > - @logger.info "Connected to amqp://#{server}:#{port}" > - return > > - rescue Exception => msg > - @logger.error "Error connecting to qpidd: #{msg}" > - @logger.error msg.backtrace > - end > - sleep(sleepy) > - sleepy *= 2 > - sleepy = 120 if sleepy > 120 > + def ensure_credentials() > + get_credentials('qpidd') > > - begin > - # Could also be a credentials problem? Try to get them > again.. > + Thread.new do > + while true do > + sleep(3600) > get_credentials('qpidd') > - rescue Exception => msg > - @logger.error "Error getting qpidd credentials: #{msg}" > end > end > end > @@ -370,8 +353,6 @@ class DbOmatic < Qpid::Qmf::Console > while true > sleep(5) > > - qpid_ensure_connected > - > synchronize do > # Get seconds from the epoch > t = Time.new.to_i > -- > 1.6.0.6 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jboggs at redhat.com Thu Mar 5 20:29:02 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 5 Mar 2009 15:29:02 -0500 Subject: [Ovirt-devel] [PATCH] add back in appliance nfs/iscsi configuration Message-ID: <1236284942-30078-1-git-send-email-jboggs@redhat.com> --- .../appliances/ovirt-appliance/ovirt-appliance.pp | 1 + .../modules/ovirt/files/ovirt-appliance-setup | 4 + installer/modules/ovirt/files/ovirt-storage | 73 ++++++++++ installer/modules/ovirt/manifests/appliance.pp | 152 ++++++++++++++++++++ installer/modules/ovirt/manifests/init.pp | 2 +- 5 files changed, 231 insertions(+), 1 deletions(-) create mode 100644 installer/modules/ovirt/files/ovirt-appliance-setup create mode 100644 installer/modules/ovirt/files/ovirt-storage create mode 100644 installer/modules/ovirt/manifests/appliance.pp diff --git a/installer/appliances/ovirt-appliance/ovirt-appliance.pp b/installer/appliances/ovirt-appliance/ovirt-appliance.pp index 125edf9..ffeceba 100644 --- a/installer/appliances/ovirt-appliance/ovirt-appliance.pp +++ b/installer/appliances/ovirt-appliance/ovirt-appliance.pp @@ -44,3 +44,4 @@ include tftp::bundled include postgres::bundled include freeipa::bundled include ovirt::setup +include appliance::bundled diff --git a/installer/modules/ovirt/files/ovirt-appliance-setup b/installer/modules/ovirt/files/ovirt-appliance-setup new file mode 100644 index 0000000..98263c4 --- /dev/null +++ b/installer/modules/ovirt/files/ovirt-appliance-setup @@ -0,0 +1,4 @@ +#!/bin/bash +for i in `seq 1 5`; do /bin/dd if=/dev/null of=/ovirtiscsi/iSCSI$i bs=1 count=1 seek=5G; done +for i in `seq 1 5`; do /bin/dd if=/dev/zero of=/ovirtnfs/disk$i.dsk bs=1 count=1 seek=5G; done + diff --git a/installer/modules/ovirt/files/ovirt-storage b/installer/modules/ovirt/files/ovirt-storage new file mode 100644 index 0000000..e923500 --- /dev/null +++ b/installer/modules/ovirt/files/ovirt-storage @@ -0,0 +1,73 @@ +#!/bin/bash +# +# ovirt-storage Set up storage for oVirt Server Appliance +# +# chkconfig: 3 96 4 +# description: oVirt Appliance Storage Services +# + +# Source functions library +. /etc/init.d/functions +TARGET_ID=32101 + +prog="ovirt-storage" +num_iscsi_luns=5 + +start() { + echo -n "Starting $prog: " + + # Set up the fake iscsi target + tgtadm --lld iscsi --op new --mode target --tid $TARGET_ID \ + -T ovirtpriv:storage + + # + # Now associate them to the LVs + # + for i in `seq 1 $num_iscsi_luns` ; do + tgtadm --lld iscsi --op new --mode logicalunit --tid $TARGET_ID \ + --lun $i -b /ovirtiscsi/iSCSI$i + done + + # + # Now make them available + # + tgtadm --lld iscsi --op bind --mode target --tid $TARGET_ID -I ALL + + echo_success + echo +} + +stop() { + echo -n "Stopping $prog: " + + # stop access to the iscsi target + tgtadm --lld iscsi --op unbind --mode target --tid $TARGET_ID -I ALL + + # unbind the LUNs + for i in `seq 1 $num_iscsi_luns` ; do + tgtadm --lld iscsi --op delete --mode logicalunit --tid $TARGET_ID --lun $i + done + + # shutdown the target + tgtadm --lld iscsi --op delete --mode target --tid $TARGET_ID + + echo_success + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 2 +esac + diff --git a/installer/modules/ovirt/manifests/appliance.pp b/installer/modules/ovirt/manifests/appliance.pp new file mode 100644 index 0000000..474d1df --- /dev/null +++ b/installer/modules/ovirt/manifests/appliance.pp @@ -0,0 +1,152 @@ +#-- +# Copyright (C) 2008 Red Hat Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Author: Joey Boggs +#-- + +class appliance::bundled { + +$nfs_changes = [ + "set /files/etc/sysconfig/nfs/MOUNTD_PORT 892" +] + +augeas {"nfs_config": + changes => $nfs_changes, + notify => Service["nfs"] +} + +$nfslock_changes = [ + "set /files/etc/sysconfig/nfs/LOCKD_TCPPORT 32803", + "set /files/etc/sysconfig/nfs/LOCKD_UDPPORT 32769", + "set /files/etc/sysconfig/nfs/STATD_PORT 662" +] + +augeas {"nfslock_config": + changes => $nfslock_changes, + notify => Service["nfslock"] +} + +firewall_rule {"tgtd": destination_port => '3260'} +firewall_rule {"nfsd": destination_port => '2049'} +firewall_rule {"rpcbind": destination_port => '111'} +firewall_rule {"rpcbind-udp": destination_port => '111', protocol => 'udp'} +firewall_rule {"rpc.mountd": destination_port => '892'} +firewall_rule {"rpc.mountd-udp": destination_port => '892', protocol => 'udp'} +firewall_rule {"rpc.statd": destination_port => '662'} +firewall_rule {"rpc.statd-udp": destination_port => '662', protocol => 'udp'} + +service {"nfs": + ensure => "running", + enable => true, + require => Service["network"] +} + +service {"nfslock": + ensure => "running", + enable => true +} + +service {"network": + ensure => "running", + enable => true +} + +file{"/mnt/data/ovirtiscsi": + ensure => directory +} + +file{"/ovirtiscsi": + ensure => directory +} + +file{"/ovirtnfs": + ensure => directory +} + +file{"/mnt/data/ovirtnfs": + ensure => directory +} + +mount{"/ovirtiscsi": + atboot => true, + ensure => mounted, + fstype => bind, + options => bind, + device => "/mnt/data/ovirtiscsi", + require => [File["/mnt/data/ovirtiscsi"],File["/ovirtiscsi"]] +} + +mount{"/ovirtnfs": + atboot => true, + ensure => mounted, + fstype => bind, + options => bind, + device => "/mnt/data/ovirtnfs", + require => [File["/mnt/data/ovirtnfs"],File["/ovirtnfs"]] +} + +file {"/usr/sbin/ovirt-appliance-setup": + source => "puppet:///ovirt/ovirt-appliance-setup", + mode => 755 +} + +single_exec{"ovirtnfs_export": + command => '/bin/echo "/ovirtnfs 192.168.50.0/24(rw,no_root_squash)" >> /etc/exports', + notify => Service[nfs] +} + +file{"/mnt/data/cobblernfs": + ensure => directory +} + +file{"/cobblernfs": + ensure => directory +} + +mount{"/cobblernfs": + atboot => true, + ensure => mounted, + fstype => bind, + options => bind, + device => "/mnt/data/ovirtnfs", + require => [File["/mnt/data/ovirtnfs"],File["/cobblernfs"]] +} + +single_exec{"cobbler_nfs_export": + command => '/bin/echo "/cobblernfs 192.168.50.0/24(rw,no_root_squash)" >> /etc/exports', + notify => Service[nfs], + require => Mount["/cobblernfs"] +} + + +file {"/etc/init.d/ovirt-storage": + source => "puppet:///ovirt/ovirt-storage", + mode => 755 +} + +single_exec{"ovirt-appliance-setup": + command => "/usr/sbin/ovirt-appliance-setup", + require => File["/usr/sbin/ovirt-appliance-setup"] + } + +service {"ovirt-storage": + ensure => "running", + enable => true, + require => [File["/etc/init.d/ovirt-storage"],Single_exec["ovirt-appliance-setup"]] +} + +} diff --git a/installer/modules/ovirt/manifests/init.pp b/installer/modules/ovirt/manifests/init.pp index 87f6832..a09cea1 100644 --- a/installer/modules/ovirt/manifests/init.pp +++ b/installer/modules/ovirt/manifests/init.pp @@ -6,4 +6,4 @@ import "ovirt/freeipa.pp" import "ovirt/ovirt.pp" import "ovirt/postgres.pp" import "appliance_base/single_exec.pp" - +import "ovirt/appliance.pp" -- 1.6.0.6 From imain at redhat.com Thu Mar 5 20:43:42 2009 From: imain at redhat.com (Ian Main) Date: Thu, 5 Mar 2009 12:43:42 -0800 Subject: [Ovirt-devel] [PATCH server] Keep trying to get DNS SRV records in taskomatic and dbomatic. Message-ID: <1236285822-4188-1-git-send-email-imain@redhat.com> The last patch made it so we only try 4 times to get the DNS SRV records before giving up in *omatic. This patch makes them retry indefinitely. Signed-off-by: Ian Main --- src/db-omatic/db_omatic.rb | 10 +++++----- src/task-omatic/taskomatic.rb | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb index 678b1cb..8e62f54 100755 --- a/src/db-omatic/db_omatic.rb +++ b/src/db-omatic/db_omatic.rb @@ -78,15 +78,15 @@ class DbOmatic < Qpid::Qmf::Console database_connect server, port = nil - (1..4).each do + sleepy = 5 + while true do server, port = get_srv('qpidd', 'tcp') break if server - @logger.error "Unable to determine qpid server from DNS SRV record" if not server - sleep(10) + @logger.error "Unable to determine qpid server from DNS SRV record, retrying.." if not server + sleep(sleepy) + sleepy *= 2 if sleepy < 120 end - raise "Unable to determine server and port from DNS SRV records" if not server - @logger.info "Connecting to amqp://#{server}:#{port}" @session = Qpid::Qmf::Session.new(:console => self, :manage_connections => true) @broker = @session.add_broker("amqp://#{server}:#{port}", :mechanism => 'GSSAPI') diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index eb8e2ae..67c1369 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -98,11 +98,13 @@ class TaskOmatic ensure_credentials server, port = nil - (1..4).each do + sleepy = 5 + while true do server, port = get_srv('qpidd', 'tcp') break if server - @logger.error "Unable to determine qpid server from DNS SRV record" if not server - sleep(10) + @logger.error "Unable to determine qpid server from DNS SRV record, retrying.." if not server + sleep(sleepy) + sleepy *= 2 if sleepy < 120 end @session = Qpid::Qmf::Session.new(:manage_connections => true) -- 1.6.0.6 From sseago at redhat.com Thu Mar 5 22:38:51 2009 From: sseago at redhat.com (Scott Seago) Date: Thu, 05 Mar 2009 17:38:51 -0500 Subject: [Ovirt-devel] [PATCH] add back in appliance nfs/iscsi configuration In-Reply-To: <1236284942-30078-1-git-send-email-jboggs@redhat.com> References: <1236284942-30078-1-git-send-email-jboggs@redhat.com> Message-ID: <49B0547B.1000904@redhat.com> Joey Boggs wrote: > --- > .../appliances/ovirt-appliance/ovirt-appliance.pp | 1 + > .../modules/ovirt/files/ovirt-appliance-setup | 4 + > installer/modules/ovirt/files/ovirt-storage | 73 ++++++++++ > installer/modules/ovirt/manifests/appliance.pp | 152 ++++++++++++++++++++ > installer/modules/ovirt/manifests/init.pp | 2 +- > 5 files changed, 231 insertions(+), 1 deletions(-) > create mode 100644 installer/modules/ovirt/files/ovirt-appliance-setup > create mode 100644 installer/modules/ovirt/files/ovirt-storage > create mode 100644 installer/modules/ovirt/manifests/appliance.pp > OK this works for me now. Scott From imain at redhat.com Fri Mar 6 00:18:45 2009 From: imain at redhat.com (Ian Main) Date: Thu, 5 Mar 2009 16:18:45 -0800 Subject: [Ovirt-devel] [PATCH server] Fix vnc port forwarding on VM start Message-ID: <1236298725-6558-1-git-send-email-imain@redhat.com> This patch just puts the vnc config after the part where we set which host it's running on :) This one is already tested by 2 of us so I'll just push it. Signed-off-by: Ian Main Acked-by: Mohammed Morsi --- src/task-omatic/taskomatic.rb | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 67c1369..bad3dcf 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -353,12 +353,14 @@ class TaskOmatic # of places so you'll see a lot of .reloads. db_vm.reload set_vm_vnc_port(db_vm, result.description) unless result.status != 0 - VmVnc.forward(db_vm) # This information is not available via the libvirt interface. db_vm.memory_used = db_vm.memory_allocated db_vm.boot_device = Vm::BOOT_DEV_HD db_vm.host_id = db_host.id + db_vm.save! + + VmVnc.forward(db_vm) # We write the new state here even though dbomatic will set it soon anyway. # This is just to let the UI know that it's good to go right away and really -- 1.6.0.6 From jboggs at redhat.com Fri Mar 6 01:08:10 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 05 Mar 2009 20:08:10 -0500 Subject: [Ovirt-devel] [PATCH] add back in appliance nfs/iscsi configuration In-Reply-To: <49B0547B.1000904@redhat.com> References: <1236284942-30078-1-git-send-email-jboggs@redhat.com> <49B0547B.1000904@redhat.com> Message-ID: <49B0777A.8070400@redhat.com> pushed Scott Seago wrote: > Joey Boggs wrote: >> --- >> .../appliances/ovirt-appliance/ovirt-appliance.pp | 1 + >> .../modules/ovirt/files/ovirt-appliance-setup | 4 + >> installer/modules/ovirt/files/ovirt-storage | 73 ++++++++++ >> installer/modules/ovirt/manifests/appliance.pp | 152 >> ++++++++++++++++++++ >> installer/modules/ovirt/manifests/init.pp | 2 +- >> 5 files changed, 231 insertions(+), 1 deletions(-) >> create mode 100644 installer/modules/ovirt/files/ovirt-appliance-setup >> create mode 100644 installer/modules/ovirt/files/ovirt-storage >> create mode 100644 installer/modules/ovirt/manifests/appliance.pp >> > OK this works for me now. > > Scott > From mmorsi at redhat.com Fri Mar 6 01:30:33 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Thu, 05 Mar 2009 20:30:33 -0500 Subject: [Ovirt-devel] [PATCH server] fixed static ip address of management port in taskomatic vnc module Message-ID: <49B07CB9.4090008@redhat.com> --- src/task-omatic/vnc.rb | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/task-omatic/vnc.rb b/src/task-omatic/vnc.rb index 0fd3afd..b0a800a 100644 --- a/src/task-omatic/vnc.rb +++ b/src/task-omatic/vnc.rb @@ -27,11 +27,6 @@ class VmVnc VNC_DEBUG = false - # FIXME can this be retreived in any way - # since machine will have both external - # and internal network interface - LOCAL_IP = '192.168.50.2' - def self.debug(msg) puts "\n" + msg + "\n" if VNC_DEBUG end @@ -81,8 +76,10 @@ class VmVnc def self.get_nat_rules(vm) ip = find_host_ip(vm.host.hostname) + server,port = get_srv('ovirt', 'tcp') + local_ip = find_host_ip(server) return " -p tcp --dport " + vm.forward_vnc_port.to_s + " -j DNAT --to " + ip + ":" + vm.vnc_port.to_s, - " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + LOCAL_IP + " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + local_ip end def self.run_command(cmd) -- 1.6.0.6 From imain at redhat.com Fri Mar 6 03:19:15 2009 From: imain at redhat.com (Ian Main) Date: Thu, 5 Mar 2009 19:19:15 -0800 Subject: [Ovirt-devel] Re: [PATCH server] fixed static ip address of management port in taskomatic vnc module In-Reply-To: <49B07CB9.4090008@redhat.com> References: <49B07CB9.4090008@redhat.com> Message-ID: <20090305191915.511d3826@tp.mains.net> HOLY ACK BATMAN!! IT WORKS AWESOME! :) Ian On Thu, 05 Mar 2009 20:30:33 -0500 Mohammed Morsi wrote: > --- > src/task-omatic/vnc.rb | 9 +++------ > 1 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/src/task-omatic/vnc.rb b/src/task-omatic/vnc.rb > index 0fd3afd..b0a800a 100644 > --- a/src/task-omatic/vnc.rb > +++ b/src/task-omatic/vnc.rb > @@ -27,11 +27,6 @@ class VmVnc > > VNC_DEBUG = false > > - # FIXME can this be retreived in any way > - # since machine will have both external > - # and internal network interface > - LOCAL_IP = '192.168.50.2' > - > def self.debug(msg) > puts "\n" + msg + "\n" if VNC_DEBUG > end > @@ -81,8 +76,10 @@ class VmVnc > def self.get_nat_rules(vm) > ip = find_host_ip(vm.host.hostname) > > + server,port = get_srv('ovirt', 'tcp') > + local_ip = find_host_ip(server) > return " -p tcp --dport " + vm.forward_vnc_port.to_s + " -j DNAT --to " + ip + ":" + vm.vnc_port.to_s, > - " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + LOCAL_IP > + " -d " + ip + " -p tcp --dport " + vm.vnc_port.to_s + " -j SNAT --to " + local_ip > end > > def self.run_command(cmd) > -- > 1.6.0.6 > From imain at redhat.com Fri Mar 6 03:20:29 2009 From: imain at redhat.com (Ian Main) Date: Thu, 5 Mar 2009 19:20:29 -0800 Subject: [Ovirt-devel] Re: [PATCH server] fixed static ip address of management port in taskomatic vnc module In-Reply-To: <49B07CB9.4090008@redhat.com> References: <49B07CB9.4090008@redhat.com> Message-ID: <20090305192029.7e8d3105@tp.mains.net> On Thu, 05 Mar 2009 20:30:33 -0500 Mohammed Morsi wrote: Just a note that in the WUI the uri for vnc viewer shows up as http://whatever:1234, I don't think that's right.. Ian From jguiditt at redhat.com Fri Mar 6 05:05:15 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Fri, 06 Mar 2009 00:05:15 -0500 Subject: [Ovirt-devel] Re: [PATCH server] improvements / fixes to ovirt network ui In-Reply-To: <49AD800F.3080505@redhat.com> References: <1234910641-12314-1-git-send-email-mmorsi@redhat.com> <49AD800F.3080505@redhat.com> Message-ID: <1236315915.4341.14.camel@physical.priv.ovirt.org> On Tue, 2009-03-03 at 14:07 -0500, Mohammed Morsi wrote: > Patch bump. Know everyone's busy w/ the installer and other things but > was wondering if anyone had a second to take a look at this before it > got stale. > > I made sure to thoroughly test everything included when I wrote it so a > brief code review and a quick functionality verification should be all > that's needed. > > I had also sent out an additional email with a few notes relating to > these changes. It can be found here > https://www.redhat.com/archives/ovirt-devel/2009-February/msg00178.html > > Thanks alot, > -Mo I think this is close to ok, with a few caveats Mo and I discussed in irc as I was testing: * Migration needs to handle setting some fields to null, so they dont break constraints when running migration * There is a form error mo is going to look into * We should have jeremy look at the interaction design on some of these forms. Could have been just me not being familiar, but I found some of the flows confusing. * Networks dropdown in New VM does not default to blank * There were two items I could not test, as my qpid setup ran into problems last night ' Unable to determine qpid server from DNS SRV record, retrying..'. Mo had written up what to test, and these items (from his email to me) were: On 'vm create / edit form' * upon submitting the form, if the 'boot type' is not 'hd', a network _must_ be selected (we need to confirm w/ Hugh that this requirement is ok) When starting a vm: * If the vm's boot type is not marked as 'hd' and there is no nic or bonding on the host that is to run the vm, that is associated with the network the user selected (on the vm create / edit form), the start operation fails (also need confirmation w/ Hugh on this one). Note if a user selected a physical network for the vm, only nics on the host will be checked, and if a vlan is selected for the vm, only bondings on the host will be checked (to see if they are on the selected network) From mmorsi at redhat.com Fri Mar 6 05:30:44 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 06 Mar 2009 00:30:44 -0500 Subject: [Ovirt-devel] [PATCH server] improvements / fixes to ovirt network ui Message-ID: <49B0B504.401@redhat.com> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: improvements-fixes-network-ui.patch URL: From mmorsi at redhat.com Fri Mar 6 05:40:58 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 06 Mar 2009 00:40:58 -0500 Subject: [Ovirt-devel] Re: [PATCH server] improvements / fixes to ovirt network ui In-Reply-To: <1236315915.4341.14.camel@physical.priv.ovirt.org> References: <1234910641-12314-1-git-send-email-mmorsi@redhat.com> <49AD800F.3080505@redhat.com> <1236315915.4341.14.camel@physical.priv.ovirt.org> Message-ID: <49B0B76A.8050006@redhat.com> Jason Guiditta wrote: > On Tue, 2009-03-03 at 14:07 -0500, Mohammed Morsi wrote: > >> Patch bump. Know everyone's busy w/ the installer and other things but >> was wondering if anyone had a second to take a look at this before it >> got stale. >> >> I made sure to thoroughly test everything included when I wrote it so a >> brief code review and a quick functionality verification should be all >> that's needed. >> >> I had also sent out an additional email with a few notes relating to >> these changes. It can be found here >> https://www.redhat.com/archives/ovirt-devel/2009-February/msg00178.html >> >> Thanks alot, >> -Mo >> > > I think this is close to ok, with a few caveats Mo and I discussed in > irc as I was testing: > Just sent an updated patch addressing these issues: > * Migration needs to handle setting some fields to null, so they dont > break constraints when running migration > * There is a form error mo is going to look into > * Networks dropdown in New VM does not default to blank > The following two issues rebrings up a requirements question previously asked. The concern is that when starting a vm, an interface name must be specified for it to use, which must be deduced from the network ui. An exception to this rule would be when the vm is being booted of a hard drive, in which case its presumed a network connection isn't necessary and thus does not need to be specified. In the case of PXE and cobbler boots, the ui and model will require a user to specify a network to be associated with the vm, and when the vm is being started, it iis necessary for a nic / bonding to exist on node which will be hosting the vm and associated with the network the user selected for that vm. Otherwise the vm will fail to start with an error message. I just wanted to reraise this point again and make sure that this is the required functionally. > > On 'vm create / edit form' > * upon submitting the form, if the 'boot type' is not 'hd', a network > _must_ be selected (we need to confirm w/ Hugh that this requirement is > ok) > > When starting a vm: > * If the vm's boot type is not marked as 'hd' and there is no nic or > bonding on the host that is to run the vm, that is associated with the > network the user selected (on the vm create / edit form), the start > operation fails (also need confirmation w/ Hugh on this one). Note if a > user selected a physical network for the vm, only nics on the host will > be checked, and if a vlan is selected for the vm, only bondings on the > host will be checked (to see if they are on the selected network) > > -Mo From jboggs at redhat.com Fri Mar 6 14:39:37 2009 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 6 Mar 2009 09:39:37 -0500 Subject: [Ovirt-devel] [PATCH server] disable second interface for now, also for consistency provide default management interface device(eth0) Message-ID: <1236350377-3914-1-git-send-email-jboggs@redhat.com> Disables ability of the installer to prompt for a second network interface. Also provides a default answer of "eth0" for management interface. --- installer/bin/ovirt-installer | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer index ba051d1..1c5f992 100755 --- a/installer/bin/ovirt-installer +++ b/installer/bin/ovirt-installer @@ -127,10 +127,11 @@ else end end -mgmt_dev = prompt_for_answer("Enter your management interface (example: eth0):") -prov_dev = prompt_for_answer("Enter your provisioning interface, this may also be your management interface:", :default => mgmt_dev) - -sep_networks = (mgmt_dev == prov_dev) ? "n" : "y" +mgmt_dev = prompt_for_answer("Enter your management interface:", :default => "eth0") +# For now only supporting one network interface +#prov_dev = prompt_for_answer("Enter your provisioning interface, this may also be your management interface:", :default => mgmt_dev) +prov_dev = mgmt_dev +#sep_networks = (mgmt_dev == prov_dev) ? "n" : "y" ovirt_host = prompt_for_answer("Enter the hostname of the oVirt management server (example: management.example.com):", :regex => IP_OR_FQDN) ipa_host = ovirt_host -- 1.6.0.6 From jboggs at redhat.com Fri Mar 6 16:51:13 2009 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 06 Mar 2009 11:51:13 -0500 Subject: [Ovirt-devel] Re: [PATCH server] disable second interface for now, also for consistency provide default management interface device(eth0) In-Reply-To: <1236350377-3914-1-git-send-email-jboggs@redhat.com> References: <1236350377-3914-1-git-send-email-jboggs@redhat.com> Message-ID: <49B15481.5020101@redhat.com> Joey Boggs wrote: > Disables ability of the installer to prompt for a second network interface. Also provides a default answer of "eth0" for management interface. > > --- > installer/bin/ovirt-installer | 9 +++++---- > 1 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer > index ba051d1..1c5f992 100755 > --- a/installer/bin/ovirt-installer > +++ b/installer/bin/ovirt-installer > @@ -127,10 +127,11 @@ else > end > end > > -mgmt_dev = prompt_for_answer("Enter your management interface (example: eth0):") > -prov_dev = prompt_for_answer("Enter your provisioning interface, this may also be your management interface:", :default => mgmt_dev) > - > -sep_networks = (mgmt_dev == prov_dev) ? "n" : "y" > +mgmt_dev = prompt_for_answer("Enter your management interface:", :default => "eth0") > +# For now only supporting one network interface > +#prov_dev = prompt_for_answer("Enter your provisioning interface, this may also be your management interface:", :default => mgmt_dev) > +prov_dev = mgmt_dev > +#sep_networks = (mgmt_dev == prov_dev) ? "n" : "y" > > ovirt_host = prompt_for_answer("Enter the hostname of the oVirt management server (example: management.example.com):", :regex => IP_OR_FQDN) > ipa_host = ovirt_host > pushed this since it was essential to the pending release From slinabery at redhat.com Fri Mar 6 17:37:44 2009 From: slinabery at redhat.com (Steve Linabery) Date: Fri, 6 Mar 2009 11:37:44 -0600 Subject: [Ovirt-devel] Re: [PATCH server] disable second interface for now, also for consistency provide default management interface device(eth0) In-Reply-To: <49B15481.5020101@redhat.com> References: <1236350377-3914-1-git-send-email-jboggs@redhat.com> <49B15481.5020101@redhat.com> Message-ID: <20090306173744.GD23365@redhat.com> On Fri, Mar 06, 2009 at 11:51:13AM -0500, Joey Boggs wrote: > Joey Boggs wrote: >> Disables ability of the installer to prompt for a second network interface. Also provides a default answer of "eth0" for management interface. >> >> --- >> installer/bin/ovirt-installer | 9 +++++---- >> 1 files changed, 5 insertions(+), 4 deletions(-) >> >> diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer >> index ba051d1..1c5f992 100755 >> --- a/installer/bin/ovirt-installer >> +++ b/installer/bin/ovirt-installer >> @@ -127,10 +127,11 @@ else >> end >> end >> -mgmt_dev = prompt_for_answer("Enter your management interface >> (example: eth0):") >> -prov_dev = prompt_for_answer("Enter your provisioning interface, this may also be your management interface:", :default => mgmt_dev) >> - >> -sep_networks = (mgmt_dev == prov_dev) ? "n" : "y" >> +mgmt_dev = prompt_for_answer("Enter your management interface:", :default => "eth0") >> +# For now only supporting one network interface >> +#prov_dev = prompt_for_answer("Enter your provisioning interface, this may also be your management interface:", :default => mgmt_dev) >> +prov_dev = mgmt_dev >> +#sep_networks = (mgmt_dev == prov_dev) ? "n" : "y" >> ovirt_host = prompt_for_answer("Enter the hostname of the oVirt >> management server (example: management.example.com):", :regex => >> IP_OR_FQDN) >> ipa_host = ovirt_host >> > > pushed this since it was essential to the pending release > OK, well, post-push ACK...just letting you know I built with this applied this morning and it worked fine. Steve From mmorsi at redhat.com Fri Mar 6 14:13:11 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 6 Mar 2009 09:13:11 -0500 Subject: [Ovirt-devel] [PATCH server] improvements / fixes to ovirt network ui Message-ID: <1236348791-3680-1-git-send-email-mmorsi@redhat.com> (major changes) - new db migration (035) updating db model to contain additional fields / constraints - add host_id / network_id uniqueness constraint to nics and bondings table (a host may only have one nic / bonding on any given network). added validations to models to support this, and filter network list presented on edit nics / bonding form to only present networks not already selected on host - associate vm / network tables (many vms to one network) - add network drop down to vm form - bonding form bugfix, only display nics not already in a bonding - edit host browser to store interface name upon retreiving nic - remove network validation from nics / bondings, changes to net controller to remove assumption that nics / bondings are always associated w/ network - remove routing info related fields (netmask, broadcast, gateway) from create / edit ip address form when displayed as part of edit nics / bonding interface (minor changes) - display associate usages on network details pane - change wording on network details pane from 'edit ip addresses' to 'edit routing info' - add interface name and network name (if a network is associated) next to each nic in host details pane - move vm uuid up to top of vm form as it doesn't belong under networks section --- src/app/controllers/network_controller.rb | 105 +++++++++++++++----- src/app/controllers/vm_controller.rb | 2 + src/app/models/bonding.rb | 9 +- src/app/models/ip_address.rb | 4 - src/app/models/network.rb | 2 + src/app/models/nic.rb | 10 ++- src/app/models/vm.rb | 2 + src/app/views/host/edit_network.rhtml | 2 +- src/app/views/host/show.rhtml | 6 +- src/app/views/network/_bonding_form.rhtml | 2 +- src/app/views/network/_ip_address_form.rhtml | 40 ++++---- src/app/views/network/_select.rhtml | 2 +- .../views/network/edit_network_ip_addresses.rhtml | 2 +- src/app/views/network/edit_nic.rhtml | 4 +- src/app/views/network/show.rhtml | 7 +- src/app/views/vm/_form.rhtml | 3 +- .../035_networks_nics_bondings_additions.rb | 55 ++++++++++ src/host-browser/host-browser.rb | 10 +-- src/task-omatic/task_vm.rb | 9 +- src/task-omatic/taskomatic.rb | 25 +++++- src/test/fixtures/networks.yml | 9 ++ src/test/unit/bonding_test.rb | 4 +- 22 files changed, 235 insertions(+), 79 deletions(-) create mode 100644 src/db/migrate/035_networks_nics_bondings_additions.rb diff --git a/src/app/controllers/network_controller.rb b/src/app/controllers/network_controller.rb index 7328e66..a99cf8d 100644 --- a/src/app/controllers/network_controller.rb +++ b/src/app/controllers/network_controller.rb @@ -272,7 +272,16 @@ class NetworkController < ApplicationController @nic = Nic.find(params[:id]) @network = @nic.physical_network - @networks = PhysicalNetwork.find(:all) + # filter out networks already assigned to nics on host + network_conditions = [] + @nic.host.nics.each { |nic| + unless nic.physical_network.nil? || nic.id == @nic.id + network_conditions.push(" id != " + nic.physical_network.id.to_s) + end + } + network_conditions = network_conditions.join(" AND ") + + @networks = PhysicalNetwork.find(:all, :conditions => network_conditions) network_options render :layout => false @@ -281,14 +290,16 @@ class NetworkController < ApplicationController def update_nic begin network_options - @network = Network.find(params[:nic][:physical_network_id]) - if @network.boot_type.id == @static_boot_type.id - if params[:ip_address][:id] == "New" - _create_ip_address - elsif params[:ip_address][:id] != "" - _update_ip_address(params[:ip_address][:id]) - end + unless params[:nic][:physical_network_id].nil? || params[:nic][:physical_network_id].to_i == 0 + @network = Network.find(params[:nic][:physical_network_id]) + if @network.boot_type.id == @static_boot_type.id + if params[:ip_address][:id] == "New" + _create_ip_address + elsif params[:ip_address][:id] != "" + _update_ip_address(params[:ip_address][:id]) + end + end end @nic = Nic.find(params[:id]) @@ -313,13 +324,31 @@ class NetworkController < ApplicationController ########################## Bonding related actions def new_bonding - unless params[:host_id] + unless params[:host_id] flash[:notice] = "Host is required." redirect_to :controller => 'dashboard' end @host = Host.find(params[:host_id]) - @networks = Vlan.find(:all) + + # FIXME when bonding_nics table is removed, and + # bondings_id column added to nics table, simplify + # (select where bonding.nil?) + @nics = [] + @host.nics.each{ |nic| + @nics.push(nic) if nic.bondings.nil? || nic.bondings.size == 0 + } + + # filter out networks already assigned to bondings on host + network_conditions = [] + @host.bondings.each { |bonding| + unless bonding.vlan.nil? + network_conditions.push(" id != " + bonding.vlan.id.to_s) + end + } + network_conditions = network_conditions.join(" AND ") + + @networks = Vlan.find(:all, :conditions => network_conditions) network_options render :layout => false @@ -328,13 +357,15 @@ class NetworkController < ApplicationController def create_bonding begin network_options - @network = Network.find(params[:bonding][:vlan_id]) - if @network.boot_type.id == @static_boot_type.id - if params[:ip_address][:id] == "New" - _create_ip_address - elsif params[:ip_address][:id] != "" - _update_ip_address(params[:ip_address][:id]) + unless params[:bonding][:vlan_id].nil? || params[:bonding][:vlan_id].to_i == 0 + @network = Network.find(params[:bonding][:vlan_id]) + if @network.boot_type.id == @static_boot_type.id + if params[:ip_address][:id] == "New" + _create_ip_address + elsif params[:ip_address][:id] != "" + _update_ip_address(params[:ip_address][:id]) + end end end @@ -368,7 +399,29 @@ class NetworkController < ApplicationController @network = @bonding.vlan @host = @bonding.host - @networks = Vlan.find(:all) + + # FIXME when bonding_nics table is removed, and + # bondings_id column added to nics table, simplify + # (select where bonding.nil? or bonding has nic) + @nics = [] + @host.nics.each{ |nic| + if nic.bondings.nil? || + nic.bondings.size == 0 || + nic.bondings[0].id == @bonding.id + @nics.push(nic) + end + } + + # filter out networks already assigned to bondings on host + network_conditions = [] + @host.bondings.each { |bonding| + unless bonding.vlan.nil? || bonding.id == @bonding.id + network_conditions.push(" id != " + bonding.vlan.id.to_s) + end + } + network_conditions = network_conditions.join(" AND ") + + @networks = Vlan.find(:all, :conditions => network_conditions) network_options render :layout => false @@ -377,13 +430,15 @@ class NetworkController < ApplicationController def update_bonding begin network_options - @network = Network.find(params[:bonding][:vlan_id]) - if @network.boot_type.id == @static_boot_type.id - if params[:ip_address][:id] == "New" - _create_ip_address - elsif params[:ip_address][:id] != "" - _update_ip_address(params[:ip_address][:id]) + unless params[:bonding][:vlan_id].nil? || params[:bonding][:vlan_id].to_i == 0 + @network = Network.find(params[:bonding][:vlan_id]) + if @network.boot_type.id == @static_boot_type.id + if params[:ip_address][:id] == "New" + _create_ip_address + elsif params[:ip_address][:id] != "" + _update_ip_address(params[:ip_address][:id]) + end end end @@ -394,13 +449,13 @@ class NetworkController < ApplicationController alert = "Bonding was successfully updated." render :json => { :object => "bonding", :success => true, :alert => alert } - rescue + rescue Exception => e if @ip_address and @ip_address.errors.size != 0 render :json => { :object => "ip_address", :success => false, :errors => @ip_address.errors.localize_error_messages.to_a} else - render :json => { :object => "bonding", :success => false, + render :json => { :object => "bonding", :success => false, :errors => @bonding.errors.localize_error_messages.to_a } end diff --git a/src/app/controllers/vm_controller.rb b/src/app/controllers/vm_controller.rb index f104415..aa575c6 100644 --- a/src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -335,6 +335,7 @@ class VmController < ApplicationController end @perm_obj = @vm.vm_resource_pool @current_pool_id=@perm_obj.id + @networks = Network.find(:all).collect{ |net| [net.name, net.id] } _setup_provisioning_options end def pre_create @@ -361,6 +362,7 @@ class VmController < ApplicationController @vm = Vm.find(params[:id]) @perm_obj = @vm.vm_resource_pool @current_pool_id=@perm_obj.id + @networks = Network.find(:all).collect{ |net| [net.name, net.id] } _setup_provisioning_options end def pre_vm_action diff --git a/src/app/models/bonding.rb b/src/app/models/bonding.rb index a67b97b..32b9a37 100644 --- a/src/app/models/bonding.rb +++ b/src/app/models/bonding.rb @@ -37,11 +37,13 @@ class Bonding < ActiveRecord::Base belongs_to :vlan has_many :ip_addresses, :dependent => :destroy + # FIXME bondings_nics table should just be replaced with + # bonding_id column in nics table, and relationship changed + # here to has_many has_and_belongs_to_many :nics, :join_table => 'bondings_nics', :foreign_key => :bonding_id - validates_presence_of :name, :message => 'A name is required.' @@ -57,8 +59,9 @@ class Bonding < ActiveRecord::Base validates_presence_of :bonding_type_id, :message => 'A bonding type must be specified.' - validates_presence_of :vlan_id, - :message => 'A vlan must be specified.' + validates_uniqueness_of :vlan_id, + :scope => :host_id, + :unless => Proc.new { |bonding| bonding.vlan.nil? } # verify arp ping address to be ipv4 if set validates_format_of :arp_ping_address, diff --git a/src/app/models/ip_address.rb b/src/app/models/ip_address.rb index 3f246b1..5d2e6af 100644 --- a/src/app/models/ip_address.rb +++ b/src/app/models/ip_address.rb @@ -24,8 +24,4 @@ class IpAddress < ActiveRecord::Base belongs_to :network belongs_to :nic belongs_to :bonding - - def validate - errors.add("id", "ip must be associated with foreign entity") if network_id.nil? and nic_id.nil? and bonding_id.nil? - end end diff --git a/src/app/models/network.rb b/src/app/models/network.rb index 404633d..0ad38bb 100644 --- a/src/app/models/network.rb +++ b/src/app/models/network.rb @@ -22,6 +22,8 @@ class Network < ActiveRecord::Base has_and_belongs_to_many :usages, :join_table => 'networks_usages' + has_many :vms + validates_presence_of :type, :message => 'A type must be specified.' validates_presence_of :name, diff --git a/src/app/models/nic.rb b/src/app/models/nic.rb index e43f067..e26c110 100644 --- a/src/app/models/nic.rb +++ b/src/app/models/nic.rb @@ -22,6 +22,9 @@ class Nic < ActiveRecord::Base belongs_to :physical_network has_many :ip_addresses, :dependent => :destroy + # FIXME bondings_nics table should just be replaced with + # bonding_id column in nics table, and relationship changed + # here to belongs_to has_and_belongs_to_many :bondings, :join_table => 'bondings_nics' validates_presence_of :mac, @@ -33,12 +36,13 @@ class Nic < ActiveRecord::Base validates_presence_of :host_id, :message => 'A host must be specified.' - validates_presence_of :physical_network_id, - :message => 'A network must be specified.' - validates_numericality_of :bandwidth, :greater_than_or_equal_to => 0 + validates_uniqueness_of :physical_network_id, + :scope => :host_id, + :unless => Proc.new { |nic| nic.physical_network_id.nil? } + # validate 'bridge' or 'usage_type' attribute ? protected diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index 83aa410..e56d6dd 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -29,6 +29,8 @@ class Vm < ActiveRecord::Base end has_and_belongs_to_many :storage_volumes + belongs_to :network + has_many :smart_pool_tags, :as => :tagged, :dependent => :destroy has_many :smart_pools, :through => :smart_pool_tags diff --git a/src/app/views/host/edit_network.rhtml b/src/app/views/host/edit_network.rhtml index 7ec3180..760f508 100644 --- a/src/app/views/host/edit_network.rhtml +++ b/src/app/views/host/edit_network.rhtml @@ -9,7 +9,7 @@ diff --git a/src/app/views/host/show.rhtml b/src/app/views/host/show.rhtml index b671578..1e0787e 100644 --- a/src/app/views/host/show.rhtml +++ b/src/app/views/host/show.rhtml @@ -62,7 +62,11 @@ <%=h @host.arch %>
<%=h @host.hypervisor_type %>
<%=h @host.status_str %>
- <%= @host.nics.collect{ |n| n.mac }.join("
") %>
+ <%= @host.nics.collect{ |n| + n.interface_name.to_s + " " + n.mac + + (n.physical_network.nil? ? "" : " " + n.physical_network.name) + }.join("
") + %>
<%= @host.bondings.collect { |n| n.name }.join("
") %>
<%= @host.vms.collect{|x| x.uuid }.join("
") %>
diff --git a/src/app/views/network/_bonding_form.rhtml b/src/app/views/network/_bonding_form.rhtml index 4ec0df1..663c537 100644 --- a/src/app/views/network/_bonding_form.rhtml +++ b/src/app/views/network/_bonding_form.rhtml @@ -24,7 +24,7 @@
NICs
diff --git a/src/app/views/network/_ip_address_form.rhtml b/src/app/views/network/_ip_address_form.rhtml index b952807..a3b3a95 100644 --- a/src/app/views/network/_ip_address_form.rhtml +++ b/src/app/views/network/_ip_address_form.rhtml @@ -21,31 +21,33 @@ -
-
Netmask
-
- <%= text_field_with_label "", "ip_address", "netmask" %> -
+ <% if @parent_type == 'network' %> +
+
Netmask
+
+ <%= text_field_with_label "", "ip_address", "netmask" %> +
-
Broadcast
-
- <%= text_field_with_label "", "ip_address", "broadcast" %> +
Broadcast
+
+ <%= text_field_with_label "", "ip_address", "broadcast" %> +
-
-