From harsha at gluster.com Mon Jun 1 07:46:58 2009 From: harsha at gluster.com (Harshavardhana) Date: Mon, 1 Jun 2009 13:16:58 +0530 Subject: [Ovirt-devel] Problems Configuring Ovirt In-Reply-To: <4A21FE85.1070000@redhat.com> References: <8a80e9760905250505he39b789w43206daca2773db5@mail.gmail.com> <20090529090311.0e8594b0@tp.mains.net> <8a80e9760905291216j72b3dedfp68baa99e491452f@mail.gmail.com> <4A2034E4.9070807@redhat.com> <8a80e9760905291219v382aa06asfe06ca0d394b2ba9@mail.gmail.com> <4A2035EA.9030208@redhat.com> <8a80e9760905291253x257a3cb0v4ae21eef39dcbc8f@mail.gmail.com> <4A203E2B.5060805@redhat.com> <8a80e9760905291303g1515a8fag5f764f09b5e5565@mail.gmail.com> <4A21FE85.1070000@redhat.com> Message-ID: <8a80e9760906010046s4eb754c2id0e24ae72f36d738@mail.gmail.com> http://ovirt.pastebin.com/m47b15a94 here the requested information. Let me know anything else you need thanks. Regards -- Harshavardhana "Yantra Shilpi" Z Research Inc - http://www.zresearch.com On Sun, May 31, 2009 at 9:20 AM, Joey Boggs wrote: > can you post from the management server > /usr/share/ace/appliances/ovirt/ovirt.pp and /etc/dhclient.conf to > ovirt.pastebin.com Remove any passwords in that text prior to > attaching for security reasons. > > > > Harshavardhana wrote: > >> Current information >> >> 1. >> [root at management ovirt-server]# chkconfig --list | grep -i network >> NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off >> network 0:off 1:off 2:on 3:on 4:on 5:on 6:off >> [root at management ovirt-server]# >> >> 2. >> [root at management ovirt-server]# cat /etc/resolv.conf >> # Generated by NetworkManager >> >> >> # No nameservers found; try putting DNS servers into your >> # ifcfg files in /etc/sysconfig/network-scripts like so: >> # >> # DNS1=xxx.xxx.xxx.xxx >> # DNS2=xxx.xxx.xxx.xxx >> # DOMAIN=lab.foo.com bar.foo.com > > >> nameserver 192.168.1.1 >> [root at management ovirt-server]# >> >> 3. >> [root at management ovirt-server]# dig +short -t srv _ipa._tcp.ovirt.priv >> [root at management ovirt-server]# dig +short -t srv _qpidd._tcp.ovirt.priv >> [root at management ovirt-server]# >> >> Can i take this up in IRC if you all are online? >> >> Regards >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sat, May 30, 2009 at 1:27 AM, Joey Boggs > jboggs at redhat.com>> wrote: >> >> >> that query will not work correctly, try these: >> >> dig +short -t srv _ipa._tcp.ovirt.priv >> dig +short -t srv _qpidd._tcp.ovirt.priv >> >> Also send you current /etc/resolv.conf again >> >> >> >> Harshavardhana wrote: >> >> nope still the same issue . Is there a way to fix these SRV >> records? >> >> i did a DNS lookup on the record >> >> [root at management ovirt-server]# dig -t SRV >> _qpidd._tcp,management.ovirt.priv,5672 >> >> ; <<>> DiG 9.5.1-P2-RedHat-9.5.1-2.P2.fc10 <<>> -t SRV >> _qpidd._tcp,management.ovirt.priv,5672 >> ;; global options: printcmd >> ;; Got answer: >> ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27980 >> ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, >> ADDITIONAL: 0 >> >> ;; QUESTION SECTION: >> ;_qpidd._tcp,management.ovirt.priv,5672. IN SRV >> >> ;; AUTHORITY SECTION: >> . 10726 IN SOA >> A.ROOT-SERVERS.NET >> . NSTLD.VERISIGN-GRS.COM >> >> . 2009052901 1800 900 604800 86400 >> >> >> ;; Query time: 1 msec >> ;; SERVER: 192.168.1.1#53(192.168.1.1) >> ;; WHEN: Sat May 30 01:22:00 2009 >> ;; MSG SIZE rcvd: 131 >> >> [root at management ovirt-server]# >> >> does this help? >> >> Thanks >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sat, May 30, 2009 at 12:52 AM, Joey Boggs >> >> >> wrote: >> >> >> Looks like it's NetworkManager related, try this: chkconfig >> NetworkManager off, chkconfig network on then reboot >> server/node >> and recheck to see if you node comes up >> >> Harshavardhana wrote: >> >> Oops >> >> Management IP - 192.168.1.202 >> nameserver - 192.168.1.1 >> >> Regards >> -- Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sat, May 30, 2009 at 12:47 AM, Joey Boggs >> >> > >> >> >>> wrote: >> >> My guess is that NetworkManager is in use, can you >> get the >> info I >> asked in the other email? >> >> Harshavardhana wrote: >> >> Installation is done by using ovirt-installer, seems >> all were >> automated. >> >> Regards >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Fri, May 29, 2009 at 9:33 PM, Ian Main >> >> > >> > > >> >> >> > >> >> > > >>>> >> >> wrote: >> >> On Fri, 29 May 2009 00:09:27 +0530 >> Harshavardhana > >> > >> > > >> >> >> > >> >> > >> > >>>> wrote: >> >> > Hi David, >> > >> > Thanks a lot for the reply, but i have >> seen >> libvirt-qpidd >> to fail >> > during the ovirt-node image boot. So i >> guessed this is >> something >> related to >> > libvirt-qpid server not running. >> > >> > Regards >> >> It's probably failing for the same reason. >> You need to >> have DNS >> SRV records >> set up for various services in Ovirt so that it >> knows where to >> find them (host >> and port). >> >> Are you doing an install using the installer? Or >> trying to >> set it >> up by hand? >> >> Ian >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> >> > > >> >> > >> >> > >> > > >> >> > >>> >> >> >> >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> 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 Mon Jun 1 12:51:27 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 01 Jun 2009 08:51:27 -0400 Subject: [Ovirt-devel] Problems Configuring Ovirt In-Reply-To: <8a80e9760906010046s4eb754c2id0e24ae72f36d738@mail.gmail.com> References: <8a80e9760905250505he39b789w43206daca2773db5@mail.gmail.com> <20090529090311.0e8594b0@tp.mains.net> <8a80e9760905291216j72b3dedfp68baa99e491452f@mail.gmail.com> <4A2034E4.9070807@redhat.com> <8a80e9760905291219v382aa06asfe06ca0d394b2ba9@mail.gmail.com> <4A2035EA.9030208@redhat.com> <8a80e9760905291253x257a3cb0v4ae21eef39dcbc8f@mail.gmail.com> <4A203E2B.5060805@redhat.com> <8a80e9760905291303g1515a8fag5f764f09b5e5565@mail.gmail.com> <4A21FE85.1070000@redhat.com> <8a80e9760906010046s4eb754c2id0e24ae72f36d738@mail.gmail.com> Message-ID: <4A23CECF.7030807@redhat.com> Eveything looks configured correctly for dns to work however you're still getting another nameserver which doesn't include the one we're injecting for the admin interface which means NetworkManager is running somehow. Can you verify NetworkManager is chkconfig'd off again and then try rebooting the management box one more time. for a temporary solution you can add " nameserver 192.168.1.202" into /etc/resolv.conf manually as the first entry but when the dhcp address renews it will likely be overwritten. Harshavardhana wrote: > http://ovirt.pastebin.com/m47b15a94 here the requested information. > Let me know anything else you need thanks. > > Regards > -- > Harshavardhana > "Yantra Shilpi" > Z Research Inc - http://www.zresearch.com > > > > On Sun, May 31, 2009 at 9:20 AM, Joey Boggs > wrote: > > can you post from the management server > /usr/share/ace/appliances/ovirt/ovirt.pp and /etc/dhclient.conf > to ovirt.pastebin.com Remove any > passwords in that text prior to attaching for security reasons. > > > > Harshavardhana wrote: > > Current information > > 1. > [root at management ovirt-server]# chkconfig --list | grep -i network > NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off > 6:off > network 0:off 1:off 2:on 3:on 4:on 5:on > 6:off > [root at management ovirt-server]# > > 2. > [root at management ovirt-server]# cat /etc/resolv.conf > # Generated by NetworkManager > > > # No nameservers found; try putting DNS servers into your > # ifcfg files in /etc/sysconfig/network-scripts like so: > # > # DNS1=xxx.xxx.xxx.xxx > # DNS2=xxx.xxx.xxx.xxx > # DOMAIN=lab.foo.com > bar.foo.com > > nameserver 192.168.1.1 > [root at management ovirt-server]# > > 3. > [root at management ovirt-server]# dig +short -t srv > _ipa._tcp.ovirt.priv > [root at management ovirt-server]# dig +short -t srv > _qpidd._tcp.ovirt.priv > [root at management ovirt-server]# > > Can i take this up in IRC if you all are online? > > Regards > -- > Harshavardhana > "Yantra Shilpi" > Z Research Inc - http://www.zresearch.com > > > > On Sat, May 30, 2009 at 1:27 AM, Joey Boggs >> wrote: > > > that query will not work correctly, try these: > > dig +short -t srv _ipa._tcp.ovirt.priv > dig +short -t srv _qpidd._tcp.ovirt.priv > > Also send you current /etc/resolv.conf again > > > > Harshavardhana wrote: > > nope still the same issue . Is there a way to fix these SRV > records? > > i did a DNS lookup on the record > > [root at management ovirt-server]# dig -t SRV > _qpidd._tcp,management.ovirt.priv,5672 > > ; <<>> DiG 9.5.1-P2-RedHat-9.5.1-2.P2.fc10 <<>> -t SRV > _qpidd._tcp,management.ovirt.priv,5672 > ;; global options: printcmd > ;; Got answer: > ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27980 > ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, > ADDITIONAL: 0 > > ;; QUESTION SECTION: > ;_qpidd._tcp,management.ovirt.priv,5672. IN SRV > > ;; AUTHORITY SECTION: > . 10726 IN SOA > A.ROOT-SERVERS.NET > > . NSTLD.VERISIGN-GRS.COM > > > . 2009052901 1800 900 > 604800 86400 > > > ;; Query time: 1 msec > ;; SERVER: 192.168.1.1#53(192.168.1.1) > ;; WHEN: Sat May 30 01:22:00 2009 > ;; MSG SIZE rcvd: 131 > > [root at management ovirt-server]# > > does this help? > > Thanks > -- > Harshavardhana > "Yantra Shilpi" > Z Research Inc - http://www.zresearch.com > > > > On Sat, May 30, 2009 at 12:52 AM, Joey Boggs > > > > > >>> wrote: > > > Looks like it's NetworkManager related, try this: > chkconfig > NetworkManager off, chkconfig network on then reboot > server/node > and recheck to see if you node comes up > > Harshavardhana wrote: > > Oops > > Management IP - 192.168.1.202 > nameserver - 192.168.1.1 > > Regards > -- Harshavardhana > "Yantra Shilpi" > Z Research Inc - http://www.zresearch.com > > > > On Sat, May 30, 2009 at 12:47 AM, Joey Boggs > > > > > >> > > > > >>>> wrote: > > My guess is that NetworkManager is in use, > can you > get the > info I > asked in the other email? > > Harshavardhana wrote: > > Installation is done by using > ovirt-installer, seems > all were > automated. > > Regards > -- > Harshavardhana > "Yantra Shilpi" > Z Research Inc - http://www.zresearch.com > > > > On Fri, May 29, 2009 at 9:33 PM, Ian Main > > > > > >> > > > > > >>> > > > > >> > > > > > > >>>>> > > wrote: > > On Fri, 29 May 2009 00:09:27 +0530 > Harshavardhana > > > >> > > > > > >>> > > > > >> > > > > > > >>>>> wrote: > > > Hi David, > > > > Thanks a lot for the reply, but > i have > seen > libvirt-qpidd > to fail > > during the ovirt-node image boot. So i > guessed this is > something > related to > > libvirt-qpid server not running. > > > > Regards > > It's probably failing for the same reason. > You need to > have DNS > SRV records > set up for various services in Ovirt > so that it > knows where to > find them (host > and port). > > Are you doing an install using the > installer? Or > trying to > set it > up by hand? > > Ian > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > > > > > >> > > > > >>> > > > > > >> > > > > >>>> > > > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > > > ------------------------------------------------------------------------ > > > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > > > > > >> > > > > > >>> > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > > > > > > > > > > From harsha at gluster.com Mon Jun 1 13:56:13 2009 From: harsha at gluster.com (Harshavardhana) Date: Mon, 1 Jun 2009 19:26:13 +0530 Subject: [Ovirt-devel] Problems Configuring Ovirt In-Reply-To: <4A23CECF.7030807@redhat.com> References: <8a80e9760905250505he39b789w43206daca2773db5@mail.gmail.com> <4A2034E4.9070807@redhat.com> <8a80e9760905291219v382aa06asfe06ca0d394b2ba9@mail.gmail.com> <4A2035EA.9030208@redhat.com> <8a80e9760905291253x257a3cb0v4ae21eef39dcbc8f@mail.gmail.com> <4A203E2B.5060805@redhat.com> <8a80e9760905291303g1515a8fag5f764f09b5e5565@mail.gmail.com> <4A21FE85.1070000@redhat.com> <8a80e9760906010046s4eb754c2id0e24ae72f36d738@mail.gmail.com> <4A23CECF.7030807@redhat.com> Message-ID: <8a80e9760906010656m34bb0d70r83a089413a127ea@mail.gmail.com> Adding 192.168.1.202 actually got it all working and all pending queued tasks finished. Thanks a bunch for helping me out here :). But i have another strange thing seen in my taskomatic.log possibly of interest to you all. here's the snip http://ovirt.pastebin.com/m1cfa4aa9 1. Well this is for the Virtual machine i created as a PXE boot (choice for Operating System) . Logs indicating "Type object has no attribute 'seq'" were related to PXE boot as Operating System. 2. I choose Fedora (Cobbler image) but strangely i am not able to create a Virtual Machine with it. The Ajax window itself doesn't accept the parameters, window persists and i need to click the cancel button, is their anything that i need to do to fix it from the cobbler side. 3. I could only get the VM started if i only choose Operating System as HD. Regards -- Harshavardhana "Yantra Shilpi" Z Research Inc - http://www.zresearch.com On Mon, Jun 1, 2009 at 6:21 PM, Joey Boggs wrote: > Eveything looks configured correctly for dns to work however you're still > getting another nameserver which doesn't include the one we're injecting for > the admin interface which means NetworkManager is running somehow. Can you > verify NetworkManager is chkconfig'd off again and then try rebooting the > management box one more time. for a temporary solution you can add " > nameserver 192.168.1.202" into /etc/resolv.conf manually as the first entry > but when the dhcp address renews it will likely be overwritten. > > > > Harshavardhana wrote: > >> http://ovirt.pastebin.com/m47b15a94 here the requested information. Let >> me know anything else you need thanks. >> >> Regards >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sun, May 31, 2009 at 9:20 AM, Joey Boggs > jboggs at redhat.com>> wrote: >> >> can you post from the management server >> /usr/share/ace/appliances/ovirt/ovirt.pp and /etc/dhclient.conf >> to ovirt.pastebin.com Remove any >> passwords in that text prior to attaching for security reasons. >> >> >> >> Harshavardhana wrote: >> >> Current information >> >> 1. >> [root at management ovirt-server]# chkconfig --list | grep -i network >> NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off >> 6:off >> network 0:off 1:off 2:on 3:on 4:on 5:on >> 6:off >> [root at management ovirt-server]# >> >> 2. >> [root at management ovirt-server]# cat /etc/resolv.conf >> # Generated by NetworkManager >> >> >> # No nameservers found; try putting DNS servers into your >> # ifcfg files in /etc/sysconfig/network-scripts like so: >> # >> # DNS1=xxx.xxx.xxx.xxx >> # DNS2=xxx.xxx.xxx.xxx >> # DOMAIN=lab.foo.com >> bar.foo.com >> >> nameserver 192.168.1.1 >> [root at management ovirt-server]# >> >> 3. >> [root at management ovirt-server]# dig +short -t srv >> _ipa._tcp.ovirt.priv >> [root at management ovirt-server]# dig +short -t srv >> _qpidd._tcp.ovirt.priv >> [root at management ovirt-server]# >> >> Can i take this up in IRC if you all are online? >> >> Regards >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sat, May 30, 2009 at 1:27 AM, Joey Boggs > > >> wrote: >> >> >> that query will not work correctly, try these: >> >> dig +short -t srv _ipa._tcp.ovirt.priv >> dig +short -t srv _qpidd._tcp.ovirt.priv >> >> Also send you current /etc/resolv.conf again >> >> >> >> Harshavardhana wrote: >> >> nope still the same issue . Is there a way to fix these SRV >> records? >> >> i did a DNS lookup on the record >> >> [root at management ovirt-server]# dig -t SRV >> _qpidd._tcp,management.ovirt.priv,5672 >> >> ; <<>> DiG 9.5.1-P2-RedHat-9.5.1-2.P2.fc10 <<>> -t SRV >> _qpidd._tcp,management.ovirt.priv,5672 >> ;; global options: printcmd >> ;; Got answer: >> ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27980 >> ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, >> ADDITIONAL: 0 >> >> ;; QUESTION SECTION: >> ;_qpidd._tcp,management.ovirt.priv,5672. IN SRV >> >> ;; AUTHORITY SECTION: >> . 10726 IN SOA >> A.ROOT-SERVERS.NET >> >> . NSTLD.VERISIGN-GRS.COM >> >> >> . 2009052901 1800 900 >> 604800 86400 >> >> >> ;; Query time: 1 msec >> ;; SERVER: 192.168.1.1#53(192.168.1.1) >> ;; WHEN: Sat May 30 01:22:00 2009 >> ;; MSG SIZE rcvd: 131 >> >> [root at management ovirt-server]# >> >> does this help? >> >> Thanks >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sat, May 30, 2009 at 12:52 AM, Joey Boggs >> >> > >> >> >>> wrote: >> >> >> Looks like it's NetworkManager related, try this: >> chkconfig >> NetworkManager off, chkconfig network on then reboot >> server/node >> and recheck to see if you node comes up >> >> Harshavardhana wrote: >> >> Oops >> >> Management IP - 192.168.1.202 >> nameserver - 192.168.1.1 >> >> Regards >> -- Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Sat, May 30, 2009 at 12:47 AM, Joey Boggs >> >> > >> >> >> >> > > > >> >> >>>> wrote: >> >> My guess is that NetworkManager is in use, >> can you >> get the >> info I >> asked in the other email? >> >> Harshavardhana wrote: >> >> Installation is done by using >> ovirt-installer, seems >> all were >> automated. >> >> Regards >> -- >> Harshavardhana >> "Yantra Shilpi" >> Z Research Inc - http://www.zresearch.com >> >> >> >> On Fri, May 29, 2009 at 9:33 PM, Ian Main >> >> > >> >> >> >> > >> > >> >> >>> >> > > > >> >> >> >> >> > >> > >> >> >>>>> >> >> >> wrote: >> >> On Fri, 29 May 2009 00:09:27 +0530 >> Harshavardhana > >> > >> > > >> >> > >> > >> >> >>> >> > > > >> >> >> >> >> > >> > >> > >> > >>>>> wrote: >> >> > Hi David, >> > >> > Thanks a lot for the reply, but >> i have >> seen >> libvirt-qpidd >> to fail >> > during the ovirt-node image boot. So i >> guessed this is >> something >> related to >> > libvirt-qpid server not running. >> > >> > Regards >> >> It's probably failing for the same reason. >> You need to >> have DNS >> SRV records >> set up for various services in Ovirt >> so that it >> knows where to >> find them (host >> and port). >> >> Are you doing an install using the >> installer? Or >> trying to >> set it >> up by hand? >> >> Ian >> >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> >> > > >> > >> > >> >> > > > >> > >> > >>> >> > >> > > >> > >> > >> >> > > > >> > >> > >>>> >> >> >> >> https://www.redhat.com/mailman/listinfo/ovirt-devel >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> >> _______________________________________________ >> 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 imain at redhat.com Mon Jun 1 16:38:52 2009 From: imain at redhat.com (Ian Main) Date: Mon, 1 Jun 2009 09:38:52 -0700 Subject: [Ovirt-devel] [PATCH server] Fix arguments to factory. Message-ID: <1243874332-9238-1-git-send-email-imain@redhat.com> This patch fixes another set of calls to the libvirt factory that I had missed before. Signed-off-by: Ian Main --- src/task-omatic/task_storage.rb | 4 ++-- src/task-omatic/taskomatic.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/task-omatic/task_storage.rb b/src/task-omatic/task_storage.rb index bfffa36..77363ac 100644 --- a/src/task-omatic/task_storage.rb +++ b/src/task-omatic/task_storage.rb @@ -27,11 +27,11 @@ def String.random_alphanumeric(size=16) s end -def get_libvirt_lvm_pool_from_volume(db_volume) +def get_libvirt_lvm_pool_from_volume(db_volume, logger) phys_volume = StorageVolume.find(:first, :conditions => ["lvm_pool_id = ?", db_volume.storage_pool_id]) - return LibvirtPool.factory(phys_volume.storage_pool) + return LibvirtPool.factory(phys_volume.storage_pool, logger) end diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 1b4d83b..6e21160 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -202,7 +202,7 @@ class TaskOmatic # we have to special case LVM pools. In that case, we need to first # activate the underlying physical device, and then do the logical one if db_volume[:type] == "LvmStorageVolume" - phys_libvirt_pool = get_libvirt_lvm_pool_from_volume(db_volume) + phys_libvirt_pool = get_libvirt_lvm_pool_from_volume(db_volume, @logger) phys_libvirt_pool.connect(@session, node) end @@ -719,7 +719,7 @@ class TaskOmatic begin if db_volume[:type] == "LvmStorageVolume" - phys_libvirt_pool = get_libvirt_lvm_pool_from_volume(db_volume) + phys_libvirt_pool = get_libvirt_lvm_pool_from_volume(db_volume, @logger) phys_libvirt_pool.connect(@session, node) end @@ -783,7 +783,7 @@ class TaskOmatic begin if db_volume[:type] == "LvmStorageVolume" - phys_libvirt_pool = get_libvirt_lvm_pool_from_volume(db_volume) + phys_libvirt_pool = get_libvirt_lvm_pool_from_volume(db_volume, @logger) phys_libvirt_pool.connect(@session, node) @logger.info "connected to lvm pool.." end -- 1.6.0.6 From dpierce at redhat.com Mon Jun 1 16:53:33 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 1 Jun 2009 12:53:33 -0400 Subject: [Ovirt-devel] [PATCH node-image] Add auditd to the list of active services on the node. Message-ID: <1243875213-17812-1-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- common-install.ks | 2 +- common-pkgs.ks | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/common-install.ks b/common-install.ks index 975becd..a20a5b4 100644 --- a/common-install.ks +++ b/common-install.ks @@ -5,7 +5,7 @@ auth --useshadow --enablemd5 selinux --enforcing firewall --disabled part / --size 550 --fstype ext2 -services --enabled=ntpd,ntpdate,collectd,iptables,network,rsyslog,libvirt-qpid +services --enabled=auditd,ntpd,ntpdate,collectd,iptables,network,rsyslog,libvirt-qpid # This requires a new fixed version of livecd-creator to honor the --append settings. bootloader --timeout=30 --append="console=tty0 console=ttyS0,115200n8" diff --git a/common-pkgs.ks b/common-pkgs.ks index 3c6acd8..0731dc7 100644 --- a/common-pkgs.ks +++ b/common-pkgs.ks @@ -1,3 +1,4 @@ +audit bc kernel hwdata -- 1.6.0.6 From imain at redhat.com Mon Jun 1 17:45:00 2009 From: imain at redhat.com (Ian Main) Date: Mon, 1 Jun 2009 10:45:00 -0700 Subject: [Ovirt-devel] Storage problem latest build In-Reply-To: <51d1c06c0905310146x5dfc66acod9fc2bd36e841d95@mail.gmail.com> References: <51d1c06c0905310146x5dfc66acod9fc2bd36e841d95@mail.gmail.com> Message-ID: <20090601104500.42f8421c@tp.mains.net> On Sun, 31 May 2009 10:46:58 +0200 Freddy Stutterheim wrote: > I just build the latest ovirt from git and have a problem with storage now. > Creating the storage pool works but when i try to add a volume i get > "Pending_setup" and then in tasks "wrong number of arguments (1 for 2)". > > taskomatic log shows : > > ERROR Sun May 31 10:30:37 +0200 2009 (28807) Task action processing failed: > ArgumentError: wrong number of arguments (1 for 2) > ERROR Sun May 31 10:30:37 +0200 2009 (28807) > /usr/share/ovirt-server/task-omatic/./task_storage.rb:34:in > `factory'/usr/share/ovirt-server/task-omatic/./task_storage.rb:34:in > `get_libvirt_lvm_pool_from_volume'/usr/share/ovirt-server/task-omatic/taskomatic.rb:722:in So we have this fixed now hey Freddy? Ian From fstutter at gmail.com Mon Jun 1 17:53:56 2009 From: fstutter at gmail.com (Freddy Stutterheim) Date: Mon, 1 Jun 2009 19:53:56 +0200 Subject: [Ovirt-devel] Storage problem latest build Message-ID: <51d1c06c0906011053s7786335byfe9297a6ad6122b4@mail.gmail.com> All fixt and ready to go! Freddy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmorsi at redhat.com Mon Jun 1 15:35:40 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 1 Jun 2009 11:35:40 -0400 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes Message-ID: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> - perform dns lookup on hostname, - randomize local tunnel port - simple autobuild script - bump rpm spec version --- autobuild.sh | 41 +++++++++++++++++++++++++++++++++++++++++ main.c | 14 +++++--------- ovirt-viewer.spec | 9 ++++++++- tunnel.c | 29 ++++++++++++++++++++--------- 4 files changed, 74 insertions(+), 19 deletions(-) create mode 100755 autobuild.sh diff --git a/autobuild.sh b/autobuild.sh new file mode 100755 index 0000000..a646a83 --- /dev/null +++ b/autobuild.sh @@ -0,0 +1,41 @@ +#!/bin/sh +#oVirt viewer autobuild script +# +# Copyright (C) 2008 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +echo "Running oVirt viewer Autobuild" + +set -e +set -v + +test -f Makefile && make -k distclean || : + +./autogen.sh +./configure --prefix=$AUTOBUILD_INSTALL_ROOT +make + +if [ -f /usr/bin/rpmbuild ]; then + if [ -n "$AUTOBUILD_COUNTER" ]; then + EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" + else + NOW=`date +"%s"` + EXTRA_RELEASE=".$USER$NOW" + fi + + rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ba ovirt-viewer.spec +fi diff --git a/main.c b/main.c index 2962f3f..222a9fd 100644 --- a/main.c +++ b/main.c @@ -36,6 +36,8 @@ #include #endif +#include + #ifdef HAVE_SYS_SOCKET_H #include #endif @@ -903,13 +905,12 @@ viewer_credential (GtkWidget *vnc, GValueArray *credList) gtk_widget_destroy(GTK_WIDGET(dialog)); } -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) static int viewer_open_vnc_socket(const char* vnchost, int vncport) { int socketfd; - struct hostent *serv; struct sockaddr_in serv_addr; socketfd = socket(PF_INET, SOCK_STREAM, 0); @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) return -1; } - serv = gethostbyname(vnchost); - if(serv == NULL){ - return -1; - } - serv_addr.sin_family = PF_INET; serv_addr.sin_port = htons(vncport); - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; + serv_addr.sin_addr.s_addr = inet_addr(vnchost); if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ return -1; @@ -933,7 +929,7 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) return socketfd; } -#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) */ +#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) */ /* Remove all menu items from the Connect menu. */ static void diff --git a/ovirt-viewer.spec b/ovirt-viewer.spec index a320ecd..a4d826e 100644 --- a/ovirt-viewer.spec +++ b/ovirt-viewer.spec @@ -2,7 +2,7 @@ Name: ovirt-viewer Version: 1.0.0 -Release: 2%{?dist} +Release: 4%{?dist} Summary: ovirt-viewer is a vnc viewer for ovirt managed vms Group: Applications/System @@ -61,6 +61,13 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/ovirt-viewer %changelog +* Mon Jun 01 2009 - 1.0.0-4 +- bugfixes, dns lookup and local tunnel port assignment + +* Wed May 20 2009 - 1.0.0-3 +- changes to viewer to connect to ovirt server + through vnc proxy + * Thu Apr 30 2009 - 1.0.0-2 - ssl support, see check-certificate cmd line flag - wire up send key menu diff --git a/tunnel.c b/tunnel.c index a03ef0b..c6d091d 100644 --- a/tunnel.c +++ b/tunnel.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -46,9 +47,6 @@ /* constants */ -// port to try to listen on, if we can't, increment until we find one we can -const int PORT_RANGE_START = 5600; - // max length of a vm name const int VM_NAME_MAX_LEN = 250; @@ -137,6 +135,8 @@ stop_tunnel(void) static gpointer tunnel_thread (gpointer _data) { + struct hostent *dns_serv; + //char vm_data[VM_NAME_MAX_LEN]; int local_server_socketfd, ovirt_server_socket, client_socketfd; unsigned int local_server_len, client_len, ovirt_server_len; @@ -145,6 +145,9 @@ tunnel_thread (gpointer _data) struct sockaddr_in ovirt_server_address; struct sockaddr_in client_address; + struct sockaddr_in local_server_address_lookup; + unsigned int local_server_address_lookup_len = sizeof(local_server_address_lookup); + GThread *client_server_gthread = NULL; GThread *server_client_gthread = NULL; @@ -154,8 +157,13 @@ tunnel_thread (gpointer _data) DEBUG ("tunnel thread starting up"); // ovirt server address + dns_serv = gethostbyname(hostname); + if(dns_serv == NULL){ + DEBUG("ovirt server lookup failed"); + return NULL; + } ovirt_server_address.sin_family = PF_INET; - ovirt_server_address.sin_addr.s_addr = inet_addr(hostname); + ovirt_server_address.sin_addr.s_addr = ((struct in_addr*)(dns_serv->h_addr))->s_addr; //inet_addr(hostname); ovirt_server_address.sin_port = htons(OVIRT_SERVER_PORT); ovirt_server_len = sizeof(ovirt_server_address); @@ -165,18 +173,21 @@ tunnel_thread (gpointer _data) sockets = g_slist_prepend(sockets, c_socket); // local server address - tunnel_port = PORT_RANGE_START; local_server_address.sin_family = PF_INET; local_server_address.sin_addr.s_addr = inet_addr("127.0.0.1"); - local_server_address.sin_port = htons(tunnel_port); + local_server_address.sin_port = 0; local_server_len = sizeof(local_server_address); // increment ports until one is available - while(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ - tunnel_port += 1; - local_server_address.sin_port += htons(tunnel_port); + if(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ + DEBUG("tunnel bind failed"); + return NULL; } + getsockname(local_server_socketfd, + (struct sockaddr*) &local_server_address_lookup, + &local_server_address_lookup_len); + tunnel_port = (int)ntohs(local_server_address_lookup.sin_port); DEBUG ("tunnel bound to local port %i", tunnel_port); // increase client buffer size? -- 1.6.0.6 From berrange at redhat.com Mon Jun 1 19:39:31 2009 From: berrange at redhat.com (Daniel P. Berrange) Date: Mon, 1 Jun 2009 20:39:31 +0100 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes In-Reply-To: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> References: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> Message-ID: <20090601193931.GA29933@redhat.com> On Mon, Jun 01, 2009 at 11:35:40AM -0400, Mohammed Morsi wrote: > + > +test -f Makefile && make -k distclean || : > + > +./autogen.sh > +./configure --prefix=$AUTOBUILD_INSTALL_ROOT Normally autogen.sh will run configure for you ? If the ovirt-viewer script does, then you can just pass the --prefix arg straight to autogen.sh and script configure > -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) > +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) > > static int > viewer_open_vnc_socket(const char* vnchost, int vncport) > { > int socketfd; > - struct hostent *serv; > struct sockaddr_in serv_addr; > > socketfd = socket(PF_INET, SOCK_STREAM, 0); > @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) > return -1; > } > > - serv = gethostbyname(vnchost); > - if(serv == NULL){ > - return -1; > - } > - > serv_addr.sin_family = PF_INET; > serv_addr.sin_port = htons(vncport); > - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; > + serv_addr.sin_addr.s_addr = inet_addr(vnchost); > > if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ > return -1; > @@ -933,7 +929,7 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) > return socketfd; > } This method should really be re-written to just use getaddrinfo() for lookups. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| From berrange at redhat.com Mon Jun 1 19:43:07 2009 From: berrange at redhat.com (Daniel P. Berrange) Date: Mon, 1 Jun 2009 20:43:07 +0100 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes In-Reply-To: <20090601193931.GA29933@redhat.com> References: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> <20090601193931.GA29933@redhat.com> Message-ID: <20090601194307.GB29933@redhat.com> On Mon, Jun 01, 2009 at 08:39:31PM +0100, Daniel P. Berrange wrote: > On Mon, Jun 01, 2009 at 11:35:40AM -0400, Mohammed Morsi wrote: > > + > > +test -f Makefile && make -k distclean || : > > + > > +./autogen.sh > > +./configure --prefix=$AUTOBUILD_INSTALL_ROOT > > Normally autogen.sh will run configure for you ? If the > ovirt-viewer script does, then you can just pass the > --prefix arg straight to autogen.sh and script configure s/script/skip/ Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| From mmorsi at redhat.com Mon Jun 1 16:38:50 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 1 Jun 2009 12:38:50 -0400 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes Message-ID: <1243874330-5727-1-git-send-email-mmorsi@redhat.com> - perform dns lookup on hostname, - randomize local tunnel port - bump rpm spec version --- main.c | 14 +++++--------- ovirt-viewer.spec | 9 ++++++++- tunnel.c | 29 ++++++++++++++++++++--------- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/main.c b/main.c index 2962f3f..222a9fd 100644 --- a/main.c +++ b/main.c @@ -36,6 +36,8 @@ #include #endif +#include + #ifdef HAVE_SYS_SOCKET_H #include #endif @@ -903,13 +905,12 @@ viewer_credential (GtkWidget *vnc, GValueArray *credList) gtk_widget_destroy(GTK_WIDGET(dialog)); } -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) static int viewer_open_vnc_socket(const char* vnchost, int vncport) { int socketfd; - struct hostent *serv; struct sockaddr_in serv_addr; socketfd = socket(PF_INET, SOCK_STREAM, 0); @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) return -1; } - serv = gethostbyname(vnchost); - if(serv == NULL){ - return -1; - } - serv_addr.sin_family = PF_INET; serv_addr.sin_port = htons(vncport); - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; + serv_addr.sin_addr.s_addr = inet_addr(vnchost); if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ return -1; @@ -933,7 +929,7 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) return socketfd; } -#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) */ +#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) */ /* Remove all menu items from the Connect menu. */ static void diff --git a/ovirt-viewer.spec b/ovirt-viewer.spec index a320ecd..a4d826e 100644 --- a/ovirt-viewer.spec +++ b/ovirt-viewer.spec @@ -2,7 +2,7 @@ Name: ovirt-viewer Version: 1.0.0 -Release: 2%{?dist} +Release: 4%{?dist} Summary: ovirt-viewer is a vnc viewer for ovirt managed vms Group: Applications/System @@ -61,6 +61,13 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/ovirt-viewer %changelog +* Mon Jun 01 2009 - 1.0.0-4 +- bugfixes, dns lookup and local tunnel port assignment + +* Wed May 20 2009 - 1.0.0-3 +- changes to viewer to connect to ovirt server + through vnc proxy + * Thu Apr 30 2009 - 1.0.0-2 - ssl support, see check-certificate cmd line flag - wire up send key menu diff --git a/tunnel.c b/tunnel.c index a03ef0b..c6d091d 100644 --- a/tunnel.c +++ b/tunnel.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -46,9 +47,6 @@ /* constants */ -// port to try to listen on, if we can't, increment until we find one we can -const int PORT_RANGE_START = 5600; - // max length of a vm name const int VM_NAME_MAX_LEN = 250; @@ -137,6 +135,8 @@ stop_tunnel(void) static gpointer tunnel_thread (gpointer _data) { + struct hostent *dns_serv; + //char vm_data[VM_NAME_MAX_LEN]; int local_server_socketfd, ovirt_server_socket, client_socketfd; unsigned int local_server_len, client_len, ovirt_server_len; @@ -145,6 +145,9 @@ tunnel_thread (gpointer _data) struct sockaddr_in ovirt_server_address; struct sockaddr_in client_address; + struct sockaddr_in local_server_address_lookup; + unsigned int local_server_address_lookup_len = sizeof(local_server_address_lookup); + GThread *client_server_gthread = NULL; GThread *server_client_gthread = NULL; @@ -154,8 +157,13 @@ tunnel_thread (gpointer _data) DEBUG ("tunnel thread starting up"); // ovirt server address + dns_serv = gethostbyname(hostname); + if(dns_serv == NULL){ + DEBUG("ovirt server lookup failed"); + return NULL; + } ovirt_server_address.sin_family = PF_INET; - ovirt_server_address.sin_addr.s_addr = inet_addr(hostname); + ovirt_server_address.sin_addr.s_addr = ((struct in_addr*)(dns_serv->h_addr))->s_addr; //inet_addr(hostname); ovirt_server_address.sin_port = htons(OVIRT_SERVER_PORT); ovirt_server_len = sizeof(ovirt_server_address); @@ -165,18 +173,21 @@ tunnel_thread (gpointer _data) sockets = g_slist_prepend(sockets, c_socket); // local server address - tunnel_port = PORT_RANGE_START; local_server_address.sin_family = PF_INET; local_server_address.sin_addr.s_addr = inet_addr("127.0.0.1"); - local_server_address.sin_port = htons(tunnel_port); + local_server_address.sin_port = 0; local_server_len = sizeof(local_server_address); // increment ports until one is available - while(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ - tunnel_port += 1; - local_server_address.sin_port += htons(tunnel_port); + if(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ + DEBUG("tunnel bind failed"); + return NULL; } + getsockname(local_server_socketfd, + (struct sockaddr*) &local_server_address_lookup, + &local_server_address_lookup_len); + tunnel_port = (int)ntohs(local_server_address_lookup.sin_port); DEBUG ("tunnel bound to local port %i", tunnel_port); // increase client buffer size? -- 1.6.0.6 From mmorsi at redhat.com Mon Jun 1 16:39:00 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 1 Jun 2009 12:39:00 -0400 Subject: [Ovirt-devel] [PATCH viewer] ovirt viewer autobuild.sh Message-ID: <1243874340-5752-1-git-send-email-mmorsi@redhat.com> --- autobuild.sh | 40 +++++++++++++++++++++++++++++++++++ autogen.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 0 deletions(-) create mode 100755 autobuild.sh diff --git a/autobuild.sh b/autobuild.sh new file mode 100755 index 0000000..8a90a78 --- /dev/null +++ b/autobuild.sh @@ -0,0 +1,40 @@ +#!/bin/sh +#oVirt viewer autobuild script +# +# Copyright (C) 2008 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +echo "Running oVirt viewer Autobuild" + +set -e +set -v + +test -f Makefile && make -k distclean || : + +./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT +make + +if [ -f /usr/bin/rpmbuild ]; then + if [ -n "$AUTOBUILD_COUNTER" ]; then + EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER" + else + NOW=`date +"%s"` + EXTRA_RELEASE=".$USER$NOW" + fi + + rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ba ovirt-viewer.spec +fi diff --git a/autogen.sh b/autogen.sh index c7df22c..a731af4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,3 +1,68 @@ #!/bin/sh +# Run this to generate configure and Makefile + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + autoreconf --force --install -I config -I m4 +THEDIR=`pwd` +( + cd $srcdir + die=0 + + (autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/autoconf" + die=1 + } + + # Require libtool only if one of of LT_INIT, + # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac. + grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \ + && { + (libtool --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have libtool installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/libtool" + die=1 + } + } + + (automake --version) < /dev/null > /dev/null 2>&1 || { + echo + die=1 + echo "You must have automake installed." + echo "Download the appropriate package for your distribution," + echo "or see http://www.gnu.org/software/automake" + } + + test $die = 1 && exit 1 + + test -f ovirt-viewer.spec || { + echo "You must run this script in the top-level directory" + exit 1 + } + + if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi + + aclocal + + # Run autoheader only if needed + grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader + + automake --add-missing + autoconf + ./configure "$@" +) + +if test "x$OBJ_DIR" != x; then + mkdir -p "$OBJ_DIR" + cd "$OBJ_DIR" +fi -- 1.6.0.6 From mmorsi at redhat.com Mon Jun 1 20:42:08 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 01 Jun 2009 16:42:08 -0400 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes In-Reply-To: <20090601193931.GA29933@redhat.com> References: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> <20090601193931.GA29933@redhat.com> Message-ID: <4A243D20.3070905@redhat.com> Daniel P. Berrange wrote: > On Mon, Jun 01, 2009 at 11:35:40AM -0400, Mohammed Morsi wrote: > >> + >> +test -f Makefile && make -k distclean || : >> + >> +./autogen.sh >> +./configure --prefix=$AUTOBUILD_INSTALL_ROOT >> > > Normally autogen.sh will run configure for you ? If the > ovirt-viewer script does, then you can just pass the > --prefix arg straight to autogen.sh and script configure > > > Right now the viewer autogen doesn't do much other than running autoreconf to generate the necessary input files. I've split this bit out into a separate patch w/ changes to autogen to bring it more inline w/ the other projects (and resent the original without it). >> -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) >> +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) >> >> static int >> viewer_open_vnc_socket(const char* vnchost, int vncport) >> { >> int socketfd; >> - struct hostent *serv; >> struct sockaddr_in serv_addr; >> >> socketfd = socket(PF_INET, SOCK_STREAM, 0); >> @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) >> return -1; >> } >> >> - serv = gethostbyname(vnchost); >> - if(serv == NULL){ >> - return -1; >> - } >> - >> serv_addr.sin_family = PF_INET; >> serv_addr.sin_port = htons(vncport); >> - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; >> + serv_addr.sin_addr.s_addr = inet_addr(vnchost); >> >> if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ >> return -1; >> @@ -933,7 +929,7 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) >> return socketfd; >> } >> > > > This method should really be re-written to just use getaddrinfo() for > lookups. > > > Daniel > Not sure what using getaddrinfo gets us here, we're just trying to connect to the hostname / port that we already have. In any case what would be setting the service parameter to, since the port which we are connecting is the autogenerated local tunnel port. -Mo From berrange at redhat.com Tue Jun 2 10:20:39 2009 From: berrange at redhat.com (Daniel P. Berrange) Date: Tue, 2 Jun 2009 11:20:39 +0100 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes In-Reply-To: <4A243D20.3070905@redhat.com> References: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> <20090601193931.GA29933@redhat.com> <4A243D20.3070905@redhat.com> Message-ID: <20090602102039.GK13423@redhat.com> On Mon, Jun 01, 2009 at 04:42:08PM -0400, Mohammed Morsi wrote: > >> -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) > >> +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) > >> > >> static int > >> viewer_open_vnc_socket(const char* vnchost, int vncport) > >> { > >> int socketfd; > >> - struct hostent *serv; > >> struct sockaddr_in serv_addr; > >> > >> socketfd = socket(PF_INET, SOCK_STREAM, 0); > >> @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) > >> return -1; > >> } > >> > >> - serv = gethostbyname(vnchost); > >> - if(serv == NULL){ > >> - return -1; > >> - } > >> - > >> serv_addr.sin_family = PF_INET; > >> serv_addr.sin_port = htons(vncport); > >> - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; > >> + serv_addr.sin_addr.s_addr = inet_addr(vnchost); > >> > >> if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ > >> return -1; > >> @@ -933,7 +929,7 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) > >> return socketfd; > >> } > >> > > > > > > This method should really be re-written to just use getaddrinfo() for > > lookups. > > > Not sure what using getaddrinfo gets us here, we're just trying to > connect to the hostname / port that we already have. In any case what > would be setting the service parameter to, since the port which we are > connecting is the autogenerated local tunnel port. Re-factoring code which uses gethostbyname() is just shifting deck-chairs on the titanic. Sooner or later it will need to die and use getaddrinfo(). Even for your mere 'localhost' case, it would work better because it would correctly return either IPv4 (127.0.0.1) or IPv6 (::1) or both, sorted according to which protocols were enabled on the machine in question. It is just wasted development effort to write code which uses anything else these days. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| From mmorsi at redhat.com Tue Jun 2 15:45:14 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Tue, 02 Jun 2009 11:45:14 -0400 Subject: [Ovirt-devel] [PATCH viewer] few minor bugfixes In-Reply-To: <20090602102039.GK13423@redhat.com> References: <1243870540-4153-1-git-send-email-mmorsi@redhat.com> <20090601193931.GA29933@redhat.com> <4A243D20.3070905@redhat.com> <20090602102039.GK13423@redhat.com> Message-ID: <4A25490A.4030406@redhat.com> Daniel P. Berrange wrote: > On Mon, Jun 01, 2009 at 04:42:08PM -0400, Mohammed Morsi wrote: > >>>> -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) >>>> +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) >>>> >>>> static int >>>> viewer_open_vnc_socket(const char* vnchost, int vncport) >>>> { >>>> int socketfd; >>>> - struct hostent *serv; >>>> struct sockaddr_in serv_addr; >>>> >>>> socketfd = socket(PF_INET, SOCK_STREAM, 0); >>>> @@ -917,14 +918,9 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) >>>> return -1; >>>> } >>>> >>>> - serv = gethostbyname(vnchost); >>>> - if(serv == NULL){ >>>> - return -1; >>>> - } >>>> - >>>> serv_addr.sin_family = PF_INET; >>>> serv_addr.sin_port = htons(vncport); >>>> - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; >>>> + serv_addr.sin_addr.s_addr = inet_addr(vnchost); >>>> >>>> if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ >>>> return -1; >>>> @@ -933,7 +929,7 @@ viewer_open_vnc_socket(const char* vnchost, int vncport) >>>> return socketfd; >>>> } >>>> >>>> >>> This method should really be re-written to just use getaddrinfo() for >>> lookups. >>> >>> >> Not sure what using getaddrinfo gets us here, we're just trying to >> connect to the hostname / port that we already have. In any case what >> would be setting the service parameter to, since the port which we are >> connecting is the autogenerated local tunnel port. >> > > Re-factoring code which uses gethostbyname() is just shifting deck-chairs > on the titanic. Sooner or later it will need to die and use getaddrinfo(). > Even for your mere 'localhost' case, it would work better because it > would correctly return either IPv4 (127.0.0.1) or IPv6 (::1) or both, > sorted according to which protocols were enabled on the machine in question. > It is just wasted development effort to write code which uses anything else > these days. > > Daniel > I'm still not fully sure why we need the call to getaddrinfo when we already have and are using the ip address and port which to connect to. We are using the actual '127.0.0.1' ip as opposed to the 'localhost' dns name, so we should be safe when it comes to resolving the correct target. Regardless, I've no objections to adding getaddrinfo to only get the list of addrinfo's for the matching targets on the machine, but I'm still uncertain as to what the string "service" would be, as how we can derive that from the int "port" variable that we have (do we simple sscanf the int into the string to pass in?) Appreciate the help, -Mo From dpierce at redhat.com Tue Jun 2 15:40:17 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 2 Jun 2009 11:40:17 -0400 Subject: [Ovirt-devel] [PATCH node-image] Removes kvm and kvm-utils. Message-ID: <1243957217-16865-1-git-send-email-dpierce@redhat.com> This patch makes node-image buildable under F11. Signed-off-by: Darryl L. Pierce --- common-pkgs.ks | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/common-pkgs.ks b/common-pkgs.ks index 3c6acd8..c7a714b 100644 --- a/common-pkgs.ks +++ b/common-pkgs.ks @@ -7,7 +7,6 @@ rootfiles dhclient openssh-clients openssh-server -kvm ovirt-node-stateless ovirt-node-selinux ovirt-node-logos @@ -34,7 +33,6 @@ pciutils numactl file lsof -kvm-tools #remove -audit-libs-python -ustr -- 1.6.2.2 From imain at redhat.com Tue Jun 2 16:08:48 2009 From: imain at redhat.com (Ian Main) Date: Tue, 2 Jun 2009 09:08:48 -0700 Subject: [Ovirt-devel] Problems Configuring Ovirt In-Reply-To: <8a80e9760906010656m34bb0d70r83a089413a127ea@mail.gmail.com> References: <8a80e9760905250505he39b789w43206daca2773db5@mail.gmail.com> <4A2034E4.9070807@redhat.com> <8a80e9760905291219v382aa06asfe06ca0d394b2ba9@mail.gmail.com> <4A2035EA.9030208@redhat.com> <8a80e9760905291253x257a3cb0v4ae21eef39dcbc8f@mail.gmail.com> <4A203E2B.5060805@redhat.com> <8a80e9760905291303g1515a8fag5f764f09b5e5565@mail.gmail.com> <4A21FE85.1070000@redhat.com> <8a80e9760906010046s4eb754c2id0e24ae72f36d738@mail.gmail.com> <4A23CECF.7030807@redhat.com> <8a80e9760906010656m34bb0d70r83a089413a127ea@mail.gmail.com> Message-ID: <20090602090848.1a9272ff@tp.mains.net> On Mon, 1 Jun 2009 19:26:13 +0530 Harshavardhana wrote: > Adding 192.168.1.202 actually got it all working and all pending queued > tasks finished. Thanks a bunch for helping me out here :). > > But i have another strange thing seen in my taskomatic.log possibly of > interest to you all. > > here's the snip > > http://ovirt.pastebin.com/m1cfa4aa9 > > 1. Well this is for the Virtual machine i created as a PXE boot (choice for > Operating System) . Logs indicating "Type object has no attribute 'seq'" > were related to PXE boot as Operating System. This is an error in QMF that occurs when a timeout exception happens. In other words QMF timed out while trying to connect to the storage pool. This should be fixed in the latest version in git where I've added longer timeouts so you can see the real error produced. The crux of it is there is some problem with one of the storage pools being configured for that VM. If you go onto the node and try it you will see the real error from libvirt in /var/log/messages. Ian From harsha at gluster.com Wed Jun 3 05:43:44 2009 From: harsha at gluster.com (Harshavardhana) Date: Wed, 3 Jun 2009 11:13:44 +0530 Subject: [Ovirt-devel] Problems Configuring Ovirt In-Reply-To: <20090602090848.1a9272ff@tp.mains.net> References: <8a80e9760905250505he39b789w43206daca2773db5@mail.gmail.com> <4A2035EA.9030208@redhat.com> <8a80e9760905291253x257a3cb0v4ae21eef39dcbc8f@mail.gmail.com> <4A203E2B.5060805@redhat.com> <8a80e9760905291303g1515a8fag5f764f09b5e5565@mail.gmail.com> <4A21FE85.1070000@redhat.com> <8a80e9760906010046s4eb754c2id0e24ae72f36d738@mail.gmail.com> <4A23CECF.7030807@redhat.com> <8a80e9760906010656m34bb0d70r83a089413a127ea@mail.gmail.com> <20090602090848.1a9272ff@tp.mains.net> Message-ID: <8a80e9760906022243j4c8b2353r3ab64f52b48aba10@mail.gmail.com> On Tue, Jun 2, 2009 at 9:38 PM, Ian Main wrote: > On Mon, 1 Jun 2009 19:26:13 +0530 > Harshavardhana wrote: > > > Adding 192.168.1.202 actually got it all working and all pending queued > > tasks finished. Thanks a bunch for helping me out here :). > > > > But i have another strange thing seen in my taskomatic.log possibly of > > interest to you all. > > > > here's the snip > > > > http://ovirt.pastebin.com/m1cfa4aa9 > > > > 1. Well this is for the Virtual machine i created as a PXE boot (choice > for > > Operating System) . Logs indicating "Type object has no attribute 'seq'" > > were related to PXE boot as Operating System. > > This is an error in QMF that occurs when a timeout exception happens. In > other > words QMF timed out while trying to connect to the storage pool. This > should be fixed in the latest version in git where I've added longer > timeouts > so you can see the real error produced. > > The crux of it is there is some problem with one of the storage pools being > configured for that VM. If you go onto the node and try it you will see > the > real error from libvirt in /var/log/messages. > > Ian > Hi Ian, OK thanks. An Inquiry! like i added a image through Cobbler Webui, now i am surprised to see even with "VmController#create" in rails.log and the action of creating a VM is taken care the Ajax window is still there waiting. If i had to choose with PXE boot or HD both works, is it something related to my cobbler setup?. Regards -- Harshavardhana "Yantra Shilpi" Z Research Inc - http://www.zresearch.com > > _______________________________________________ > 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 dpierce at redhat.com Wed Jun 3 17:56:28 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Jun 2009 13:56:28 -0400 Subject: [Ovirt-devel] [PATCH node] Checks if storage is setup before setting the admin password. BZ#509339 Message-ID: <1244051788-29298-1-git-send-email-dpierce@redhat.com> When the o-c-password script starts, it checks to see if there's a Config logical volume. If there is not one, then it assumes local storage is not configured and exits the script with a warning message. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-password | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password index 7abfb3b..45b5d8c 100755 --- a/scripts/ovirt-config-password +++ b/scripts/ovirt-config-password @@ -8,6 +8,13 @@ trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +warn() { printf '%s\n' "$*" >&2; } + +if [[ ! "Config" =~ $(lvdisplay -C | awk '{ print $1 }') ]]; then + warn "Local storage must be configured prior to setting the administrator password." + exit 99 +fi + # Usage: set_sasl_password USER # Prompt(twice) for a password for the specified USER. # If they match, set that user's system password, -- 1.6.0.6 From dpierce at redhat.com Wed Jun 3 18:45:33 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Jun 2009 14:45:33 -0400 Subject: [Ovirt-devel] [PATCH node] Adds support for a using default storage configuration. bz#503997 Message-ID: <1244054733-11882-1-git-send-email-dpierce@redhat.com> When the user selects to configure storage, after they select a drive (or the only storage device is pre-selected), they are shown the default storage configuration layout. They are then asked if they wish to use that default configuration or configure things manually. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-storage | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 356b7df..0fcc0bc 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -204,6 +204,13 @@ do_configure() printf "* For the Data partition, a size of -1 indicates that the\n" printf " partition should use up the remaining space on the disk.\n\n" + do_review + read -ep "Use these default values? (Y/n) " + + case $REPLY in + Y|y) return;; + esac + local space_left=$SPACE for part in boot swap root config logging data ; do part_regexp="^0$" -- 1.6.0.6 From mmorsi at redhat.com Wed Jun 3 20:00:12 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Wed, 3 Jun 2009 16:00:12 -0400 Subject: [Ovirt-devel] [PATCH server] ovirt server installer autobuild integration Message-ID: <1244059212-5891-1-git-send-email-mmorsi@redhat.com> update server autobuild to set up a new isolated vm environment and go through the server installer process and rails tests --- autobuild.sh | 65 ++++++++++++++++++++++++++++++++++++++++++ ovirt-installer-test-answers | 21 +++++++++++++ ovirt-server-test.ks | 37 ++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 0 deletions(-) create mode 100644 ovirt-installer-test-answers create mode 100644 ovirt-server-test.ks diff --git a/autobuild.sh b/autobuild.sh index 2cc11d6..66a5167 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -25,10 +25,13 @@ set -v test -f Makefile && make -k distclean || : +############# build the server rpm + # put rails in development mode cp conf/ovirt-rails.sysconf conf/ovirt-rails.sysconf.orig echo "RAILS_ENV=development" >> conf/ovirt-rails.sysconf +# build server & installer rpms ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT make dist @@ -43,4 +46,66 @@ if [ -f /usr/bin/rpmbuild ]; then rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz fi +# restore to checkout mv conf/ovirt-rails.sysconf.orig conf/ovirt-rails.sysconf + +############## setup new vm to test installer + +# setup parameters to ssh to vm +SSHKEY=~/.ssh/id_autobuild +remote_target="root at 192.168.122.190" # should be an address on default libvirt network +ssh_cmd="ssh -i $SSHKEY -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null $remote_target" +scp_cmd="scp -i $SSHKEY -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + +# generate new ssh key if not found +if [ ! -r $SSHKEY ]; then + mkdir -p $(dirname "$SSHKEY") + ssh-keygen -q -t rsa -N "" -f $SSHKEY +fi + +# copy the key and installer answers to the kickstart +cp ovirt-server-test.ks ovirt-server-test.ks.orig +cat >> ovirt-server-test.ks << KS +%post +mkdir -p /root/.ssh +chmod 700 /root/.ssh +cat > /root/.ssh/authorized_keys << \EOF +$(ssh-keygen -y -f $SSHKEY) +EOF +chmod 600 /root/.ssh/authorized_keys + +cat > /root/ovirt-installer-answers << \EOF +$(cat ovirt-installer-test-answers) +EOF + +%end +KS + +# remove old server vm +test ! -f ovirt-server-test.tar || rm -f ovirt-server-test.tar +test ! -d test-vm || rm -rf test-vm +sudo virsh destroy ovirt-server-test || true +sudo virsh undefine ovirt-server-test || true + +# create new vm for server, configuring via kickstart, boot it +sudo appliance-creator --config ovirt-server-test.ks --name ovirt-server-test \ + -f qcow2 -p tar -d -v + +# restore original kickstart +mv ovirt-server-test.ks.orig ovirt-server-test.ks + +# define the libvirt vm, boot it +mkdir -p test-vm +tar -xSvf ovirt-server-test.tar -C test-vm +sudo virt-image test-vm/ovirt-server-test/ovirt-server-test.xml +sudo virsh define /etc/libvirt/qemu/ovirt-server-test.xml + +################### test server vm + +# run installer on server vm, answering preconfigured questions +$ssh_cmd "ovirt-installer < /root/ovirt-installer-answers" +$ssh_cmd "ace -d install ovirt" + +# run tests on newly installed server +$ssh_cmd "cd /usr/share/ovirt-server && rake db:migrate && rake test" diff --git a/ovirt-installer-test-answers b/ovirt-installer-test-answers new file mode 100644 index 0000000..6827360 --- /dev/null +++ b/ovirt-installer-test-answers @@ -0,0 +1,21 @@ +y +eth0 +eth0 +management.ovirtautobuild.com +n +n +192.168.134 +3 +50 +ovirtautobuild.com +192.168.134.1 +y +n +cobbler +cobbler +cobbler +v23zj59an +v23zj59an +ovirtautobuild.com +ovirt +ovirt diff --git a/ovirt-server-test.ks b/ovirt-server-test.ks new file mode 100644 index 0000000..c30ed5a --- /dev/null +++ b/ovirt-server-test.ks @@ -0,0 +1,37 @@ +install + +lang en_US.UTF-8 +keyboard us +# should have address on default libvirt network +network --device=eth0 --bootproto=static --ip=192.168.122.190 --netmask=255.255.255.0 --onboot=on --nameserver=192.168.122.1 --gateway=192.168.122.1 +# Root password is 'ovirt' +rootpw --iscrypted Xa8QeYfWrtscM +firewall --disabled +authconfig --enableshadow --enablemd5 +selinux --disabled +# NOTE: ntp/ntpdate need to stay in this list to ensure that time on the +# appliance is correct prior to the ovirt-server-installer being run. Otherwise you +# get Kerberos errors +services --disabled=libvirtd,postgresql --enabled=network,iptables,ntpdate,acpid,sshd +timezone --utc UTC +text + +bootloader --location=mbr --driveorder=sda --append="console=tty0" +zerombr +clearpart --all --drives=sda +part /boot --ondisk=sda --fstype=ext3 --size=100 +part / --ondisk=sda --fstype=ext3 --size=5000 +part swap --ondisk=sda --fstype=swap --size=512 +reboot + +repo --name=f10 --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-10&arch=x86_64 +repo --name=ovirt-org --baseurl=http://ovirt.org/repos/ovirt/10/x86_64 +repo --name=f10-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f10&arch=x86_64 +repo --name=ovirt-local --baseurl=file:///var/lib/builder/ovirt/package-root/rpm + +%packages --excludedocs --nobase +%include /usr/share/appliance-os/includes/base-pkgs.ks +openssh-server +ovirt-server +ovirt-server-installer +ovirt-node-image-pxe -- 1.6.0.6 From apevec at gmail.com Wed Jun 3 21:32:41 2009 From: apevec at gmail.com (Alan Pevec) Date: Wed, 3 Jun 2009 23:32:41 +0200 Subject: [Ovirt-devel] [PATCH node] Adds support for a using default storage configuration. bz#503997 In-Reply-To: <1244054733-11882-1-git-send-email-dpierce@redhat.com> References: <1244054733-11882-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0906031432i382dcefdg25b56b6585afe50d@mail.gmail.com> ACK -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at meyering.net Thu Jun 4 06:45:26 2009 From: jim at meyering.net (Jim Meyering) Date: Thu, 04 Jun 2009 08:45:26 +0200 Subject: [Ovirt-devel] FYI, new git "update" script pushed, not yet installed Message-ID: <87prdkwl89.fsf@meyering.net> I noticed that the upstream version of our update script had evolved in git.git, so I merged their changes into ours. I haven't installed this server-side hook yet, because I don't know if your process requires moving tags. Let me know and I'll install the new version. >From 260c6c70a5b73c3ab7be705ed9da05b9c0b060fa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 4 Jun 2009 08:41:01 +0200 Subject: [PATCH release] git-hooks/update: merge two new options from git.git's next branch: * update: add the two following options: hooks.allowmodifytag: default: false, i.e., no modifying an existing tag hooks.denycreatebranch: default: false, i.e., *allow* creating branches --- git-hook/update | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/git-hook/update b/git-hook/update index c82015e..ed76bd2 100755 --- a/git-hook/update +++ b/git-hook/update @@ -1,6 +1,6 @@ #!/bin/sh # -# An example hook script to blocks unannotated tags from entering. +# An example hook script to block unannotated tags from entering. # Called by "git receive-pack" with arguments: refname sha1-old sha1-new # # To enable this hook, rename this file to "update". @@ -13,9 +13,15 @@ # hooks.allowdeletetag # This boolean sets whether deleting tags will be allowed in the # repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. # hooks.allowdeletebranch # This boolean sets whether deleting branches will be allowed in the # repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. # # hooks.allowbadwhitespace # This boolean sets whether you may push a commit that adds bad whitespace. @@ -62,7 +68,9 @@ fi # --- Config allowunannotated=$(git config --bool hooks.allowunannotated) allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) # check for no description projectdesc=$(sed -e '1q' "$GIT_DIR/description") @@ -75,7 +83,8 @@ esac # --- Check types # if $newrev is 0000...0000, it's a commit to delete a ref. -if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then newrev_type=delete else newrev_type=$(git cat-file -t $newrev) @@ -101,9 +110,20 @@ case "$refname","$newrev_type" in ;; refs/tags/*,tag) # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi ;; refs/heads/*,commit) # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + check_diff=yes branch=${1##refs/heads/} deny_push_email=$(git config "hooks.denypush.branch.$branch") @@ -161,7 +181,7 @@ esac if [ $check_diff = yes ]; then allow_bad_whitespace=$(git config --bool hooks.allowbadwhitespace) if [ "$allow_bad_whitespace" != "true" ]; then - test "$oldrev" = 0000000000000000000000000000000000000000 \ + test "$oldrev" = $zero \ && exit 0 exec git diff --check $oldrev $newrev -- fi -- 1.6.3.1.333.g3ebba7 From apevec at redhat.com Thu Jun 4 09:47:22 2009 From: apevec at redhat.com (Alan Pevec) Date: Thu, 04 Jun 2009 11:47:22 +0200 Subject: [Ovirt-devel] Re: FYI, new git "update" script pushed, not yet installed In-Reply-To: <87prdkwl89.fsf@meyering.net> References: <87prdkwl89.fsf@meyering.net> Message-ID: <4A27982A.9060006@redhat.com> Jim Meyering wrote: > I noticed that the upstream version of our update script had > evolved in git.git, so I merged their changes into ours. > I haven't installed this server-side hook yet, because I don't > know if your process requires moving tags. Never! that's evil, if we ever screw up the release, we'll fix and tag as new minor release. > Let me know and I'll install the new version. please go ahead > hooks.allowmodifytag: default: false, i.e., no modifying an existing tag ack > hooks.denycreatebranch: default: false, i.e., *allow* creating branches ack, it can be useful to push work-in-progress to public branches, e.g. David and Ian are using this in ovirt-server.git, dev/qmf branch From jim at meyering.net Thu Jun 4 14:33:11 2009 From: jim at meyering.net (Jim Meyering) Date: Thu, 04 Jun 2009 16:33:11 +0200 Subject: [Ovirt-devel] Re: FYI, new git "update" script pushed, not yet installed In-Reply-To: <4A27982A.9060006@redhat.com> (Alan Pevec's message of "Thu, 04 Jun 2009 11:47:22 +0200") References: <87prdkwl89.fsf@meyering.net> <4A27982A.9060006@redhat.com> Message-ID: <87ab4ot6fs.fsf@meyering.net> Hi Alan, Alan Pevec wrote: > Jim Meyering wrote: >> I noticed that the upstream version of our update script had >> evolved in git.git, so I merged their changes into ours. >> I haven't installed this server-side hook yet, because I don't >> know if your process requires moving tags. > > Never! that's evil, if we ever screw up the release, we'll fix and tag as new minor release. I figured ;-) just making sure. >> Let me know and I'll install the new version. > > please go ahead Done. From apevec at redhat.com Thu Jun 4 15:41:56 2009 From: apevec at redhat.com (Alan Pevec) Date: Thu, 04 Jun 2009 17:41:56 +0200 Subject: [Ovirt-devel] Re: [PATCH node] Checks if storage is setup before setting the admin password. BZ#509339 In-Reply-To: <1244051788-29298-1-git-send-email-dpierce@redhat.com> References: <1244051788-29298-1-git-send-email-dpierce@redhat.com> Message-ID: <4A27EB44.7000600@redhat.com> Darryl L. Pierce wrote: > When the o-c-password script starts, it checks to see if there's a > Config logical volume. If there is not one, then it assumes local > storage is not configured and exits the script with a warning message. not 100% sure about this one, but considering that standalone mode doesn't make much sense w/o local storage, ACK and pushed with one change: > +if [[ ! "Config" =~ $(lvdisplay -C | awk '{ print $1 }') ]]; then +if ! lvs HostVG/Config >/dev/null 2>&1 ; then From dpierce at redhat.com Thu Jun 4 16:11:20 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 4 Jun 2009 12:11:20 -0400 Subject: [Ovirt-devel] Re: [PATCH node] Checks if storage is setup before setting the admin password. BZ#509339 In-Reply-To: <4A27EB44.7000600@redhat.com> References: <1244051788-29298-1-git-send-email-dpierce@redhat.com> <4A27EB44.7000600@redhat.com> Message-ID: <20090604161120.GC3525@mcpierce-laptop.rdu.redhat.com> On Thu, Jun 04, 2009 at 05:41:56PM +0200, Alan Pevec wrote: > Darryl L. Pierce wrote: >> When the o-c-password script starts, it checks to see if there's a >> Config logical volume. If there is not one, then it assumes local >> storage is not configured and exits the script with a warning message. > > not 100% sure about this one, but considering that standalone mode doesn't make much sense w/o local storage, ACK and pushed with one change: > >> +if [[ ! "Config" =~ $(lvdisplay -C | awk '{ print $1 }') ]]; then > +if ! lvs HostVG/Config >/dev/null 2>&1 ; then For a separate bug, I had moved this functionality into a method in ovirt-functions: is_local_storage_configured () . I'll fix that to use this code instead. -- 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 dpierce at redhat.com Thu Jun 4 19:52:28 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 4 Jun 2009 15:52:28 -0400 Subject: [Ovirt-devel] [PATCH node] Hostname is now properly persisted between reboots. rhbz#504166 Message-ID: <1244145148-28110-1-git-send-email-dpierce@redhat.com> The o-c-hostname script now checks to see if local storage has been configured. If it has not then the script exits with an error. Otherwise, after the user enters a hostname, the /etc/script/network file is persisted. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-hostname | 13 ++++++++++--- scripts/ovirt-functions | 11 ++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index cad0270..ac8cdf1 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -8,6 +8,13 @@ trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +warn() { printf '%s\n' "$*" >&2; } + +if ! is_local_storage_configured; then + warn "Local storage must be configured prior to setting the hostname." + exit 99 +fi + HOSTNAME_FILE="/etc/sysconfig/network" function set_hostname { @@ -17,8 +24,9 @@ set /files$HOSTNAME_FILE/HOSTNAME "$1" EOF rc=$? if [ $rc = 0 ]; then - /bin/hostname "$1" - rc=$? + /bin/hostname "$1" + rc=$? + if [ $rc -eq 0 ]; then /usr/sbin/persist $HOSTNAME_FILE; fi fi stop_log return $rc @@ -82,4 +90,3 @@ else printf "\n\n Hostname Configuration\n\n" prompt_user fi - diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 5997a4c..e938256 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -78,6 +78,16 @@ is_standalone() { if is_managed; then return 1; else return 0; fi } +# return 0 if local storage is configured +# return 1 if local storage is not configured +is_local_storage_configured () { + if lvs HostVG/Config >/dev/null >&1; then + return 0 + fi + + return 1 +} + # perform automatic local disk installation # when at least following boot parameters are present: # for networking - OVIRT_BOOTIF, management NIC @@ -624,4 +634,3 @@ chkconfig_persist() { if [ "$(basename "$0")" = "ovirt-functions" ]; then "$@" fi - -- 1.6.0.6 From dpierce at redhat.com Fri Jun 5 14:58:55 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 5 Jun 2009 10:58:55 -0400 Subject: [Ovirt-devel] Patch with modified commit message Message-ID: <1244213936-15225-1-git-send-email-dpierce@redhat.com> This patch is from Chris Curran. I've only modified the commit message to add clarity. From dpierce at redhat.com Fri Jun 5 14:58:56 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 5 Jun 2009 10:58:56 -0400 Subject: [Ovirt-devel] [PATCH node] Replace the word "node" with "Hypervisor" in the configuration script. In-Reply-To: <1244213936-15225-1-git-send-email-dpierce@redhat.com> References: <1244213936-15225-1-git-send-email-dpierce@redhat.com> Message-ID: <1244213936-15225-2-git-send-email-dpierce@redhat.com> From: Chris Curran Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-hostname | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index cad0270..fb91d49 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -36,7 +36,7 @@ EOF function prompt_user { printf "\n" - read -p "What is the hostname for this node? " + read -p "What is the hostname of this Hypervisor? " if [ -n "$REPLY" ]; then if set_hostname $REPLY; then -- 1.6.0.6 From dpierce at redhat.com Fri Jun 5 15:39:44 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 5 Jun 2009 11:39:44 -0400 Subject: [Ovirt-devel] [PATCH node] Menu now says "Management Network Setup". bz#504321 Message-ID: <1244216384-29210-1-git-send-email-dpierce@redhat.com> To make the menu item clearer, that it's only for configuring the management network, the menu text has been changed. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index d964ee8..7c5d873 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -289,7 +289,7 @@ else setup_menu while true; do - printf "\n\n Networking Configuration\n\n" >&2 + printf "\n\nManagement Network Configuration\n\n" >&2 printf "***** WARNING *****\n" printf "Configuring the network will destroy any existing networking\n" printf "configuration on this system.\n" @@ -351,4 +351,3 @@ if [ "$net_configured" = 1 ]; then service network stop > /dev/null 2>&1 service network start fi - -- 1.6.0.6 From dpierce at redhat.com Fri Jun 5 15:49:19 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 5 Jun 2009 11:49:19 -0400 Subject: [Ovirt-devel] Re: [PATCH node] Checks if storage is setup before setting the admin password. BZ#509339 In-Reply-To: <4A27EB44.7000600@redhat.com> References: <1244051788-29298-1-git-send-email-dpierce@redhat.com> <4A27EB44.7000600@redhat.com> Message-ID: <20090605154919.GA27900@mcpierce-laptop.rdu.redhat.com> On Thu, Jun 04, 2009 at 05:41:56PM +0200, Alan Pevec wrote: > Darryl L. Pierce wrote: >> When the o-c-password script starts, it checks to see if there's a >> Config logical volume. If there is not one, then it assumes local >> storage is not configured and exits the script with a warning message. > > not 100% sure about this one, but considering that standalone mode doesn't make much sense w/o local storage, ACK and pushed with one change: > >> +if [[ ! "Config" =~ $(lvdisplay -C | awk '{ print $1 }') ]]; then > +if ! lvs HostVG/Config >/dev/null 2>&1 ; then Can I get an ACK? -- 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 dpierce at redhat.com Fri Jun 5 16:06:44 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 5 Jun 2009 12:06:44 -0400 Subject: [Ovirt-devel] [PATCH node] Adds a function for checking if storage was configured. bz#504331 Message-ID: <1244218004-31369-1-git-send-email-dpierce@redhat.com> The function checks to see if the LV HostVG/Config is present. Since all persisted configuration files are stored there, this must be present in order to set any stateful configuration options. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-functions | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 5997a4c..a692fc8 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -78,6 +78,16 @@ is_standalone() { if is_managed; then return 1; else return 0; fi } +# return 0 if local storage is configured +# return 1 if local storage is not configured +is_local_storage_configured () { + if lvs HostVG/Config >/dev/null >&1; then + return 0 + fi + + return 1 +} + # perform automatic local disk installation # when at least following boot parameters are present: # for networking - OVIRT_BOOTIF, management NIC -- 1.6.0.6 From jboggs at redhat.com Fri Jun 5 20:52:15 2009 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 5 Jun 2009 16:52:15 -0400 Subject: [Ovirt-devel] [PATCH server] update postgres for ipv6 support, or db:migrate will fail Message-ID: <1244235135-14935-1-git-send-email-jboggs@redhat.com> If the ::1 ipv6 loopback entry is missing in pg_hba.conf rake db:migrate will fail rake aborted! FATAL: no pg_hba.conf entry for host "::1", user "ovirt", database "ovirt_development", SSL off --- installer/modules/ovirt/manifests/postgres.pp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp index 6620a88..1cea6a1 100644 --- a/installer/modules/ovirt/manifests/postgres.pp +++ b/installer/modules/ovirt/manifests/postgres.pp @@ -78,9 +78,15 @@ class postgres::bundled{ notify => Service[postgresql] } + single_exec{"postgres_add_ipv6_localhost_trust": + command => "/bin/echo 'host all all ::1/128 trust' >> /var/lib/pgsql/data/pg_hba.conf", + require => Exec[postgres_add_localhost_trust], + notify => Service[postgresql] + } + file { "/etc/ovirt-server/" : ensure => directory, - require => Exec[postgres_add_localhost_trust] + require => [Exec[postgres_add_localhost_trust],Single_exec[postgres_add_ipv6_localhost_trust]] } file { "/etc/ovirt-server/db/" : -- 1.6.0.6 From dpierce at redhat.com Mon Jun 8 16:56:26 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 12:56:26 -0400 Subject: [Ovirt-devel] [PATCH node] Hostname is now properly persisted between reboots. rhbz#504166 Message-ID: <1244480186-3907-1-git-send-email-dpierce@redhat.com> The o-c-hostname script now checks to see if local storage has been configured. If it has not then the script exits with an error. Otherwise, after the user enters a hostname, the /etc/script/network file is persisted. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-hostname | 13 ++++++++++--- scripts/ovirt-functions | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index cad0270..ac8cdf1 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -8,6 +8,13 @@ trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +warn() { printf '%s\n' "$*" >&2; } + +if ! is_local_storage_configured; then + warn "Local storage must be configured prior to setting the hostname." + exit 99 +fi + HOSTNAME_FILE="/etc/sysconfig/network" function set_hostname { @@ -17,8 +24,9 @@ set /files$HOSTNAME_FILE/HOSTNAME "$1" EOF rc=$? if [ $rc = 0 ]; then - /bin/hostname "$1" - rc=$? + /bin/hostname "$1" + rc=$? + if [ $rc -eq 0 ]; then /usr/sbin/persist $HOSTNAME_FILE; fi fi stop_log return $rc @@ -82,4 +90,3 @@ else printf "\n\n Hostname Configuration\n\n" prompt_user fi - diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index a692fc8..e938256 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -634,4 +634,3 @@ chkconfig_persist() { if [ "$(basename "$0")" = "ovirt-functions" ]; then "$@" fi - -- 1.6.0.6 From apevec at gmail.com Mon Jun 8 17:10:18 2009 From: apevec at gmail.com (Alan Pevec) Date: Mon, 8 Jun 2009 19:10:18 +0200 Subject: [Ovirt-devel] [PATCH node] Menu now says "Management Network Setup". bz#504321 In-Reply-To: <1244216384-29210-1-git-send-email-dpierce@redhat.com> References: <1244216384-29210-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0906081010g58b8ef52q3fbb20c9ea1d5812@mail.gmail.com> ACK -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpierce at redhat.com Mon Jun 8 17:59:33 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 13:59:33 -0400 Subject: [Ovirt-devel] Follow-on patch Message-ID: <1244483974-20961-1-git-send-email-dpierce@redhat.com> This is a follow-up patch to the previous one already pushed for #503993. From dpierce at redhat.com Mon Jun 8 17:59:34 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 13:59:34 -0400 Subject: [Ovirt-devel] [PATCH node] Change o-c-password to use the new storage check. #503993 In-Reply-To: <1244483974-20961-1-git-send-email-dpierce@redhat.com> References: <1244483974-20961-1-git-send-email-dpierce@redhat.com> Message-ID: <1244483974-20961-2-git-send-email-dpierce@redhat.com> Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-password | 2 +- scripts/ovirt-functions | 1 - 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password index 8b5bdca..03b41e1 100755 --- a/scripts/ovirt-config-password +++ b/scripts/ovirt-config-password @@ -10,7 +10,7 @@ trap 'exit $?' 1 2 13 15 warn() { printf '%s\n' "$*" >&2; } -if ! lvs HostVG/Config >/dev/null 2>&1 ; then +if ! is_local_storage_configured; then warn "Local storage must be configured prior to setting the administrator password." exit 99 fi diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index a692fc8..e938256 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -634,4 +634,3 @@ chkconfig_persist() { if [ "$(basename "$0")" = "ovirt-functions" ]; then "$@" fi - -- 1.6.0.6 From dpierce at redhat.com Mon Jun 8 18:53:04 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 14:53:04 -0400 Subject: [Ovirt-devel] [PATCH node] o-c-networking checks local storage. bz#504662 Message-ID: <1244487184-14359-1-git-send-email-dpierce@redhat.com> The script first checks that the local storage device is configured. If not then it shows a warning message and exists as aborted. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 7c5d873..4d31401 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -20,6 +20,12 @@ CONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" NTP_CONFIG_FILE="/etc/ntp.conf" CONFIGURED_NIC="" +# if local storage is not configured, then exit the script +if ! is_local_storage_configured; then + printf "Local storage must be configured prior to configuring the management interface.\n\n" + exit 99 +fi + function configure_interface { local NIC=$1 -- 1.6.0.6 From jboggs at redhat.com Mon Jun 8 18:54:20 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 08 Jun 2009 14:54:20 -0400 Subject: [Ovirt-devel] [PATCH node] Change o-c-password to use the new storage check. #503993 In-Reply-To: <1244483974-20961-2-git-send-email-dpierce@redhat.com> References: <1244483974-20961-1-git-send-email-dpierce@redhat.com> <1244483974-20961-2-git-send-email-dpierce@redhat.com> Message-ID: <4A2D5E5C.6090003@redhat.com> ACK Darryl L. Pierce wrote: > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-config-password | 2 +- > scripts/ovirt-functions | 1 - > 2 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password > index 8b5bdca..03b41e1 100755 > --- a/scripts/ovirt-config-password > +++ b/scripts/ovirt-config-password > @@ -10,7 +10,7 @@ trap 'exit $?' 1 2 13 15 > > warn() { printf '%s\n' "$*" >&2; } > > -if ! lvs HostVG/Config >/dev/null 2>&1 ; then > +if ! is_local_storage_configured; then > warn "Local storage must be configured prior to setting the administrator password." > exit 99 > fi > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index a692fc8..e938256 100755 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -634,4 +634,3 @@ chkconfig_persist() { > if [ "$(basename "$0")" = "ovirt-functions" ]; then > "$@" > fi > - > From dpierce at redhat.com Mon Jun 8 19:11:01 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 15:11:01 -0400 Subject: [Ovirt-devel] [PATCH node] Change o-c-password to use the new storage check. #503993 In-Reply-To: <4A2D5E5C.6090003@redhat.com> References: <1244483974-20961-1-git-send-email-dpierce@redhat.com> <1244483974-20961-2-git-send-email-dpierce@redhat.com> <4A2D5E5C.6090003@redhat.com> Message-ID: <20090608191101.GF11722@mcpierce-laptop.rdu.redhat.com> On Mon, Jun 08, 2009 at 02:54:20PM -0400, Joey Boggs wrote: > ACK Thanks. This is pushed upstream. -- 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 jboggs at redhat.com Mon Jun 8 19:31:19 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 08 Jun 2009 15:31:19 -0400 Subject: [Ovirt-devel] [PATCH node] o-c-networking checks local storage. bz#504662 In-Reply-To: <1244487184-14359-1-git-send-email-dpierce@redhat.com> References: <1244487184-14359-1-git-send-email-dpierce@redhat.com> Message-ID: <4A2D6707.3090701@redhat.com> Darryl L. Pierce wrote: > The script first checks that the local storage device is configured. If > not then it shows a warning message and exists as aborted. > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-config-networking | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index 7c5d873..4d31401 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -20,6 +20,12 @@ CONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" > NTP_CONFIG_FILE="/etc/ntp.conf" > CONFIGURED_NIC="" > > +# if local storage is not configured, then exit the script > +if ! is_local_storage_configured; then > + printf "Local storage must be configured prior to configuring the management interface.\n\n" > + exit 99 > +fi > + > function configure_interface > { > local NIC=$1 > ACK From dpierce at redhat.com Mon Jun 8 19:35:17 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 15:35:17 -0400 Subject: [Ovirt-devel] Rebased patch... Message-ID: <1244489718-17230-1-git-send-email-dpierce@redhat.com> This is a rebase of the original patch sent. From dpierce at redhat.com Mon Jun 8 19:35:18 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 15:35:18 -0400 Subject: [Ovirt-devel] [PATCH node] Hostname is now properly persisted between reboots. rhbz#504166 In-Reply-To: <1244489718-17230-1-git-send-email-dpierce@redhat.com> References: <1244489718-17230-1-git-send-email-dpierce@redhat.com> Message-ID: <1244489718-17230-2-git-send-email-dpierce@redhat.com> The o-c-hostname script now checks to see if local storage has been configured. If it has not then the script exits with an error. Otherwise, after the user enters a hostname, the /etc/script/network file is persisted. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-hostname | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index cad0270..ac8cdf1 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -8,6 +8,13 @@ trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +warn() { printf '%s\n' "$*" >&2; } + +if ! is_local_storage_configured; then + warn "Local storage must be configured prior to setting the hostname." + exit 99 +fi + HOSTNAME_FILE="/etc/sysconfig/network" function set_hostname { @@ -17,8 +24,9 @@ set /files$HOSTNAME_FILE/HOSTNAME "$1" EOF rc=$? if [ $rc = 0 ]; then - /bin/hostname "$1" - rc=$? + /bin/hostname "$1" + rc=$? + if [ $rc -eq 0 ]; then /usr/sbin/persist $HOSTNAME_FILE; fi fi stop_log return $rc @@ -82,4 +90,3 @@ else printf "\n\n Hostname Configuration\n\n" prompt_user fi - -- 1.6.0.6 From dpierce at redhat.com Mon Jun 8 19:38:20 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 15:38:20 -0400 Subject: [Ovirt-devel] [PATCH node] o-c-networking checks local storage. bz#504662 In-Reply-To: <4A2D6707.3090701@redhat.com> References: <1244487184-14359-1-git-send-email-dpierce@redhat.com> <4A2D6707.3090701@redhat.com> Message-ID: <20090608193820.GG11722@mcpierce-laptop.rdu.redhat.com> On Mon, Jun 08, 2009 at 03:31:19PM -0400, Joey Boggs wrote: > ACK Thanks. This is pushed upstream. -- 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 jboggs at redhat.com Mon Jun 8 19:40:18 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 08 Jun 2009 15:40:18 -0400 Subject: [Ovirt-devel] [PATCH node] Hostname is now properly persisted between reboots. rhbz#504166 In-Reply-To: <1244489718-17230-2-git-send-email-dpierce@redhat.com> References: <1244489718-17230-1-git-send-email-dpierce@redhat.com> <1244489718-17230-2-git-send-email-dpierce@redhat.com> Message-ID: <4A2D6922.40900@redhat.com> Darryl L. Pierce wrote: > The o-c-hostname script now checks to see if local storage has been > configured. If it has not then the script exits with an error. > Otherwise, after the user enters a hostname, the /etc/script/network > file is persisted. > > Signed-off-by: Darryl L. Pierce > --- > scripts/ovirt-config-hostname | 13 ++++++++++--- > 1 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname > index cad0270..ac8cdf1 100755 > --- a/scripts/ovirt-config-hostname > +++ b/scripts/ovirt-config-hostname > @@ -8,6 +8,13 @@ > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > > +warn() { printf '%s\n' "$*" >&2; } > + > +if ! is_local_storage_configured; then > + warn "Local storage must be configured prior to setting the hostname." > + exit 99 > +fi > + > HOSTNAME_FILE="/etc/sysconfig/network" > > function set_hostname { > @@ -17,8 +24,9 @@ set /files$HOSTNAME_FILE/HOSTNAME "$1" > EOF > rc=$? > if [ $rc = 0 ]; then > - /bin/hostname "$1" > - rc=$? > + /bin/hostname "$1" > + rc=$? > + if [ $rc -eq 0 ]; then /usr/sbin/persist $HOSTNAME_FILE; fi > fi > stop_log > return $rc > @@ -82,4 +90,3 @@ else > printf "\n\n Hostname Configuration\n\n" > prompt_user > fi > - > rebase applied fine, ACK From mmorsi at redhat.com Mon Jun 8 20:09:52 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 8 Jun 2009 16:09:52 -0400 Subject: [Ovirt-devel] [PATCH] few minor bugfixes Message-ID: <1244491792-24630-1-git-send-email-mmorsi@redhat.com> - perform dns lookup on hostname, - randomize local tunnel port - bump rpm spec version updated to include danpb's feedback regarding getaddrinfo --- main.c | 36 ++++++++++++++++++------------------ ovirt-viewer.spec | 9 ++++++++- tunnel.c | 29 ++++++++++++++++++++--------- 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/main.c b/main.c index 2962f3f..23af6fa 100644 --- a/main.c +++ b/main.c @@ -36,6 +36,8 @@ #include #endif +#include + #ifdef HAVE_SYS_SOCKET_H #include #endif @@ -903,37 +905,35 @@ viewer_credential (GtkWidget *vnc, GValueArray *credList) gtk_widget_destroy(GTK_WIDGET(dialog)); } -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) static int viewer_open_vnc_socket(const char* vnchost, int vncport) { - int socketfd; - struct hostent *serv; - struct sockaddr_in serv_addr; + int result, socketfd; + char port[10]; + struct addrinfo* vnc_addr; - socketfd = socket(PF_INET, SOCK_STREAM, 0); - if(socketfd < 0){ - return -1; - } + sprintf(port, "%d", vncport); - serv = gethostbyname(vnchost); - if(serv == NULL){ + result = getaddrinfo(vnchost, port, NULL, &vnc_addr); + if(result != 0 || vnc_addr == NULL) return -1; - } - serv_addr.sin_family = PF_INET; - serv_addr.sin_port = htons(vncport); - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; + // just use first found, ignoring rest + socketfd = socket(vnc_addr->ai_family, + vnc_addr->ai_socktype, + vnc_addr->ai_protocol); - if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ - return -1; - } + if(connect(socketfd, vnc_addr->ai_addr, vnc_addr->ai_addrlen) <0) + socketfd = -1; + + freeaddrinfo(vnc_addr); return socketfd; } -#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) */ +#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) */ /* Remove all menu items from the Connect menu. */ static void diff --git a/ovirt-viewer.spec b/ovirt-viewer.spec index a320ecd..a4d826e 100644 --- a/ovirt-viewer.spec +++ b/ovirt-viewer.spec @@ -2,7 +2,7 @@ Name: ovirt-viewer Version: 1.0.0 -Release: 2%{?dist} +Release: 4%{?dist} Summary: ovirt-viewer is a vnc viewer for ovirt managed vms Group: Applications/System @@ -61,6 +61,13 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/ovirt-viewer %changelog +* Mon Jun 01 2009 - 1.0.0-4 +- bugfixes, dns lookup and local tunnel port assignment + +* Wed May 20 2009 - 1.0.0-3 +- changes to viewer to connect to ovirt server + through vnc proxy + * Thu Apr 30 2009 - 1.0.0-2 - ssl support, see check-certificate cmd line flag - wire up send key menu diff --git a/tunnel.c b/tunnel.c index a03ef0b..c6d091d 100644 --- a/tunnel.c +++ b/tunnel.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -46,9 +47,6 @@ /* constants */ -// port to try to listen on, if we can't, increment until we find one we can -const int PORT_RANGE_START = 5600; - // max length of a vm name const int VM_NAME_MAX_LEN = 250; @@ -137,6 +135,8 @@ stop_tunnel(void) static gpointer tunnel_thread (gpointer _data) { + struct hostent *dns_serv; + //char vm_data[VM_NAME_MAX_LEN]; int local_server_socketfd, ovirt_server_socket, client_socketfd; unsigned int local_server_len, client_len, ovirt_server_len; @@ -145,6 +145,9 @@ tunnel_thread (gpointer _data) struct sockaddr_in ovirt_server_address; struct sockaddr_in client_address; + struct sockaddr_in local_server_address_lookup; + unsigned int local_server_address_lookup_len = sizeof(local_server_address_lookup); + GThread *client_server_gthread = NULL; GThread *server_client_gthread = NULL; @@ -154,8 +157,13 @@ tunnel_thread (gpointer _data) DEBUG ("tunnel thread starting up"); // ovirt server address + dns_serv = gethostbyname(hostname); + if(dns_serv == NULL){ + DEBUG("ovirt server lookup failed"); + return NULL; + } ovirt_server_address.sin_family = PF_INET; - ovirt_server_address.sin_addr.s_addr = inet_addr(hostname); + ovirt_server_address.sin_addr.s_addr = ((struct in_addr*)(dns_serv->h_addr))->s_addr; //inet_addr(hostname); ovirt_server_address.sin_port = htons(OVIRT_SERVER_PORT); ovirt_server_len = sizeof(ovirt_server_address); @@ -165,18 +173,21 @@ tunnel_thread (gpointer _data) sockets = g_slist_prepend(sockets, c_socket); // local server address - tunnel_port = PORT_RANGE_START; local_server_address.sin_family = PF_INET; local_server_address.sin_addr.s_addr = inet_addr("127.0.0.1"); - local_server_address.sin_port = htons(tunnel_port); + local_server_address.sin_port = 0; local_server_len = sizeof(local_server_address); // increment ports until one is available - while(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ - tunnel_port += 1; - local_server_address.sin_port += htons(tunnel_port); + if(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ + DEBUG("tunnel bind failed"); + return NULL; } + getsockname(local_server_socketfd, + (struct sockaddr*) &local_server_address_lookup, + &local_server_address_lookup_len); + tunnel_port = (int)ntohs(local_server_address_lookup.sin_port); DEBUG ("tunnel bound to local port %i", tunnel_port); // increase client buffer size? -- 1.6.0.6 From dpierce at redhat.com Mon Jun 8 20:04:42 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Jun 2009 16:04:42 -0400 Subject: [Ovirt-devel] [PATCH node] Hostname is now properly persisted between reboots. rhbz#504166 In-Reply-To: <4A2D6922.40900@redhat.com> References: <1244489718-17230-1-git-send-email-dpierce@redhat.com> <1244489718-17230-2-git-send-email-dpierce@redhat.com> <4A2D6922.40900@redhat.com> Message-ID: <20090608200442.GH11722@mcpierce-laptop.rdu.redhat.com> On Mon, Jun 08, 2009 at 03:40:18PM -0400, Joey Boggs wrote: > rebase applied fine, ACK Thanks. Pushed. -- 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 Mon Jun 8 20:15:46 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 08 Jun 2009 16:15:46 -0400 Subject: [Ovirt-devel] Re: [PATCH] few minor bugfixes In-Reply-To: <1244491792-24630-1-git-send-email-mmorsi@redhat.com> References: <1244491792-24630-1-git-send-email-mmorsi@redhat.com> Message-ID: <4A2D7172.5080301@redhat.com> Ug, sorry once again this is for the viewer. I switched machines and forgot to add the relevant configuration to git. -Mo From harsha at gluster.com Tue Jun 9 05:00:34 2009 From: harsha at gluster.com (Harshavardhana) Date: Tue, 9 Jun 2009 10:30:34 +0530 Subject: [Ovirt-devel] Problems after installing development git Message-ID: <8a80e9760906082200j4edb4fd2h57469f8fe04ddcb5@mail.gmail.com> Hi all, Recently i built development version from the repo. After installing rpms and basic installation procedures. I ended up with "500 internal server error" on my webpage for " http://management.ovirt.priv/ovirt" . I have some relevant logs from db-omatic.log and taskomatic.log which seem to indicate some problem the "AMQP" connection, but i am not really sure how to debug this further. Has any here encountered problems like this before, if yes then any one tried debugging and fixing it?. Logs are preset at http://ovirt.pastebin.com/m15876f5c Regards -- Harshavardhana "Yantra Shilpi" Z Research Inc - http://www.zresearch.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbrock at redhat.com Tue Jun 9 17:57:04 2009 From: hbrock at redhat.com (Hugh O. Brock) Date: Tue, 9 Jun 2009 13:57:04 -0400 Subject: [Ovirt-devel] Announcing oVirt 0.99 Message-ID: <20090609175704.GV5327@redhat.com> Announcing oVirt 0.99 ===================== We are pleased to announce the release of oVirt 0.99, a significant step forward in stability and feature set for oVirt project users. Some highlights from the change log: * Improved installer, oVirt Server will now install with an existing FreeIPA setup present rather than insisting on installing FreeIPA from scratch * Anyterm console support -- view a VM's serial console from the oVirt UI * Lots of UI cleanup, bug fixes, flex chart improvements, back end stability improvements * QMF API proof of concept Please download and install the latest release following the instructions at http://ovirt.org/install-instructions.html. We're looking forward to your feedback! Thanks, --the oVirt team Changelogs for the last 3 releases: Release 0.99 (oVirt Server Suite) - permission refactoring, now in seperated db tables - added permission to cloud controller - generic error handling w/ registered handlers for each exception - finished service layer refactoring and controller integration (network, storage volume, storage, task, quota, pool, vm controllers) - anyterm web terminal / wui integration - start of the cloud ui, web frontend to the cumulous project - vnc proxy server to multiplex vnc connects on a single port and changes to ovirt-viewer to use it - start of new ovirt qmf api, updated to latest qmf spec, refresh pools whenever used, etc - added ovirt xml api spec - installer updates, ipa install fails if mod_ssl present, dns clarification - taskomatic changes, much more logging added, reconnect messages, bugfixes - dbomatic changes, log connect / disconnect events - host-browser permits nic-less nodes - graph updates, new default view, increased dimensions, cleaned up/added labels - many ui improvements, flexigrid functionality/appearance, details pane, icons and css, etc - many test improvements and fixes - many bugfixes Release 0.98 (oVirt Server Suite) - enable acpi / apic in vms - on vm shutdown, vm state is now unchanged - noreplace cobbler.yml in the spec - installer updates, network and dns config cleanup, hostname verification - updated and fixed server / node network configuration, managed_node_config, ovirt-identify-node, host-browser, other fixes to - delete nics if a node doesn't report them - api to retrieve nic / bonding details - autocreate default bridges for nics / bondings - refactor how nic, bonding, bridges are defined and handle edge cases - many tests fixes - many bugfixes Release 0.97 (oVirt Server Suite) - added host / pool audit trail - added task list to daskboard - added plethora of missing model validations - taskomatic / qpid integration - changed ovirtbr -> breth - removed ovirt-cfgdb - update search index every 1/2 hr - navigation tree interface and functionality improvements - kerberos authentication for qpidd - storage volumn api, rest interface, and other improvements - allow vm vnc connections to be forwarded via server - discontinued ovirt-recipe in favor of ovirt-server-installer - lvm volumns scanning added to taskomatic - use ruby-qpid as opposed to rubygem-qpid - wired up logout button - flexchart improvements - add host chart - allow data function selection (min, max, avg, etc) - y-axis scale - added qpid reconnect / logger to dbomatic, taskomatic - add ssl to ovirt httpd conf - use dns srv records in taskomatic / dbomatic - installer updates, disable 2nd network interface, reworked selinux - options, dnsmasq fixes, nat / forwarding for node, add node-image/pxe, - update qpid config, many various bugfixes - network configuration changes / improvements * host may now only have one device or bonding on a network * associate vms with a network * store nic interface name on the server * network wui cleanup and various bugfixes - reset vm state on node reboot - move vnc forwarding code from taskomatic to dbomatic - persistently store vm / host history (for dbomatic vnc forwarding code) - stats util improvements - ssl now on both admin and guest interfaces - proxy guest network virtual host to admin network virtual host - deprecate old ovirt server installer - dbomatic generatic exception handling - added exception handling to dbomatic - tests and validations fixes - many bugfixes From jboggs at redhat.com Tue Jun 9 20:25:22 2009 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 09 Jun 2009 16:25:22 -0400 Subject: [Ovirt-devel] [PATCH] few minor bugfixes In-Reply-To: <1244491792-24630-1-git-send-email-mmorsi@redhat.com> References: <1244491792-24630-1-git-send-email-mmorsi@redhat.com> Message-ID: <4A2EC532.80601@redhat.com> Mohammed Morsi wrote: > - perform dns lookup on hostname, > - randomize local tunnel port > - bump rpm spec version > > updated to include danpb's feedback regarding getaddrinfo > --- > main.c | 36 ++++++++++++++++++------------------ > ovirt-viewer.spec | 9 ++++++++- > tunnel.c | 29 ++++++++++++++++++++--------- > 3 files changed, 46 insertions(+), 28 deletions(-) > > diff --git a/main.c b/main.c > index 2962f3f..23af6fa 100644 > --- a/main.c > +++ b/main.c > @@ -36,6 +36,8 @@ > #include > #endif > > +#include > + > #ifdef HAVE_SYS_SOCKET_H > #include > #endif > @@ -903,37 +905,35 @@ viewer_credential (GtkWidget *vnc, GValueArray *credList) > gtk_widget_destroy(GTK_WIDGET(dialog)); > } > > -#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) > +#if defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) > > static int > viewer_open_vnc_socket(const char* vnchost, int vncport) > { > - int socketfd; > - struct hostent *serv; > - struct sockaddr_in serv_addr; > + int result, socketfd; > + char port[10]; > + struct addrinfo* vnc_addr; > > - socketfd = socket(PF_INET, SOCK_STREAM, 0); > - if(socketfd < 0){ > - return -1; > - } > + sprintf(port, "%d", vncport); > > - serv = gethostbyname(vnchost); > - if(serv == NULL){ > + result = getaddrinfo(vnchost, port, NULL, &vnc_addr); > + if(result != 0 || vnc_addr == NULL) > return -1; > - } > > - serv_addr.sin_family = PF_INET; > - serv_addr.sin_port = htons(vncport); > - serv_addr.sin_addr.s_addr = ((struct in_addr *)(serv->h_addr))->s_addr; > + // just use first found, ignoring rest > + socketfd = socket(vnc_addr->ai_family, > + vnc_addr->ai_socktype, > + vnc_addr->ai_protocol); > > - if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0){ > - return -1; > - } > + if(connect(socketfd, vnc_addr->ai_addr, vnc_addr->ai_addrlen) <0) > + socketfd = -1; > + > + freeaddrinfo(vnc_addr); > > return socketfd; > } > > -#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) && defined(HAVE_GETHOSTBYNAME) */ > +#endif /* defined(HAVE_SOCKET) && defined(HAVE_CONNECT) && defined(HAVE_HTONS) */ > > /* Remove all menu items from the Connect menu. */ > static void > diff --git a/ovirt-viewer.spec b/ovirt-viewer.spec > index a320ecd..a4d826e 100644 > --- a/ovirt-viewer.spec > +++ b/ovirt-viewer.spec > @@ -2,7 +2,7 @@ > > Name: ovirt-viewer > Version: 1.0.0 > -Release: 2%{?dist} > +Release: 4%{?dist} > Summary: ovirt-viewer is a vnc viewer for ovirt managed vms > > Group: Applications/System > @@ -61,6 +61,13 @@ rm -rf $RPM_BUILD_ROOT > %{_bindir}/ovirt-viewer > > %changelog > +* Mon Jun 01 2009 - 1.0.0-4 > +- bugfixes, dns lookup and local tunnel port assignment > + > +* Wed May 20 2009 - 1.0.0-3 > +- changes to viewer to connect to ovirt server > + through vnc proxy > + > * Thu Apr 30 2009 - 1.0.0-2 > - ssl support, see check-certificate cmd line flag > - wire up send key menu > diff --git a/tunnel.c b/tunnel.c > index a03ef0b..c6d091d 100644 > --- a/tunnel.c > +++ b/tunnel.c > @@ -34,6 +34,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -46,9 +47,6 @@ > > /* constants */ > > -// port to try to listen on, if we can't, increment until we find one we can > -const int PORT_RANGE_START = 5600; > - > // max length of a vm name > const int VM_NAME_MAX_LEN = 250; > > @@ -137,6 +135,8 @@ stop_tunnel(void) > static gpointer > tunnel_thread (gpointer _data) > { > + struct hostent *dns_serv; > + > //char vm_data[VM_NAME_MAX_LEN]; > int local_server_socketfd, ovirt_server_socket, client_socketfd; > unsigned int local_server_len, client_len, ovirt_server_len; > @@ -145,6 +145,9 @@ tunnel_thread (gpointer _data) > struct sockaddr_in ovirt_server_address; > struct sockaddr_in client_address; > > + struct sockaddr_in local_server_address_lookup; > + unsigned int local_server_address_lookup_len = sizeof(local_server_address_lookup); > + > GThread *client_server_gthread = NULL; > GThread *server_client_gthread = NULL; > > @@ -154,8 +157,13 @@ tunnel_thread (gpointer _data) > DEBUG ("tunnel thread starting up"); > > // ovirt server address > + dns_serv = gethostbyname(hostname); > + if(dns_serv == NULL){ > + DEBUG("ovirt server lookup failed"); > + return NULL; > + } > ovirt_server_address.sin_family = PF_INET; > - ovirt_server_address.sin_addr.s_addr = inet_addr(hostname); > + ovirt_server_address.sin_addr.s_addr = ((struct in_addr*)(dns_serv->h_addr))->s_addr; //inet_addr(hostname); > ovirt_server_address.sin_port = htons(OVIRT_SERVER_PORT); > ovirt_server_len = sizeof(ovirt_server_address); > > @@ -165,18 +173,21 @@ tunnel_thread (gpointer _data) > sockets = g_slist_prepend(sockets, c_socket); > > // local server address > - tunnel_port = PORT_RANGE_START; > local_server_address.sin_family = PF_INET; > local_server_address.sin_addr.s_addr = inet_addr("127.0.0.1"); > - local_server_address.sin_port = htons(tunnel_port); > + local_server_address.sin_port = 0; > local_server_len = sizeof(local_server_address); > > // increment ports until one is available > - while(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ > - tunnel_port += 1; > - local_server_address.sin_port += htons(tunnel_port); > + if(bind(local_server_socketfd, (struct sockaddr*)&local_server_address, local_server_len) < 0){ > + DEBUG("tunnel bind failed"); > + return NULL; > } > > + getsockname(local_server_socketfd, > + (struct sockaddr*) &local_server_address_lookup, > + &local_server_address_lookup_len); > + tunnel_port = (int)ntohs(local_server_address_lookup.sin_port); > DEBUG ("tunnel bound to local port %i", tunnel_port); > > // increase client buffer size? > ACK From mmorsi at redhat.com Wed Jun 10 17:32:54 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Wed, 10 Jun 2009 13:32:54 -0400 Subject: [Ovirt-devel] [PATCH] add cmd line option for server vnc port Message-ID: <1244655174-26297-1-git-send-email-mmorsi@redhat.com> --- internal.h | 3 +++ main.c | 3 +++ tunnel.c | 7 ++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal.h b/internal.h index 80e675e..bd65922 100644 --- a/internal.h +++ b/internal.h @@ -71,6 +71,9 @@ extern gboolean check_cert; /* server we're connecting to */ extern const char* hostname; +/* port which to connect to the server via vnc */ +extern int ovirt_server_vnc_port; + /* vm currently in focus */ extern struct vm* vm_in_focus; diff --git a/main.c b/main.c index 23af6fa..dd26c93 100644 --- a/main.c +++ b/main.c @@ -75,6 +75,7 @@ static GSList *vmlist = NULL; /* internal.h shared constructs */ const char* hostname; struct vm* vm_in_focus; +int ovirt_server_vnc_port = 5900; /* Private functions. */ static void start_ui (void); @@ -200,6 +201,8 @@ static const char *help_msg = "Use '" PACKAGE " --help' to see a list of available command line options"; static const GOptionEntry options[] = { + { "port", 'p', 0, G_OPTION_ARG_INT, &ovirt_server_vnc_port, + "set port which to connect to server via vnc", NULL }, { "cainfo", 0, 0, G_OPTION_ARG_STRING, &cainfo, "set the path of the CA certificate bundle", NULL }, { "check-certificate", 0, 0, G_OPTION_ARG_NONE, &check_cert, diff --git a/tunnel.c b/tunnel.c index c6d091d..17b512c 100644 --- a/tunnel.c +++ b/tunnel.c @@ -53,9 +53,6 @@ const int VM_NAME_MAX_LEN = 250; // max length of vnc data const int VNC_DATA_MAX_LEN = 800000; -// port which to connect to on ovirt server -const int OVIRT_SERVER_PORT = 5900; - /* Private thread functions */ static gpointer tunnel_thread(gpointer data); static gpointer client_server_thread(gpointer data); @@ -164,7 +161,7 @@ tunnel_thread (gpointer _data) } ovirt_server_address.sin_family = PF_INET; ovirt_server_address.sin_addr.s_addr = ((struct in_addr*)(dns_serv->h_addr))->s_addr; //inet_addr(hostname); - ovirt_server_address.sin_port = htons(OVIRT_SERVER_PORT); + ovirt_server_address.sin_port = htons(ovirt_server_vnc_port); ovirt_server_len = sizeof(ovirt_server_address); // create local net socket @@ -212,7 +209,7 @@ tunnel_thread (gpointer _data) ovirt_server_socket = socket(PF_INET, SOCK_STREAM, 0); c_socket = malloc(sizeof(int)); *c_socket = ovirt_server_socket; sockets = g_slist_prepend(sockets, c_socket); - DEBUG ("connecting to ovirt server %s on %i", hostname, OVIRT_SERVER_PORT); + DEBUG ("connecting to ovirt server %s on %i", hostname, ovirt_server_vnc_port); if(connect(ovirt_server_socket, (struct sockaddr*)&ovirt_server_address, ovirt_server_len) < 0){ DEBUG ("could not connect to ovirt server"); break; -- 1.6.0.6 From mmorsi at redhat.com Wed Jun 10 18:05:19 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Wed, 10 Jun 2009 14:05:19 -0400 Subject: [Ovirt-devel] [PATCH server] small fix to optionparser call to allow port arg to accept an int Message-ID: <1244657119-27782-1-git-send-email-mmorsi@redhat.com> --- src/vnc-proxy/vnc-proxy.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/vnc-proxy/vnc-proxy.rb b/src/vnc-proxy/vnc-proxy.rb index a411d69..73327bb 100755 --- a/src/vnc-proxy/vnc-proxy.rb +++ b/src/vnc-proxy/vnc-proxy.rb @@ -63,7 +63,7 @@ class VncProxy opts.on("-n", "--nodaemon", "Run interactively (useful for debugging)") do |n| do_daemon = false end - opts.on("-p", "--port", "Port to listen on") do |n| + opts.on("-p", "--port [port]", "Port to listen on") do |n| port = n.to_i end end -- 1.6.0.6 From mmorsi at redhat.com Wed Jun 10 18:16:29 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Wed, 10 Jun 2009 14:16:29 -0400 Subject: [Ovirt-devel] [PATCH server] added ovirt-vnc-proxy sysconfig Message-ID: <1244657789-28282-1-git-send-email-mmorsi@redhat.com> --- conf/ovirt-vnc-proxy | 6 ++++-- conf/ovirt-vnc-proxy.sysconf | 2 ++ ovirt-server.spec.in | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 conf/ovirt-vnc-proxy.sysconf diff --git a/conf/ovirt-vnc-proxy b/conf/ovirt-vnc-proxy index 00b0652..4c260cb 100755 --- a/conf/ovirt-vnc-proxy +++ b/conf/ovirt-vnc-proxy @@ -9,16 +9,18 @@ # [ -r /etc/sysconfig/ovirt-rails ] && . /etc/sysconfig/ovirt-rails +[ -r /etc/sysconfig/ovirt-vnc-proxy ] && . /etc/sysconfig/ovirt-vnc-proxy export RAILS_ENV="${RAILS_ENV:-production}" +export OVIRT_VNC_PROXY_PORT="${OVIRT_VNC_PROXY_PORT:-5900}" -DAEMON=/usr/share/ovirt-server/vnc-proxy/vnc-proxy.rb +DAEMON=src/vnc-proxy/vnc-proxy.rb . /etc/init.d/functions start() { echo -n "Starting ovirt-vnc-proxy: " - daemon $DAEMON + daemon $DAEMON --port $OVIRT_VNC_PROXY_PORT RETVAL=$? echo } diff --git a/conf/ovirt-vnc-proxy.sysconf b/conf/ovirt-vnc-proxy.sysconf new file mode 100644 index 0000000..d9fa15a --- /dev/null +++ b/conf/ovirt-vnc-proxy.sysconf @@ -0,0 +1,2 @@ +#sets the port which to listen on +#OVIRT_VNC_PROXY_PORT=5900 diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in index 68f3a2e..1569a9a 100644 --- a/ovirt-server.spec.in +++ b/ovirt-server.spec.in @@ -102,6 +102,7 @@ touch %{buildroot}%{_localstatedir}/log/%{name}/db-omatic.log %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-mongrel-rails %{buildroot}%{_initrddir} %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-mongrel-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-mongrel-rails %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-rails +%{__install} -Dp -m0755 %{pbuild}/conf/ovirt-vnc-proxy.sysconf %{buildroot}%{_sysconfdir}/sysconfig/ovirt-vnc-proxy %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-taskomatic %{buildroot}%{_initrddir} %{__install} -Dp -m0755 %{pbuild}/conf/ovirt-vnc-proxy %{buildroot}%{_initrddir} @@ -213,6 +214,7 @@ fi %{_sysconfdir}/cron.d/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/ovirt-mongrel-rails %config(noreplace) %{_sysconfdir}/sysconfig/ovirt-rails +%config(noreplace) %{_sysconfdir}/sysconfig/ovirt-vnc-proxy %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf %doc %attr(-, ovirt, ovirt) %{_localstatedir}/lib/%{name} -- 1.6.0.6 From z.zohoor at gmail.com Wed Jun 10 18:42:54 2009 From: z.zohoor at gmail.com (zahra zohoor) Date: Wed, 10 Jun 2009 19:42:54 +0100 Subject: [Ovirt-devel] ovirt-viewer crash - please help Message-ID: <2bb12c040906101142h28a514d5o8ce4e42ce050001@mail.gmail.com> Hi, Im running Fedora 10. I use the command : ovirt-viewer ovirt-appliance and ovirt-viewer opens up, which is a gray-yellow screen. there is a text box and a connect button. i enter the localhost.localdomain, 127.0.0.1 or static ip address and then it says that couldnt connect to the server and crashes. Would you please please help me. looking forward to your kind reply. zara -------------- next part -------------- An HTML attachment was scrubbed... URL: From jboggs at redhat.com Wed Jun 10 19:26:39 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 10 Jun 2009 15:26:39 -0400 Subject: [Ovirt-devel] [PATCH] remove rails2.3 deprecated config.action_view.cache_template_extensions Message-ID: <1244661999-14018-1-git-send-email-jboggs@redhat.com> --- src/config/environments/development.rb | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/config/environments/development.rb b/src/config/environments/development.rb index b3acf68..9bd4fa6 100644 --- a/src/config/environments/development.rb +++ b/src/config/environments/development.rb @@ -33,7 +33,6 @@ config.whiny_nils = true # Show full error reports and disable caching config.action_controller.consider_all_requests_local = true config.action_controller.perform_caching = false -config.action_view.cache_template_extensions = false config.action_view.debug_rjs = true # Don't care if the mailer can't send -- 1.6.0.6 From hbrock at redhat.com Wed Jun 10 21:10:06 2009 From: hbrock at redhat.com (Hugh O. Brock) Date: Wed, 10 Jun 2009 17:10:06 -0400 Subject: [Ovirt-devel] ovirt-viewer crash - please help In-Reply-To: <2bb12c040906101142h28a514d5o8ce4e42ce050001@mail.gmail.com> References: <2bb12c040906101142h28a514d5o8ce4e42ce050001@mail.gmail.com> Message-ID: <20090610211005.GR5327@redhat.com> On Wed, Jun 10, 2009 at 07:42:54PM +0100, zahra zohoor wrote: > Hi, > > Im running Fedora 10. I use the command : ovirt-viewer ovirt-appliance > and ovirt-viewer opens up, which is a gray-yellow screen. there is a text > box and a connect button. i enter the localhost.localdomain, 127.0.0.1 or > static ip address and then it says that couldnt connect to the server and > crashes. Would you please please help me. > > looking forward to your kind reply. > > zara > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel There were some issues with the oVirt viewer in the repository until this afternoon. The code there now should help, but I believe you'll also need the latest server patches -- Mo, can you confirm? Thanks, --Hugh From pronix.service at gmail.com Thu Jun 11 16:03:51 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Thu, 11 Jun 2009 20:03:51 +0400 Subject: [Ovirt-devel] [PATCH server] Why passenger not use ? Message-ID: <4A312AE7.4030102@gmail.com> Hello Why for ovirt-server not use passenger ? -- ? ?????????, ??????? From jguiditt at redhat.com Thu Jun 11 16:08:41 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Thu, 11 Jun 2009 12:08:41 -0400 Subject: [Ovirt-devel] [PATCH] remove rails2.3 deprecated config.action_view.cache_template_extensions In-Reply-To: <1244661999-14018-1-git-send-email-jboggs@redhat.com> References: <1244661999-14018-1-git-send-email-jboggs@redhat.com> Message-ID: <1244736521.12888.0.camel@localhost.localdomain> On Wed, 2009-06-10 at 15:26 -0400, Joey Boggs wrote: > --- > src/config/environments/development.rb | 1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/src/config/environments/development.rb b/src/config/environments/development.rb > index b3acf68..9bd4fa6 100644 > --- a/src/config/environments/development.rb > +++ b/src/config/environments/development.rb > @@ -33,7 +33,6 @@ config.whiny_nils = true > # Show full error reports and disable caching > config.action_controller.consider_all_requests_local = true > config.action_controller.perform_caching = false > -config.action_view.cache_template_extensions = false > config.action_view.debug_rjs = true > > # Don't care if the mailer can't send ACK From jboggs at redhat.com Thu Jun 11 17:18:50 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Jun 2009 13:18:50 -0400 Subject: [Ovirt-devel] [PATCH] remove rails2.3 deprecated config.action_view.cache_template_extensions In-Reply-To: <1244736521.12888.0.camel@localhost.localdomain> References: <1244661999-14018-1-git-send-email-jboggs@redhat.com> <1244736521.12888.0.camel@localhost.localdomain> Message-ID: <4A313C7A.7060107@redhat.com> Jason Guiditta wrote: > On Wed, 2009-06-10 at 15:26 -0400, Joey Boggs wrote: > >> --- >> src/config/environments/development.rb | 1 - >> 1 files changed, 0 insertions(+), 1 deletions(-) >> >> diff --git a/src/config/environments/development.rb b/src/config/environments/development.rb >> index b3acf68..9bd4fa6 100644 >> --- a/src/config/environments/development.rb >> +++ b/src/config/environments/development.rb >> @@ -33,7 +33,6 @@ config.whiny_nils = true >> # Show full error reports and disable caching >> config.action_controller.consider_all_requests_local = true >> config.action_controller.perform_caching = false >> -config.action_view.cache_template_extensions = false >> config.action_view.debug_rjs = true >> >> # Don't care if the mailer can't send >> > > ACK > > pushed From dpierce at redhat.com Thu Jun 11 17:44:43 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Jun 2009 13:44:43 -0400 Subject: [Ovirt-devel] [PATCH node] NTP and DNS information are persisted. rhbz#505342 Message-ID: <1244742283-11335-1-git-send-email-dpierce@redhat.com> Adds a call to persist the file /etc/ntp.conf after it has been setup and the configuration saved. DNS details are inserted into the bridge configuration file for the management NIC being defined. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 4d31401..a536760 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -189,6 +189,11 @@ function configure_interface function configure_dns { + if [[ -z "${CONFIGURED_NIC}" ]]; then + printf "\nYou must configure a network interface first.\n\n" + return + fi + local DNS=$1 local AUTO=$2 if [[ "$AUTO" == "AUTO" && @@ -196,8 +201,8 @@ function configure_dns DNS=$OVIRT_DNS fi - local IF_FILENAME="$WORKDIR/augtool-lo" - local IF_ROOT="$CONFIG_FILE_ROOT-lo" + local IF_FILENAME="$WORKDIR/augtool-br${CONFIGURED_NIC}" + local IF_ROOT="$CONFIG_FILE_ROOT-br${CONFIGURED_NIC}" local IF_CONFIG= if [ -z "$AUTO" ]; then @@ -344,7 +349,9 @@ if ls "$WORKDIR"/augtool-* > /dev/null 2>&1 ; then if [ $? = 0 ]; then log "Network configured successfully" net_configured=1 - ovirt_store_config /etc/sysconfig/network-scripts/ifcfg* + ovirt_store_config \ + /etc/sysconfig/network-scripts/ifcfg* \ + $NTP_CONFIG_FILE else log "Error configuring network, see $OVIRT_LOGFILE" stop_log -- 1.6.0.6 From lutter at redhat.com Thu Jun 11 22:53:38 2009 From: lutter at redhat.com (David Lutterkort) Date: Thu, 11 Jun 2009 22:53:38 +0000 Subject: [Ovirt-devel] [PATCH server] Why passenger not use ? In-Reply-To: <4A312AE7.4030102@gmail.com> References: <4A312AE7.4030102@gmail.com> Message-ID: <1244760818.30895.11.camel@avon.watzmann.net> On Thu, 2009-06-11 at 20:03 +0400, dima vasiletc wrote: > Hello > Why for ovirt-server not use passenger ? Mostly for historical reasons, and because nobody's had the time to investigate it and move our setup from mongrel to passenger. Patches welcome ;) (Be warned though that a setup with passenger also requires that it's packaged for Fedora, and that the installer is changed if it needs any configuration to run oVirt) David From lutter at redhat.com Thu Jun 11 22:57:46 2009 From: lutter at redhat.com (David Lutterkort) Date: Thu, 11 Jun 2009 22:57:46 +0000 Subject: [Ovirt-devel] Problems after installing development git In-Reply-To: <8a80e9760906082200j4edb4fd2h57469f8fe04ddcb5@mail.gmail.com> References: <8a80e9760906082200j4edb4fd2h57469f8fe04ddcb5@mail.gmail.com> Message-ID: <1244761066.30895.13.camel@avon.watzmann.net> On Tue, 2009-06-09 at 10:30 +0530, Harshavardhana wrote: > Hi all, > > Recently i built development version from the repo. After > installing rpms and basic installation procedures. I ended > up with "500 internal server error" on my webpage for > "http://management.ovirt.priv/ovirt" . I have some relevant > logs from db-omatic.log and taskomatic.log which seem to indicate > some problem the "AMQP" connection, but i am > not really sure how to debug this further. Has any here > encountered problems like this before, if yes then any one > tried debugging and fixing it?. > > Logs are preset at http://ovirt.pastebin.com/m15876f5c The taskomatic error seems to be that you don't have a SRV entry for _qpidd._tcp in your DNS server. The dbomatic error is a little more mysterious - it seems the process got a TERM signal, but I can't make heads or tails of the log; do you have that log with line breaks intact somewhere ? David From justin at redfish-group.com Fri Jun 12 06:09:02 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Fri, 12 Jun 2009 16:09:02 +1000 Subject: [Ovirt-devel] only seeing one NIC in network device editor Message-ID: <4A31F0FE.50806@redfish-group.com> Hi, When I click on "Edit Network" on my managed node in the hosts tab of the oVirt UI I only see one NIC. My managed node has 2 NICs, one on the guest network and one on the admin network. The NIC on the admin network is not listed in the network editor. Is this normal? I'm trying to create a VM and boot the cobbler profile I created for Fedora 10 but I can only boot the VM on the guest network for some reason (presumably because that's the only NIC appearing in the network editor for the host). Cheers, Justin. From harsha at gluster.com Fri Jun 12 06:39:43 2009 From: harsha at gluster.com (Harshavardhana) Date: Fri, 12 Jun 2009 12:09:43 +0530 Subject: [Ovirt-devel] Problems after installing development git In-Reply-To: <1244761066.30895.13.camel@avon.watzmann.net> References: <8a80e9760906082200j4edb4fd2h57469f8fe04ddcb5@mail.gmail.com> <1244761066.30895.13.camel@avon.watzmann.net> Message-ID: <8a80e9760906112339w4c0af9besbe80b481eb6a21d5@mail.gmail.com> Hi David, That was my bad setup - postgres database had some issues which i fixed manually. Thanks a lot taking time for a response. Regards -- Harshavardhana "Sadasya" - Gluster Engineering Core Team Gluster Inc - http://www.gluster.com On Fri, Jun 12, 2009 at 4:27 AM, David Lutterkort wrote: > On Tue, 2009-06-09 at 10:30 +0530, Harshavardhana wrote: > > Hi all, > > > > Recently i built development version from the repo. After > > installing rpms and basic installation procedures. I ended > > up with "500 internal server error" on my webpage for > > "http://management.ovirt.priv/ovirt" . I have some relevant > > logs from db-omatic.log and taskomatic.log which seem to indicate > > some problem the "AMQP" connection, but i am > > not really sure how to debug this further. Has any here > > encountered problems like this before, if yes then any one > > tried debugging and fixing it?. > > > > Logs are preset at http://ovirt.pastebin.com/m15876f5c > > The taskomatic error seems to be that you don't have a SRV entry for > _qpidd._tcp in your DNS server. > > The dbomatic error is a little more mysterious - it seems the process > got a TERM signal, but I can't make heads or tails of the log; do you > have that log with line breaks intact somewhere ? > > David > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sseago at redhat.com Fri Jun 12 12:22:50 2009 From: sseago at redhat.com (Scott Seago) Date: Fri, 12 Jun 2009 08:22:50 -0400 Subject: [Ovirt-devel] only seeing one NIC in network device editor In-Reply-To: <4A31F0FE.50806@redfish-group.com> References: <4A31F0FE.50806@redfish-group.com> Message-ID: <4A32489A.207@redhat.com> Justin Clacherty wrote: > Hi, > > When I click on "Edit Network" on my managed node in the hosts tab of > the oVirt UI I only see one NIC. My managed node has 2 NICs, one on > the guest network and one on the admin network. The NIC on the admin > network is not listed in the network editor. Is this normal? > > I'm trying to create a VM and boot the cobbler profile I created for > Fedora 10 but I can only boot the VM on the guest network for some > reason (presumably because that's the only NIC appearing in the > network editor for the host). > > Cheers, > Justin. Yes, this is the way it's currently set up to work. In the 2-or-more network use csae the admin network is intended for node communication only. On the node, the admin network is the only one that gets an IP, and the guests are not intended to use this network (in our testing environmnent the admin network is completely unconnected to anything but the oVirt server and the nodes). If your node had 3 NICs on it you'd have 2 networks to choose from for your guest. There is a problem with the current implementation in that it does not support a single-network installation right now. We're currently working through determining what needs to be done to support this, but in the case where you only have a single network we will have to allow guests on the admin (and only) network. Scott From dpierce at redhat.com Fri Jun 12 13:10:52 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 12 Jun 2009 09:10:52 -0400 Subject: [Ovirt-devel] [PATCH node] o-c-config will only run when local storage is configured. rhbz#505560 Message-ID: <1244812252-21430-1-git-send-email-dpierce@redhat.com> o-c-config checks to see if local storage is configured prior to starting. If local storage is not configured then it reports an error and exits. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-logging | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging index 5da991f..ba661c3 100755 --- a/scripts/ovirt-config-logging +++ b/scripts/ovirt-config-logging @@ -8,6 +8,11 @@ trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 +if ! is_local_storage_configured; then + printf "Local storage must be configured prior to configuring the logging system.\n" + exit 99 +fi + RSYSLOG_FILE="/etc/rsyslog.conf" # Creates the rsyslog file based on the following inputs @@ -185,4 +190,3 @@ else printf "\n\n Logging Configuration\n\n" prompt_user fi - -- 1.6.0.6 From mmorsi at redhat.com Fri Jun 12 14:26:37 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 12 Jun 2009 10:26:37 -0400 Subject: [Ovirt-devel] [PATCH server] ovirt server installer autobuild integration Message-ID: <1244816797-6464-1-git-send-email-mmorsi@redhat.com> From: root update server autobuild to set up a new isolated vm environment and go through the server installer process and rails tests --- autobuild.sh | 72 ++++++++++++++++++++++++++++++++++++++++++ ovirt-installer-test-answers | 21 ++++++++++++ ovirt-server-test.ks | 37 +++++++++++++++++++++ 3 files changed, 130 insertions(+), 0 deletions(-) create mode 100644 ovirt-installer-test-answers create mode 100644 ovirt-server-test.ks diff --git a/autobuild.sh b/autobuild.sh index 2cc11d6..7284ef9 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -25,10 +25,13 @@ set -v test -f Makefile && make -k distclean || : +############# build the server rpm + # put rails in development mode cp conf/ovirt-rails.sysconf conf/ovirt-rails.sysconf.orig echo "RAILS_ENV=development" >> conf/ovirt-rails.sysconf +# build server & installer rpms ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT make dist @@ -43,4 +46,73 @@ if [ -f /usr/bin/rpmbuild ]; then rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz fi +# restore to checkout mv conf/ovirt-rails.sysconf.orig conf/ovirt-rails.sysconf + +############## setup new vm to test installer + +# setup parameters to ssh to vm +SSHKEY=~/.ssh/id_autobuild +remote_target="root at 192.168.122.190" # should be an address on default libvirt network +ssh_cmd="ssh -i $SSHKEY -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null $remote_target" +scp_cmd="scp -i $SSHKEY -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + +# generate new ssh key if not found +if [ ! -r $SSHKEY ]; then + mkdir -p $(dirname "$SSHKEY") + ssh-keygen -q -t rsa -N "" -f $SSHKEY +fi + +# copy the key and installer answers to the kickstart +cp ovirt-server-test.ks ovirt-server-test.ks.orig +cat >> ovirt-server-test.ks << KS +%post +mkdir -p /root/.ssh +chmod 700 /root/.ssh +cat > /root/.ssh/authorized_keys << \EOF +$(ssh-keygen -y -f $SSHKEY) +EOF +chmod 600 /root/.ssh/authorized_keys + +cat > /root/ovirt-installer-answers << \EOF +$(cat ovirt-installer-test-answers) +EOF + +%end +KS + +# remove old server vm +test ! -f ovirt-server-test.tar || rm -f ovirt-server-test.tar +test ! -d test-vm || rm -rf test-vm +sudo virsh destroy ovirt-server-test || true +sudo virsh undefine ovirt-server-test || true + +# create new vm for server, configuring via kickstart, boot it +sudo appliance-creator --config ovirt-server-test.ks --name ovirt-server-test \ + -f qcow2 -p tar -d -v + +# restore original kickstart +mv ovirt-server-test.ks.orig ovirt-server-test.ks + +# define the libvirt vm, boot it +mkdir -p test-vm +tar -xSvf ovirt-server-test.tar -C test-vm +sudo virt-image test-vm/ovirt-server-test/ovirt-server-test.xml +sudo virsh define /etc/libvirt/qemu/ovirt-server-test.xml + +################### test server vm + +# wait till ovirt-appliance is started +for i in $(seq 1 60); do + $ssh_cmd exit && break + sleep 10 +done + +# run installer on server vm, answering preconfigured questions +$ssh_cmd "ovirt-installer < /root/ovirt-installer-answers" +$ssh_cmd "ace -d install ovirt" || true # FIXME when "installer always returns failed" + # bug is fixed, remove this "|| true" + +# run tests on newly installed server +$ssh_cmd "cd /usr/share/ovirt-server && rake db:migrate && rake test" diff --git a/ovirt-installer-test-answers b/ovirt-installer-test-answers new file mode 100644 index 0000000..6827360 --- /dev/null +++ b/ovirt-installer-test-answers @@ -0,0 +1,21 @@ +y +eth0 +eth0 +management.ovirtautobuild.com +n +n +192.168.134 +3 +50 +ovirtautobuild.com +192.168.134.1 +y +n +cobbler +cobbler +cobbler +v23zj59an +v23zj59an +ovirtautobuild.com +ovirt +ovirt diff --git a/ovirt-server-test.ks b/ovirt-server-test.ks new file mode 100644 index 0000000..d0b8842 --- /dev/null +++ b/ovirt-server-test.ks @@ -0,0 +1,37 @@ +install + +lang en_US.UTF-8 +keyboard us +# should have address on default libvirt network +network --device=eth0 --bootproto=static --ip=192.168.122.190 --netmask=255.255.255.0 --onboot=on --nameserver=192.168.122.1 --gateway=192.168.122.1 +# Root password is 'ovirt' +rootpw --iscrypted Xa8QeYfWrtscM +firewall --disabled +authconfig --enableshadow --enablemd5 +selinux --disabled +# NOTE: ntp/ntpdate need to stay in this list to ensure that time on the +# appliance is correct prior to the ovirt-server-installer being run. Otherwise you +# get Kerberos errors +services --disabled=libvirtd,postgresql --enabled=network,iptables,ntpdate,acpid,sshd +timezone --utc UTC +text + +bootloader --location=mbr --driveorder=sda --append="console=tty0" +zerombr +clearpart --all --drives=sda +part /boot --ondisk=sda --fstype=ext3 --size=100 +part / --ondisk=sda --fstype=ext3 --size=5000 +part swap --ondisk=sda --fstype=swap --size=512 +reboot + +repo --name=f10 --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-10&arch=x86_64 +repo --name=ovirt-org --baseurl=http://ovirt.org/repos/ovirt/10/x86_64 +repo --name=f10-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f10&arch=x86_64 +repo --name=ovirt-local --baseurl=file:///var/lib/builder/ovirt/package-root/rpm/RPMS + +%packages --excludedocs --nobase +%include /usr/share/appliance-os/includes/base-pkgs.ks +openssh-server +ovirt-server +ovirt-server-installer +ovirt-node-image-pxe -- 1.6.0.6 From sseago at redhat.com Fri Jun 12 15:59:58 2009 From: sseago at redhat.com (Scott Seago) Date: Fri, 12 Jun 2009 11:59:58 -0400 Subject: [Ovirt-devel] only seeing one NIC in network device editor In-Reply-To: <4A327B14.3080603@redhat.com> References: <4A31F0FE.50806@redfish-group.com> <4A32489A.207@redhat.com> <4A327372.5020700@redfish-group.com> <4A327B14.3080603@redhat.com> Message-ID: <4A327B7E.9060405@redhat.com> including ovirt-devel in the reply Scott Seago wrote: > Justin Clacherty wrote: >> Scott Seago wrote: >>> Yes, this is the way it's currently set up to work. In the 2-or-more >>> network use csae the admin network is intended for node >>> communication only. >> Ok, that makes sense. What about storage? I was under the >> impression that the san could sit on the admin network. Is this the >> case or must it be on the guest network? >> > The san is fine on the admin network, as the node mounts the storage > -- it's exposed to the VM as a local disk. >> Doesn't this make cobbler somewhat redundant? If I set up a distro >> in cobbler, I can't actually use it... Should cobbler be made >> available to the guest network too? Though that would probably mean >> that the admin node would have to serve dns and dhcp to the guest >> network which wouldn't be ideal. >> > Yes, this is an ongoing point of discussion here. Originally it was > all on one network so there weren't any cobbler issues here. Cobbler > images work fine as-is, since the iso gets mounted as a local disk for > the guest. For cobbler profiles to work cobbler would have to listen > on the guest network as well -- or really on any network that a guest > might be on, since it's possible to set up oVirt with more than 2 > networks on the nodes. I'm not sure about dhcp/dns for the guest > network -- we could certainly set it up to do that, but I'd imagine > that in most cases your guest network is your existing public (or > intranet) network that's already served by existing dhcp/dns. Of > course if the guests are coming up on a network that already has an > external pxe server you might have other problems using the cobbler > instance for pxe booting guests. > > Maybe Hugh or someone else has other thoughts on how to handle guest > pxe/provisioning -- it's something we're still discussing. >> Storage is another issue for me at the moment, I set up an iscsi >> partition on my san, then added it under storage (on the admin >> network, but tried it on both admin and guest) but it just shows up >> pending. There's an odd error in the tasks list which is something >> along the lines of it returning 255 (-1 I guess)....Is there a >> problem with connecting to iscsi at the moment? > There shouldn't be any problems with iscsi -- it's been recently > working. If you get us more information on the task error -- including > the relevant contents of /var/log/ovirt-server/taskomatic.log we'll > look into it. > > Thanks, > Scott >> >> Cheers, >> Justin. > > From lutter at redhat.com Fri Jun 12 17:07:19 2009 From: lutter at redhat.com (David Lutterkort) Date: Fri, 12 Jun 2009 10:07:19 -0700 Subject: [Ovirt-devel] only seeing one NIC in network device editor In-Reply-To: <4A327B7E.9060405@redhat.com> References: <4A31F0FE.50806@redfish-group.com> <4A32489A.207@redhat.com> <4A327372.5020700@redfish-group.com> <4A327B14.3080603@redhat.com> <4A327B7E.9060405@redhat.com> Message-ID: <1244826439.26267.27.camel@avon.watzmann.net> On Fri, 2009-06-12 at 11:59 -0400, Scott Seago wrote: > > Maybe Hugh or someone else has other thoughts on how to handle guest > > pxe/provisioning -- it's something we're still discussing. What we need for PXE provisioning are two things: (1) a DHCP server and (2) a TFTP server. For a fairly simple virt management setup, we can continue to assume that the admin for the ovirt infrastructure sets up and manages DHCP in a 'reasonable' manner. For a cloudier setup, we need to manage MAC addresses[1], IP assignments etc. a lot more tightly anyway, so we'd need to run a DHCP server for that anyway. There's a bit of a topology headache there, since DHCP is based on broadcasts, and we need to be sure that the broadcasts don't get stuck at some switch before they reach our DHCP server - we might want to run something like dhcprelay on each node to route all DHCP requests through the admin network. Providing TFTP is much simpler, since it's IP based - we only need to make sure that the address of the TFTP server that our DHCP server hands out can be routed from the guest. By its nature, we'd want the TFTP server to be very close to the cobbler server (I don't see a reason why it wouldn't be on the same box) I am not sure though whether we'd want the actual TFTP traffic on the admin network, or if we'd want that on the guest network. Cobbler (or any other service that you might want to offer to guests and allow them to administer them somewhat) is a good example where you get into 'Infrastructure as a Service' territory; besides the plumbing concerns above, in a cloud setup, we'd want to give each user the illusion that they have their own cobbler server, probably seeded with some default images, but then let them manage that server, upload kickstarts etc. to their heart's content. David [1] For cloud, we also need assign a range of MAC addresses and IP addresses to each VM pool From jguiditt at redhat.com Fri Jun 12 17:44:01 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Fri, 12 Jun 2009 13:44:01 -0400 Subject: [Ovirt-devel] [PATCH server] ovirt server installer autobuild integration In-Reply-To: <1244816797-6464-1-git-send-email-mmorsi@redhat.com> References: <1244816797-6464-1-git-send-email-mmorsi@redhat.com> Message-ID: <1244828641.3800.0.camel@localhost.localdomain> On Fri, 2009-06-12 at 10:26 -0400, Mohammed Morsi wrote: ACK, this seems to work fine on testing From justin at redfish-group.com Fri Jun 12 22:19:02 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Sat, 13 Jun 2009 08:19:02 +1000 Subject: [Ovirt-devel] only seeing one NIC in network device editor In-Reply-To: <4A327B7E.9060405@redhat.com> References: <4A31F0FE.50806@redfish-group.com> <4A32489A.207@redhat.com> <4A327372.5020700@redfish-group.com> <4A327B14.3080603@redhat.com> <4A327B7E.9060405@redhat.com> Message-ID: <4A32D456.3040800@redfish-group.com> Scott Seago wrote: >> There shouldn't be any problems with iscsi -- it's been recently >> working. If you get us more information on the task error -- >> including the relevant contents of >> /var/log/ovirt-server/taskomatic.log we'll look into it. Thanks Scott. The task error from the ovirt management ui is: Error defining pool: Error: Error creating new storage pool (virStoragePoolCreate). Subsystem none: internal error '/sbin/iscsiadm --mode node --portal 192.168.50.37:3260,1 --targetname ovirt0 --login' exited with non-zero status 255 and signal 0: iscsiadm: no records found! in PoolWrap.cpp:ManagementMethod:289 The action is "refresh_pool". The errors from taskomatic.log are below, I'm not sure if the DNS one is relevant... ERROR Fri Jun 12 15:51:33 +1000 2009 (2874) Task action processing failed: RuntimeError: Error defining pool: Error: Error creating new storage pool (virStoragePoolCreate). Subsystem none: internal error '/sbin/iscsiadm --mode node --portal 192.168.50.37:3260,1 --targetname ovirt0 --login' exited with non-zero status 255 and signal 0: iscsiadm: no records found! ERROR Fri Jun 12 15:51:33 +1000 2009 (2874) /usr/share/ovirt-server/task-omatic/./task_storage.rb:159:in `connect'/usr/share/ovirt-server/task-omatic/taskomatic.rb:634:in `task_refresh_pool'/usr/share/ovirt-server/task-omatic/taskomatic.rb:905:in `mainloop'/usr/share/ovirt-server/task-omatic/taskomatic.rb:879:in `each'/usr/share/ovirt-server/task-omatic/taskomatic.rb:879:in `mainloop'/usr/share/ovirt-server/task-omatic/taskomatic.rb:846:in `loop'/usr/share/ovirt-server/task-omatic/taskomatic.rb:846:in `mainloop'/usr/share/ovirt-server/task-omatic/taskomatic.rb:946 ERROR Sat Jun 13 08:07:02 +1000 2009 (2877) Unable to determine qpid server from DNS SRV record, retrying.. I can mount the iscsi target fine from a Vista machine. The target is being exported by a Netgear ReadyNAS Pro. No authentication is required on the target I'm mounting. Cheers, Justin. From justin at redfish-group.com Sat Jun 13 08:37:47 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Sat, 13 Jun 2009 18:37:47 +1000 Subject: [Ovirt-devel] only seeing one NIC in network device editor In-Reply-To: <4A32D456.3040800@redfish-group.com> References: <4A31F0FE.50806@redfish-group.com> <4A32489A.207@redhat.com> <4A327372.5020700@redfish-group.com> <4A327B14.3080603@redhat.com> <4A327B7E.9060405@redhat.com> <4A32D456.3040800@redfish-group.com> Message-ID: <4A33655B.6020304@redfish-group.com> Justin Clacherty wrote: > Error defining pool: Error: Error creating new storage pool > (virStoragePoolCreate). Subsystem none: internal error '/sbin/iscsiadm > --mode node --portal 192.168.50.37:3260,1 --targetname ovirt0 --login' > exited with non-zero status 255 and signal 0: iscsiadm: no records > found! in PoolWrap.cpp:ManagementMethod:289 Figured it out. The target name was incorrect, it needs to have the iqn. A nice add-on to avoid this kind of thing would be to have a discovery section to the wizard. This way you could enter in the ip address of the san and have it do a discover and list the available targets, then select the target you want from there. Does this sound like some worth adding? Also, should the storage wizard have a section for authentication in the event it's enabled on the san? Cheers, Justin. From pronix.service at gmail.com Mon Jun 15 09:07:47 2009 From: pronix.service at gmail.com (Dmitriy Vasiletc) Date: Mon, 15 Jun 2009 13:07:47 +0400 Subject: [Ovirt-devel] [PATCH][ovirt-server] restart ipa after installation and before set admin password Message-ID: <1245056867-12256-1-git-send-email-pronix.service@gmail.com> From: ??????? if krb5kdc has worked before installation appear error. and require 'ipactl restart' --- installer/modules/ovirt/manifests/freeipa.pp | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/installer/modules/ovirt/manifests/freeipa.pp b/installer/modules/ovirt/manifests/freeipa.pp index aa806fe..5a9fb44 100644 --- a/installer/modules/ovirt/manifests/freeipa.pp +++ b/installer/modules/ovirt/manifests/freeipa.pp @@ -64,6 +64,11 @@ class freeipa::bundled{ require => [Exec[set_kdc_defaults],Single_exec[dnsmasq_restart]] } + exec {"restart_ipa": + command => "/usr/sbin/ipactl restart", + require => Single_Exec[ipa_server_install] + } + exec {"get_krb5_tkt": command => "/bin/echo $freeipa_password|/usr/kerberos/bin/kinit admin", require => Single_Exec[ipa_server_install] -- 1.6.0.6 From dpierce at redhat.com Mon Jun 15 19:16:26 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 15 Jun 2009 15:16:26 -0400 Subject: [Ovirt-devel] [PATCH node-image] Adds livecd-iso-to-{disk, pxeboot} to the root ISO directory. Message-ID: <1245093386-17073-1-git-send-email-dpierce@redhat.com> When the ISO is build, the scripts are copied off of the build host and placed into the ISO. Then a user can mount the ISO and use the scripts to create a bootable CD or USB drive. Signed-off-by: Darryl L. Pierce --- ovirt-node-image.ks | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ovirt-node-image.ks b/ovirt-node-image.ks index e1ae65c..4d1fcfc 100644 --- a/ovirt-node-image.ks +++ b/ovirt-node-image.ks @@ -106,5 +106,12 @@ rm -Rf $manifests %post --nochroot # Move manifest tar to build directory mv $INSTALL_ROOT/ovirt-node-image-manifests*.tar . + +# only works on x86, x86_64 +if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then + if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi + cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS + cp /usr/bin/livecd-iso-to-pxeboot $LIVE_ROOT/LiveOS +fi %end -- 1.6.0.6 From dpierce at redhat.com Mon Jun 15 19:17:37 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 15 Jun 2009 15:17:37 -0400 Subject: [Ovirt-devel] Re: [PATCH node] NTP and DNS information are persisted. rhbz#505342 In-Reply-To: <1244742283-11335-1-git-send-email-dpierce@redhat.com> References: <1244742283-11335-1-git-send-email-dpierce@redhat.com> Message-ID: <20090615191737.GC3979@mcpierce-laptop.rdu.redhat.com> On Thu, Jun 11, 2009 at 01:44:43PM -0400, Darryl L. Pierce wrote: > Adds a call to persist the file /etc/ntp.conf after it has been setup > and the configuration saved. > > DNS details are inserted into the bridge configuration file for the > management NIC being defined. > > Signed-off-by: Darryl L. Pierce > --- Can I get an ACK? -- 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 dpierce at redhat.com Mon Jun 15 19:17:48 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 15 Jun 2009 15:17:48 -0400 Subject: [Ovirt-devel] Re: [PATCH node] o-c-config will only run when local storage is configured. rhbz#505560 In-Reply-To: <1244812252-21430-1-git-send-email-dpierce@redhat.com> References: <1244812252-21430-1-git-send-email-dpierce@redhat.com> Message-ID: <20090615191748.GD3979@mcpierce-laptop.rdu.redhat.com> On Fri, Jun 12, 2009 at 09:10:52AM -0400, Darryl L. Pierce wrote: > o-c-config checks to see if local storage is configured prior to > starting. If local storage is not configured then it reports an error > and exits. > > Signed-off-by: Darryl L. Pierce > --- Can I get an ACK? -- 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 dhuff at redhat.com Mon Jun 15 21:15:49 2009 From: dhuff at redhat.com (David Huff) Date: Mon, 15 Jun 2009 17:15:49 -0400 Subject: [Ovirt-devel] Re: [PATCH node] o-c-config will only run when local storage is configured. rhbz#505560 In-Reply-To: <20090615191748.GD3979@mcpierce-laptop.rdu.redhat.com> References: <1244812252-21430-1-git-send-email-dpierce@redhat.com> <20090615191748.GD3979@mcpierce-laptop.rdu.redhat.com> Message-ID: <4A36BA05.2000206@redhat.com> Darryl L. Pierce wrote: > On Fri, Jun 12, 2009 at 09:10:52AM -0400, Darryl L. Pierce wrote: >> o-c-config checks to see if local storage is configured prior to >> starting. If local storage is not configured then it reports an error >> and exits. >> >> Signed-off-by: Darryl L. Pierce >> --- > > Can I get an ACK? Looks good to me.. ACK -D From dhuff at redhat.com Mon Jun 15 21:59:44 2009 From: dhuff at redhat.com (David Huff) Date: Mon, 15 Jun 2009 17:59:44 -0400 Subject: [Ovirt-devel] [PATCH node-image] Adds livecd-iso-to-{disk, pxeboot} to the root ISO directory. In-Reply-To: <1245093386-17073-1-git-send-email-dpierce@redhat.com> References: <1245093386-17073-1-git-send-email-dpierce@redhat.com> Message-ID: <4A36C450.5070700@redhat.com> Darryl L. Pierce wrote: > When the ISO is build, the scripts are copied off of the build host and > placed into the ISO. Then a user can mount the ISO and use the scripts > to create a bootable CD or USB drive. ACK: scripts are in LivecdOS dir on iso image.... However user would have to copy scripts off of the image and then umount the image in order to create a bootabel usbkey? is this the proper usecase?? -D From apevec at gmail.com Tue Jun 16 06:49:41 2009 From: apevec at gmail.com (Alan Pevec) Date: Tue, 16 Jun 2009 08:49:41 +0200 Subject: [Ovirt-devel] [PATCH node-image] Adds livecd-iso-to-{disk, pxeboot} to the root ISO directory. In-Reply-To: <4A36C450.5070700@redhat.com> References: <1245093386-17073-1-git-send-email-dpierce@redhat.com> <4A36C450.5070700@redhat.com> Message-ID: <2be7262f0906152349q4cc66a6ieb910bf9437dbb09@mail.gmail.com> On Mon, Jun 15, 2009 at 11:59 PM, David Huff wrote: > Darryl L. Pierce wrote: > > When the ISO is build, the scripts are copied off of the build host and > > placed into the ISO. Then a user can mount the ISO and use the scripts > > to create a bootable CD or USB drive. > > ACK: scripts are in LivecdOS dir on iso image.... > > However user would have to copy scripts off of the image and then umount > the image in order to create a bootabel usbkey? is this the proper > usecase?? > no, scripts should be executable from ISO - why that fails? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pronix.service at gmail.com Tue Jun 16 09:47:20 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Tue, 16 Jun 2009 13:47:20 +0400 Subject: [Ovirt-devel] SSL Library Error: -12271 SSL client cannot verify your certificate Message-ID: <4A376A28.1000207@gmail.com> Hello i install ovirt and it work. But all encryption connections finished with error (Error code: sec_error_reused_issuer_and_serial) And server write to log SSL Library Error: -12271 SSL client cannot verify your certificate First i think need check dns querys. I see many A querys for example.com May be i must regenerate certificate ? Where i can read about that . Thanks. -- ? ?????????, ??????? From dpierce at redhat.com Tue Jun 16 13:04:44 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Jun 2009 09:04:44 -0400 Subject: [Ovirt-devel] Re: [PATCH node] o-c-config will only run when local storage is configured. rhbz#505560 In-Reply-To: <4A36BA05.2000206@redhat.com> References: <1244812252-21430-1-git-send-email-dpierce@redhat.com> <20090615191748.GD3979@mcpierce-laptop.rdu.redhat.com> <4A36BA05.2000206@redhat.com> Message-ID: <20090616130444.GC4430@mcpierce-laptop.rdu.redhat.com> On Mon, Jun 15, 2009 at 05:15:49PM -0400, David Huff wrote: > Darryl L. Pierce wrote: > > On Fri, Jun 12, 2009 at 09:10:52AM -0400, Darryl L. Pierce wrote: > >> o-c-config checks to see if local storage is configured prior to > >> starting. If local storage is not configured then it reports an error > >> and exits. > >> > >> Signed-off-by: Darryl L. Pierce > >> --- > > > > Can I get an ACK? > > Looks good to me.. ACK Thanks. This is pushed. -- 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 dpierce at redhat.com Tue Jun 16 13:08:21 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Jun 2009 09:08:21 -0400 Subject: [Ovirt-devel] [PATCH node-image] Adds livecd-iso-to-{disk, pxeboot} to the root ISO directory. In-Reply-To: <4A36C450.5070700@redhat.com> References: <1245093386-17073-1-git-send-email-dpierce@redhat.com> <4A36C450.5070700@redhat.com> Message-ID: <20090616130821.GD4430@mcpierce-laptop.rdu.redhat.com> On Mon, Jun 15, 2009 at 05:59:44PM -0400, David Huff wrote: > Darryl L. Pierce wrote: > > When the ISO is build, the scripts are copied off of the build host and > > placed into the ISO. Then a user can mount the ISO and use the scripts > > to create a bootable CD or USB drive. > > ACK: scripts are in LivecdOS dir on iso image.... > > However user would have to copy scripts off of the image and then umount > the image in order to create a bootabel usbkey? is this the proper > usecase?? This follows the same pattern as Fedora LiveCDs. However, I'm able to mount the ISO and then run the scripts against that ISO. -- 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 slinabery at redhat.com Tue Jun 16 14:38:51 2009 From: slinabery at redhat.com (Steve Linabery) Date: Tue, 16 Jun 2009 09:38:51 -0500 Subject: [Ovirt-devel] SSL Library Error: -12271 SSL client cannot verify your certificate In-Reply-To: <4A376A28.1000207@gmail.com> References: <4A376A28.1000207@gmail.com> Message-ID: <20090616143851.GA29198@redhat.com> On Tue, Jun 16, 2009 at 01:47:20PM +0400, dima vasiletc wrote: > Hello > i install ovirt and it work. > But all encryption connections finished with error (Error code: > sec_error_reused_issuer_and_serial) > And server write to log SSL Library Error: -12271 SSL client cannot > verify your certificate > First i think need check dns querys. > I see many A querys for example.com > May be i must regenerate certificate ? Where i can read about that . > Thanks. > > -- > ? ?????????, ??????? > It sounds like perhaps you installed ovirt more than once, and your browser is rejecting the ssl certificate. Try deleting the certificate from your browser. In Firefox, Edit->Preferences, then click 'Advanced,' then the 'Encryption' tag. I don't know where other browsers manage their certs. Good day, Steve From jguiditt at redhat.com Tue Jun 16 15:10:57 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Tue, 16 Jun 2009 11:10:57 -0400 Subject: [Ovirt-devel] [PATCH server] Fix errors in controller tests. Message-ID: <1245165057-10565-1-git-send-email-jguiditt@redhat.com> A bunch of controllers were not extending ActionController::TestCase, and instead were just using the basic test/unit testcase, so we were not getting some of the rails baked-in stuff. Signed-off-by: Jason Guiditta --- src/test/functional/host_controller_test.rb | 2 +- src/test/functional/nic_controller_test.rb | 2 +- src/test/functional/permission_controller_test.rb | 5 +++-- src/test/functional/quota_controller_test.rb | 2 +- src/test/functional/storage_controller_test.rb | 2 +- src/test/functional/task_controller_test.rb | 2 +- src/test/functional/vm_controller_test.rb | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/functional/host_controller_test.rb b/src/test/functional/host_controller_test.rb index caf198d..dc9891c 100644 --- a/src/test/functional/host_controller_test.rb +++ b/src/test/functional/host_controller_test.rb @@ -23,7 +23,7 @@ require 'host_controller' # Re-raise errors caught by the controller. class HostController; def rescue_action(e) raise e end; end -class HostControllerTest < Test::Unit::TestCase +class HostControllerTest < ActionController::TestCase fixtures :hosts, :pools, :privileges, :roles, :permissions def setup diff --git a/src/test/functional/nic_controller_test.rb b/src/test/functional/nic_controller_test.rb index 59183ba..60b5670 100644 --- a/src/test/functional/nic_controller_test.rb +++ b/src/test/functional/nic_controller_test.rb @@ -23,7 +23,7 @@ require 'nic_controller' # Re-raise errors caught by the controller. class NicController; def rescue_action(e) raise e end; end -class NicControllerTest < Test::Unit::TestCase +class NicControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools, :nics def setup diff --git a/src/test/functional/permission_controller_test.rb b/src/test/functional/permission_controller_test.rb index 0885890..49bf1ef 100644 --- a/src/test/functional/permission_controller_test.rb +++ b/src/test/functional/permission_controller_test.rb @@ -1,6 +1,7 @@ # Copyright (C) 2008 Red Hat, Inc. -# Written by Scott Seago +# Written by Scott Seago , +# Jason Guiditta # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +24,7 @@ require 'permission_controller' # Re-raise errors caught by the controller. class PermissionController; def rescue_action(e) raise e end; end -class PermissionControllerTest < Test::Unit::TestCase +class PermissionControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools def setup diff --git a/src/test/functional/quota_controller_test.rb b/src/test/functional/quota_controller_test.rb index 1496652..35f23c0 100644 --- a/src/test/functional/quota_controller_test.rb +++ b/src/test/functional/quota_controller_test.rb @@ -23,7 +23,7 @@ require 'quota_controller' # Re-raise errors caught by the controller. class QuotaController; def rescue_action(e) raise e end; end -class QuotaControllerTest < Test::Unit::TestCase +class QuotaControllerTest < ActionController::TestCase fixtures :quotas, :pools def setup diff --git a/src/test/functional/storage_controller_test.rb b/src/test/functional/storage_controller_test.rb index fcf0293..e10a662 100644 --- a/src/test/functional/storage_controller_test.rb +++ b/src/test/functional/storage_controller_test.rb @@ -23,7 +23,7 @@ require 'storage_controller' # Re-raise errors caught by the controller. class StorageController; def rescue_action(e) raise e end; end -class StorageControllerTest < Test::Unit::TestCase +class StorageControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools, :storage_volumes, :storage_pools diff --git a/src/test/functional/task_controller_test.rb b/src/test/functional/task_controller_test.rb index 3b90756..a2a6393 100644 --- a/src/test/functional/task_controller_test.rb +++ b/src/test/functional/task_controller_test.rb @@ -23,7 +23,7 @@ require 'task_controller' # Re-raise errors caught by the controller. class TaskController; def rescue_action(e) raise e end; end -class TaskControllerTest < Test::Unit::TestCase +class TaskControllerTest < ActionController::TestCase fixtures :tasks, :vms, :pools def setup diff --git a/src/test/functional/vm_controller_test.rb b/src/test/functional/vm_controller_test.rb index a059c50..1271851 100644 --- a/src/test/functional/vm_controller_test.rb +++ b/src/test/functional/vm_controller_test.rb @@ -23,7 +23,7 @@ require 'vm_controller' # Re-raise errors caught by the controller. class VmController; def rescue_action(e) raise e end; end -class VmControllerTest < Test::Unit::TestCase +class VmControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools, :vms def setup -- 1.6.0.6 From pronix.service at gmail.com Tue Jun 16 15:54:53 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Tue, 16 Jun 2009 19:54:53 +0400 Subject: [Ovirt-devel] SSL Library Error: -12271 SSL client cannot verify your certificate In-Reply-To: <20090616143851.GA29198@redhat.com> References: <4A376A28.1000207@gmail.com> <20090616143851.GA29198@redhat.com> Message-ID: <4A37C04D.3020206@gmail.com> On 06/16/2009 06:38 PM, Steve Linabery wrote: > On Tue, Jun 16, 2009 at 01:47:20PM +0400, dima vasiletc wrote: > >> Hello >> i install ovirt and it work. >> But all encryption connections finished with error (Error code: >> sec_error_reused_issuer_and_serial) >> And server write to log SSL Library Error: -12271 SSL client cannot >> verify your certificate >> First i think need check dns querys. >> I see many A querys for example.com >> May be i must regenerate certificate ? Where i can read about that . >> Thanks. >> >> -- >> ? ?????????, ??????? >> >> > It sounds like perhaps you installed ovirt more than once, and your browser is rejecting the ssl certificate. Try deleting the certificate from your browser. In Firefox, Edit->Preferences, then click 'Advanced,' then the 'Encryption' tag. I don't know where other browsers manage their certs. > > Good day, > Steve > > Thanks i remove all certificate and restart browser -- ? ?????????, ??????? From dpierce at redhat.com Tue Jun 16 16:25:34 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Jun 2009 12:25:34 -0400 Subject: [Ovirt-devel] [PATCH node] Adds a log viewer option to o-c-setup. bz#506289 Message-ID: <1245169534-4136-1-git-send-email-dpierce@redhat.com> A new menu option to view the file /var/log/ovirt.log is added. If the file doesn't exist or is 0 bytes then a message saying the log is empty is shown. Otherwise, it's displayed using the less command. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-setup | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup index ee78254..11711e1 100755 --- a/scripts/ovirt-config-setup +++ b/scripts/ovirt-config-setup @@ -11,6 +11,8 @@ CONFIG_DIR=/etc/ovirt-config-setup.d # special options, all others execute the symlinked script in CONFIG_DIR DEBUG_SHELL="Shell" CONTINUE="Continue Stateless Boot" +VIEW_LOG="View ovirt.log" +OVIRT_LOG=/var/log/ovirt.log declare -a OPTIONS @@ -33,6 +35,7 @@ for cfg in $CONFIG_DIR/*; do done OPTIONS[${#OPTIONS[*]}]="$DEBUG_SHELL" OPTIONS[${#OPTIONS[*]}]="$CONTINUE" +OPTIONS[${#OPTIONS[*]}]="$VIEW_LOG" # reset tty, otherwise serial console is broken @@ -51,6 +54,14 @@ while true; do case "$OPTION" in "$DEBUG_SHELL") clear; bash; break ;; "$CONTINUE") exit 0 ;; + "$VIEW_LOG") + if [ -s $OVIRT_LOG ]; then + clear + less -R $OVIRT_LOG + else + printf "\nThe log is currently empty.\n\n" + fi + ;; "") break ;; *) { -- 1.6.0.6 From dpierce at redhat.com Tue Jun 16 16:27:33 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 16 Jun 2009 12:27:33 -0400 Subject: [Ovirt-devel] [PATCH node-image] Adds livecd-iso-to-{disk, pxeboot} to the root ISO directory. In-Reply-To: <4A36C450.5070700@redhat.com> References: <1245093386-17073-1-git-send-email-dpierce@redhat.com> <4A36C450.5070700@redhat.com> Message-ID: <20090616162733.GB4252@mcpierce-laptop.rdu.redhat.com> On Mon, Jun 15, 2009 at 05:59:44PM -0400, David Huff wrote: > Darryl L. Pierce wrote: > > When the ISO is build, the scripts are copied off of the build host and > > placed into the ISO. Then a user can mount the ISO and use the scripts > > to create a bootable CD or USB drive. > > ACK: scripts are in LivecdOS dir on iso image.... Pushed. -- 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 pmyers at redhat.com Tue Jun 16 16:30:54 2009 From: pmyers at redhat.com (Perry Myers) Date: Tue, 16 Jun 2009 12:30:54 -0400 Subject: [Ovirt-devel] [PATCH node] Adds a log viewer option to o-c-setup. bz#506289 In-Reply-To: <1245169534-4136-1-git-send-email-dpierce@redhat.com> References: <1245169534-4136-1-git-send-email-dpierce@redhat.com> Message-ID: <4A37C8BE.6030205@redhat.com> On 06/16/2009 12:25 PM, Darryl L. Pierce wrote: > A new menu option to view the file /var/log/ovirt.log is added. If the > file doesn't exist or is 0 bytes then a message saying the log is empty > is shown. Otherwise, it's displayed using the less command. Hmm, we want to be able to view other logs easily too. Like /var/log/messages and /var/log/secure for starters. Perhaps this patch should be extended to be easily configurable to display an arbitrary number of log files? Perry From pronix.service at gmail.com Tue Jun 16 17:38:50 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Tue, 16 Jun 2009 21:38:50 +0400 Subject: [Ovirt-devel] Sasl error: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure. Message-ID: <4A37D8AA.3000006@gmail.com> Hello I have error during connection from managed host to ovirt server. Jun 16 12:31:24 main qpidd[27662]: 2009-jun-16 12:31:24 warning Client closed connection with 501: internal-error: Sasl error: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (No credentials cache found) (qpid/client/SaslFactory.cpp:226) I read on this maillist about similar error. Check dns - all dns querys successfuly resolve. ptr and A query match. what can be cause of this error ? Thanks. -- ? ?????????, ??????? From mmorsi at redhat.com Tue Jun 16 21:13:20 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Tue, 16 Jun 2009 17:13:20 -0400 Subject: [Ovirt-devel] [PATCH server] Fix errors in controller tests. In-Reply-To: <1245165057-10565-1-git-send-email-jguiditt@redhat.com> References: <1245165057-10565-1-git-send-email-jguiditt@redhat.com> Message-ID: <4A380AF0.6020301@redhat.com> ACK, looks good, the error's gone. -Mo From jguiditt at redhat.com Tue Jun 16 21:27:21 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Tue, 16 Jun 2009 17:27:21 -0400 Subject: [Ovirt-devel] [PATCH server] Fix errors in controller tests. In-Reply-To: <4A380AF0.6020301@redhat.com> References: <1245165057-10565-1-git-send-email-jguiditt@redhat.com> <4A380AF0.6020301@redhat.com> Message-ID: <1245187641.4252.7.camel@localhost.localdomain> On Tue, 2009-06-16 at 17:13 -0400, Mohammed Morsi wrote: > ACK, looks good, the error's gone. > > -Mo Pushed. From sseago at redhat.com Wed Jun 17 19:19:38 2009 From: sseago at redhat.com (Scott Seago) Date: Wed, 17 Jun 2009 15:19:38 -0400 Subject: [Ovirt-devel] [PATCH] add cmd line option for server vnc port In-Reply-To: <1244655174-26297-1-git-send-email-mmorsi@redhat.com> References: <1244655174-26297-1-git-send-email-mmorsi@redhat.com> Message-ID: <4A3941CA.4000406@redhat.com> Mohammed Morsi wrote: > --- > internal.h | 3 +++ > main.c | 3 +++ > tunnel.c | 7 ++----- > 3 files changed, 8 insertions(+), 5 deletions(-) > ACK From sseago at redhat.com Wed Jun 17 19:19:48 2009 From: sseago at redhat.com (Scott Seago) Date: Wed, 17 Jun 2009 15:19:48 -0400 Subject: [Ovirt-devel] Re: [PATCH server] small fix to optionparser call to allow port arg to accept an int In-Reply-To: <1244657119-27782-1-git-send-email-mmorsi@redhat.com> References: <1244657119-27782-1-git-send-email-mmorsi@redhat.com> Message-ID: <4A3941D4.4010202@redhat.com> Mohammed Morsi wrote: > --- > src/vnc-proxy/vnc-proxy.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/vnc-proxy/vnc-proxy.rb b/src/vnc-proxy/vnc-proxy.rb > index a411d69..73327bb 100755 > --- a/src/vnc-proxy/vnc-proxy.rb > +++ b/src/vnc-proxy/vnc-proxy.rb > @@ -63,7 +63,7 @@ class VncProxy > opts.on("-n", "--nodaemon", "Run interactively (useful for debugging)") do |n| > do_daemon = false > end > - opts.on("-p", "--port", "Port to listen on") do |n| > + opts.on("-p", "--port [port]", "Port to listen on") do |n| > port = n.to_i > end > end > ACK From sseago at redhat.com Wed Jun 17 19:20:02 2009 From: sseago at redhat.com (Scott Seago) Date: Wed, 17 Jun 2009 15:20:02 -0400 Subject: [Ovirt-devel] [PATCH server] added ovirt-vnc-proxy sysconfig In-Reply-To: <1244657789-28282-1-git-send-email-mmorsi@redhat.com> References: <1244657789-28282-1-git-send-email-mmorsi@redhat.com> Message-ID: <4A3941E2.9080003@redhat.com> Mohammed Morsi wrote: > --- > conf/ovirt-vnc-proxy | 6 ++++-- > conf/ovirt-vnc-proxy.sysconf | 2 ++ > ovirt-server.spec.in | 2 ++ > 3 files changed, 8 insertions(+), 2 deletions(-) > create mode 100644 conf/ovirt-vnc-proxy.sysconf > > ACK From pronix.service at gmail.com Wed Jun 17 19:59:00 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Wed, 17 Jun 2009 23:59:00 +0400 Subject: [Ovirt-devel] Re: Sasl error: SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure. In-Reply-To: <4A37D8AA.3000006@gmail.com> References: <4A37D8AA.3000006@gmail.com> Message-ID: <4A394B04.8080504@gmail.com> On 06/16/2009 09:38 PM, dima vasiletc wrote: > Hello > I have error during connection from managed host to ovirt server. > Jun 16 12:31:24 main qpidd[27662]: 2009-jun-16 12:31:24 warning Client > closed connection with 501: internal-error: Sasl error: SASL(-1): > generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may > provide more information (No credentials cache found) > (qpid/client/SaslFactory.cpp:226) > > I read on this maillist about similar error. > Check dns - all dns querys successfuly resolve. > ptr and A query match. > what can be cause of this error ? > Thanks. > Hello Nobody know what can cause this error ? i tried set in default ks file key rootpw with password's hash - for access to second node by password. after reboot node and successfuly boot from management server i tried login and got mismatch password. hint please how to setpassword for second node - i try debug this error on other node. Thanks -- ? ?????????, ??????? From jboggs at redhat.com Thu Jun 18 00:20:32 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 17 Jun 2009 20:20:32 -0400 Subject: [Ovirt-devel] [PATCH][ovirt-server] restart ipa after installation and before set admin password In-Reply-To: <1245056867-12256-1-git-send-email-pronix.service@gmail.com> References: <1245056867-12256-1-git-send-email-pronix.service@gmail.com> Message-ID: <4A398850.1090007@redhat.com> What were you running into that an ipa restart was needed? IPA *should* be in a good state before running the critical portions on ovirt user/group settings. Dmitriy Vasiletc wrote: > From: ??????? > > if krb5kdc has worked before installation appear error. and require 'ipactl restart' > > > --- > installer/modules/ovirt/manifests/freeipa.pp | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/installer/modules/ovirt/manifests/freeipa.pp b/installer/modules/ovirt/manifests/freeipa.pp > index aa806fe..5a9fb44 100644 > --- a/installer/modules/ovirt/manifests/freeipa.pp > +++ b/installer/modules/ovirt/manifests/freeipa.pp > @@ -64,6 +64,11 @@ class freeipa::bundled{ > require => [Exec[set_kdc_defaults],Single_exec[dnsmasq_restart]] > } > > + exec {"restart_ipa": > + command => "/usr/sbin/ipactl restart", > + require => Single_Exec[ipa_server_install] > + } > + > exec {"get_krb5_tkt": > command => "/bin/echo $freeipa_password|/usr/kerberos/bin/kinit admin", > require => Single_Exec[ipa_server_install] > From pronix.service at gmail.com Thu Jun 18 07:34:25 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Thu, 18 Jun 2009 11:34:25 +0400 Subject: [Ovirt-devel] [PATCH][ovirt-server] restart ipa after installation and before set admin password In-Reply-To: <4A398850.1090007@redhat.com> References: <1245056867-12256-1-git-send-email-pronix.service@gmail.com> <4A398850.1090007@redhat.com> Message-ID: <4A39EE01.9000907@gmail.com> Hello Restart ipa will be before load ovirt data. On 06/18/2009 04:20 AM, Joey Boggs wrote: > What were you running into that an ipa restart was needed? IPA > *should* be in a good state before running the critical portions on > ovirt user/group settings. > > > > Dmitriy Vasiletc wrote: >> From: ??????? >> >> if krb5kdc has worked before installation appear error. and require >> 'ipactl restart' >> >> >> --- >> installer/modules/ovirt/manifests/freeipa.pp | 5 +++++ >> 1 files changed, 5 insertions(+), 0 deletions(-) >> >> diff --git a/installer/modules/ovirt/manifests/freeipa.pp >> b/installer/modules/ovirt/manifests/freeipa.pp >> index aa806fe..5a9fb44 100644 >> --- a/installer/modules/ovirt/manifests/freeipa.pp >> +++ b/installer/modules/ovirt/manifests/freeipa.pp >> @@ -64,6 +64,11 @@ class freeipa::bundled{ >> require => >> [Exec[set_kdc_defaults],Single_exec[dnsmasq_restart]] >> } >> >> + exec {"restart_ipa": >> + command => "/usr/sbin/ipactl restart", >> + require => Single_Exec[ipa_server_install] >> + } >> + >> exec {"get_krb5_tkt": >> command => "/bin/echo >> $freeipa_password|/usr/kerberos/bin/kinit admin", >> require => Single_Exec[ipa_server_install] > > -- ? ?????????, ??????? From apevec at redhat.com Thu Jun 18 12:52:37 2009 From: apevec at redhat.com (Alan Pevec) Date: Thu, 18 Jun 2009 14:52:37 +0200 Subject: [Ovirt-devel] Re: [PATCH node] NTP and DNS information are persisted. rhbz#505342 In-Reply-To: <1244742283-11335-1-git-send-email-dpierce@redhat.com> References: <1244742283-11335-1-git-send-email-dpierce@redhat.com> Message-ID: <4A3A3895.70405@redhat.com> ACK - I pushed this to next From jboggs at redhat.com Thu Jun 18 13:55:28 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 18 Jun 2009 09:55:28 -0400 Subject: [Ovirt-devel] [PATCH][ovirt-server] restart ipa after installation and before set admin password In-Reply-To: <4A39EE01.9000907@gmail.com> References: <1245056867-12256-1-git-send-email-pronix.service@gmail.com> <4A398850.1090007@redhat.com> <4A39EE01.9000907@gmail.com> Message-ID: <4A3A4750.5090609@redhat.com> ipa starts on the initial install/configuration of itself and is ready prior to running the portions required for ovirt, can you tell me what you were running into to need a restart? The patch only restarts ipa at any given point after ipa is installed, should it restart at a specific point during the ovirt installation? dima vasiletc wrote: > Hello > Restart ipa will be before load ovirt data. > > > On 06/18/2009 04:20 AM, Joey Boggs wrote: >> What were you running into that an ipa restart was needed? IPA >> *should* be in a good state before running the critical portions on >> ovirt user/group settings. >> >> >> >> Dmitriy Vasiletc wrote: >>> From: ??????? >>> >>> if krb5kdc has worked before installation appear error. and require >>> 'ipactl restart' >>> >>> >>> --- >>> installer/modules/ovirt/manifests/freeipa.pp | 5 +++++ >>> 1 files changed, 5 insertions(+), 0 deletions(-) >>> >>> diff --git a/installer/modules/ovirt/manifests/freeipa.pp >>> b/installer/modules/ovirt/manifests/freeipa.pp >>> index aa806fe..5a9fb44 100644 >>> --- a/installer/modules/ovirt/manifests/freeipa.pp >>> +++ b/installer/modules/ovirt/manifests/freeipa.pp >>> @@ -64,6 +64,11 @@ class freeipa::bundled{ >>> require => >>> [Exec[set_kdc_defaults],Single_exec[dnsmasq_restart]] >>> } >>> >>> + exec {"restart_ipa": >>> + command => "/usr/sbin/ipactl restart", >>> + require => Single_Exec[ipa_server_install] >>> + } >>> + >>> exec {"get_krb5_tkt": >>> command => "/bin/echo >>> $freeipa_password|/usr/kerberos/bin/kinit admin", >>> require => Single_Exec[ipa_server_install] >> >> > > From dpierce at redhat.com Thu Jun 18 13:56:01 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 18 Jun 2009 09:56:01 -0400 Subject: [Ovirt-devel] [PATCH node] Users can view log files on the node. bz#506289 Message-ID: <1245333361-24745-1-git-send-email-dpierce@redhat.com> Adds a new menu item which launches a separate script. That separate script presents a list of log files to the user. Signed-off-by: Darryl L. Pierce --- Makefile.am | 1 + ovirt-node.spec.in | 3 +++ scripts/ovirt-config-view-logs | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 0 deletions(-) create mode 100755 scripts/ovirt-config-view-logs diff --git a/Makefile.am b/Makefile.am index 57eceb5..2f52144 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,6 +40,7 @@ EXTRA_DIST = \ scripts/ovirt-config-setup \ scripts/ovirt-config-storage \ scripts/ovirt-config-uninstall \ + scripts/ovirt-config-view-logs \ scripts/ovirt-early \ scripts/ovirt-firstboot \ scripts/ovirt-functions \ diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index e5d1d51..6fa45ce 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -159,6 +159,7 @@ cd - %{__install} -D -m0755 scripts/ovirt-install-node-stateful %{buildroot}%{_sbindir} %{__install} -D -m0755 scripts/ovirt-install-node-stateless %{buildroot}%{_sbindir} %{__install} -D -m0755 scripts/ovirt-uninstall-node-stateful %{buildroot}%{_sbindir} +%{__install} -D -m0755 scripts/ovirt-config-view-logs %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/persist %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/unpersist %{buildroot}%{_sbindir} %{__install} -p -m0755 ovirt-identify-node/ovirt-identify-node %{buildroot}%{_sbindir} @@ -227,6 +228,7 @@ ln -s ovirt-release %{buildroot}/etc/system-release %{__ln_s} ../..%{_sbindir}/ovirt-config-networking %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"15_Networking Setup" %{__ln_s} ../..%{_sbindir}/ovirt-config-logging %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"30_Logging Setup" %{__ln_s} ../..%{_sbindir}/ovirt-config-collectd %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"35_Collectd Setup" +%{__ln_s} ../..%{_sbindir}/ovirt-config-view-logs %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"90_View logs" %{__ln_s} ../..%{_sbindir}/ovirt-config-boot-wrapper %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"98_Local install and reboot" %{__ln_s} ../..%{_sbindir}/ovirt-config-uninstall %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"99_Uninstall node" @@ -311,6 +313,7 @@ fi %{_sbindir}/ovirt-config-setup %{_sbindir}/ovirt-config-storage %{_sbindir}/ovirt-config-uninstall +%{_sbindir}/ovirt-config-view-logs %{_sbindir}/ovirt-process-config %{_sbindir}/ovirt-install-node-stateless %{_sbindir}/gptsync diff --git a/scripts/ovirt-config-view-logs b/scripts/ovirt-config-view-logs new file mode 100755 index 0000000..f21b462 --- /dev/null +++ b/scripts/ovirt-config-view-logs @@ -0,0 +1,37 @@ +#!/bin/bash +# + +. /etc/init.d/ovirt-functions + +ME=$(basename "$0") +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } + +trap '__st=$?; stop_log; exit $__st' 0 +trap 'exit $?' 1 2 13 15 + +RETURN_TO_MENU="Return To Menu" + +OPTIONS[${#OPTIONS[*]}]="/var/log/ovirt.log" +OPTIONS[${#OPTIONS[*]}]="$RETURN_TO_MENU" + +while true; do + printf "\nPlease select a log file to view.\n\n" + PS3="Please select a log to view: " + select OPTION in "${OPTIONS[@]}" + do + case $OPTION in + "$RETURN_TO_MENU") exit 0;; + "") break;; + *) + if [ -s "$OPTION" ]; then + clear + less -R "$OPTION" + printf "\n\n" + else + printf "$OPTION is empty\n\n" + fi + ;; + esac + done +done -- 1.6.0.6 From dhuff at redhat.com Thu Jun 18 14:59:20 2009 From: dhuff at redhat.com (David Huff) Date: Thu, 18 Jun 2009 10:59:20 -0400 Subject: [Ovirt-devel] [PATCH node-image] Keep nls_utf8.ko module on node-image Message-ID: <1245337160-24493-1-git-send-email-dhuff@redhat.com> resolves: rhbz:504741 - nls utf8 kmod missing causes error messages during firstboot configuration --- common-blacklist.ks | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common-blacklist.ks b/common-blacklist.ks index 48f30a6..eb59014 100644 --- a/common-blacklist.ks +++ b/common-blacklist.ks @@ -49,14 +49,16 @@ done # the following are lists of kernel modules we are pretty sure we won't need; # note that these can be single files or whole directories. They are specified -# starting at $MODULES; so if you want to remove the NLS stuff from the -# fs subdir, your mods entry would be "fs/nls" -fs_mods="fs/nls fs/9p fs/affs fs/autofs fs/autofs4 fs/befs fs/bfs fs/cifs \ +# starting at $MODULES; so if you want to remove the 9p stuff from the +# fs subdir, your mods entry would be "fs/9p" +fs_mods="fs/9p fs/affs fs/autofs fs/autofs4 fs/befs fs/bfs fs/cifs \ fs/coda fs/cramfs fs/dlm fs/ecryptfs fs/efs fs/exportfs fs/ext4 \ fs/freevxfs fs/fuse fs/gfs2 fs/hfs fs/hfsplus fs/jbd2 fs/jffs \ fs/jffs2 fs/jfs fs/minix fs/ncpfs fs/ocfs2 fs/qnx4 fs/reiserfs \ fs/romfs fs/sysv fs/udf fs/ufs fs/xfs" +nls_mods="fs/nls/nls_cp* fs/nls/nls_iso* fs/nls/nls_ko* fs/nls/nls_euc*" + net_mods="net/9p net/appletalk net/atm net/ax25 \ net/bluetooth net/dccp net/decnet net/ieee80211 net/ipx net/irda \ net/mac80211 net/netrom net/rfkill net/rose net/sched net/tipc \ @@ -83,7 +85,7 @@ echo "Removing excess kernel modules" MODULES="/lib/modules/*/kernel" RM="rm -rf" -for mods in $fs_mods $net_mods $misc_mods $driver_mods ; do +for mods in $fs_mods $nls_mods $net_mods $misc_mods $driver_mods ; do $RM $MODULES/$mods done -- 1.6.0.6 From dpierce at redhat.com Thu Jun 18 15:58:51 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 18 Jun 2009 11:58:51 -0400 Subject: [Ovirt-devel] [PATCH node-image] Keep nls_utf8.ko module on node-image In-Reply-To: <1245337160-24493-1-git-send-email-dhuff@redhat.com> References: <1245337160-24493-1-git-send-email-dhuff@redhat.com> Message-ID: <20090618155851.GE4152@mcpierce-laptop.rdu.redhat.com> On Thu, Jun 18, 2009 at 10:59:20AM -0400, David Huff wrote: > resolves: rhbz:504741 - nls utf8 kmod missing causes > error messages during firstboot configuration > --- After building, _installing_ the RPM and then testing, I was able to find the nls_utf8.ko module in the right location. ACK. -- 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 apevec at gmail.com Thu Jun 18 15:41:02 2009 From: apevec at gmail.com (Alan Pevec) Date: Thu, 18 Jun 2009 17:41:02 +0200 Subject: [Ovirt-devel] [PATCH node-image] Keep nls_utf8.ko module on node-image In-Reply-To: <1245337160-24493-1-git-send-email-dhuff@redhat.com> References: <1245337160-24493-1-git-send-email-dhuff@redhat.com> Message-ID: <2be7262f0906180841m1a52321cpd4a79194889794d0@mail.gmail.com> NAK, common-blacklist should be re-written to use image-minimizer where possible, for this example keep directive is exactly what's needed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremy.perry at redhat.com Thu Jun 18 17:41:09 2009 From: jeremy.perry at redhat.com (Jeremy Perry) Date: Thu, 18 Jun 2009 13:41:09 -0400 Subject: [Ovirt-devel] [PATCH server] UI tweaks for cloud In-Reply-To: <1243455507-25964-1-git-send-email-jeremy.perry@redhat.com> References: <1243455507-25964-1-git-send-email-jeremy.perry@redhat.com> Message-ID: <1245346869-4182-1-git-send-email-jeremy.perry@redhat.com> Initial styling for the cloud, added a few images Signed-off-by: Jeremy Perry --- src/app/views/cloud/instance/index.rhtml | 2 +- src/app/views/layouts/cloud/cloud.rhtml | 9 +- src/public/images/mystery_cloud.png | Bin 0 -> 1984 bytes src/public/images/tab_bg.png | Bin 0 -> 174 bytes src/public/stylesheets/cloud/layout.css | 164 +++++++++++++++++++++--------- 5 files changed, 124 insertions(+), 51 deletions(-) create mode 100644 src/public/images/mystery_cloud.png create mode 100644 src/public/images/tab_bg.png diff --git a/src/app/views/cloud/instance/index.rhtml b/src/app/views/cloud/instance/index.rhtml index 218bd8c..757d67c 100644 --- a/src/app/views/cloud/instance/index.rhtml +++ b/src/app/views/cloud/instance/index.rhtml @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/views/layouts/cloud/cloud.rhtml b/src/app/views/layouts/cloud/cloud.rhtml index b891bf2..708a2c3 100644 --- a/src/app/views/layouts/cloud/cloud.rhtml +++ b/src/app/views/layouts/cloud/cloud.rhtml @@ -12,7 +12,9 @@ +
<%= yield %>
+
diff --git a/src/public/images/mystery_cloud.png b/src/public/images/mystery_cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..4b4db8233828264d1d3c23ec1520c5a13f9b1e45 GIT binary patch literal 1984 zcmV;x2S50UP)KJ9qli)6;`)+L7|Bz&w6ru0L^Lp%82|v27^DID_U#+a4VIUe zpDZaUX-SrSo}~if)vH%tpU>A$4`;1jy;=hy!C*Hr2Ux*?00 at dH8aM*P^85YGI44KC4gi7)HsKmR;<{V6ZZ+e&;^N|#WdR0U zgASSzt5&VjV3>?xAWS#Gz(X at 2@_asabaXUt*svi$naBTIgK_WPy#`{27mQ#azzSvr z1K`98{tTe-gG({RjU6em}Tt*DfCg*~VD2PRw9DefqR|WMt$x2_rA2NoNQn%z}b~3p9QB zytA{jiF8E0WCa7kD=M=Fzvfk!_mJl at ATp>*AUNwVD2ERpK3Q5?+Vaz2JbLt~_U_%g zr#^l9WXnJ&X)47L23BJK{{4;J-Q7)ejRg?cJ!Hn zEG%p}cI;SPLSVdn`O{DO9e1TL~q)Q_1Etw=ik*@&=gE2ilttu)i>K0;%BN$)JhesJ`2{>)#XL2aU#F~5ZA9?Z-$Sv zFp@#fjOu0$AqSt2BhCj9IPTlGPi@`0HLhU%?%g|e`}XY+$kGP$8Kh8Sb^r`8jcS|5 zg9i^bINc-FbPWaqQ|bZ+MY2Rrb_qVm%o+?sxt^V>(Zr5=NSkNdXf<`_&JFq^R<~R0LI|pAPOzDY15|Ac~71^Q4b$JRBztA z(eGh29-Oj(wt+`hR+c_Dnsi?X6kf2;pFi8Ek(|sOmufFoCxOmj2m zJFQGK0mbKmwpXuSRUbcogbq<{ZEcX$n!+TQ^n~G~qoWW~VZV`?nHd%+r43F~0wO`7 zd)rZ&0ao<)_n%+ at xNhJd;S3S4KyzXV3S4zz5>Sxnah86N at Jw{kSyd3VB5B;uC7)jr^Ad51OgEnBc6NnV$ed^XV0E( zN5Y5zV`^&ZhzyjH;>iHQ2 at nZ723!a3QdL!@sGd+%Y(;2|$B!R}X`FcPE#n5U#yWH6 zO#6!$FG7H%f-W*!nE5-|(<#$15S5jcI)IvkY9d9ME=;>5x)4$sLsXupftaZSC|<}q zgX2Uz)nuZBfk4Gcbwh+2otT(F3jkd*9b2S3#cQJp2&Y=OOjlP|{h>pL8d7D^m54tk zI%N&9dGqE7w}4BWJ9kb8O^81ZvQEl3)@h0{7KslYJU9VTc$~`PrDzh%W-mmT9AL_g z8#ls0SWJS)dQWBsF9?`P`pQC!!h at n^A>Vcz49w at xpDUuO1_lHALY4t$y8jvbOonh4 zMX$y~bwb~-1OtO2x*8uJ*Q*3WC527(n+)5`_<@NXJ?$pgsiO2+&3?QTLpF3UckI}q z`x<124wxnr+*}~sD-<&bj0=;Klhpu%JJD`u6B$IQtX6yW>)6;`if~)b%Y%glp z!58`Y`9AWSARFg)CNVQgX=!Pgp}TkQj=301rtZ;TAc&Gdr{S|~pxcIU?GVi^WkKc^ z2xjXc%2fVuK7 zng3SXY}~TYVx8fpn=&&gUN%PEcm_Mjh#;M4Iqi5+ zEmZ07 at Nli{AuRV{Zd{YTYLR;=QU8)aCpBUhJ<%QW-yMw1%*;M)NXzg46<`2a|Dl%- SVlR;Z0000Hdwz#(D$ zHg03j)ZnU|RqjQ5;vNcAd3R at 8F!b%roz#2kV%FPZ1=HWXePO*qB<>fR{A1k%47=?4 VI-QIdgn?!=c)I$ztaD0e0s!hTJX8Px literal 0 HcmV?d00001 diff --git a/src/public/stylesheets/cloud/layout.css b/src/public/stylesheets/cloud/layout.css index 60b5c91..0fd158d 100644 --- a/src/public/stylesheets/cloud/layout.css +++ b/src/public/stylesheets/cloud/layout.css @@ -1,47 +1,90 @@ /* ------ General Layout ------ */ -.toolbar {text-align:left;} +html {min-width:640px;} -.current, .toolbar a:hover { - border-bottom: 5px solid #5599B8; +#head h1 a { + background:transparent url(/images/mystery_cloud.png) no-repeat scroll 20px 50%; + /* + TODO: change this back to a real logo when we have one. + */ + display:block; + height:59px; + overflow:hidden; + text-decoration:none; + text-indent:-9999px; + width:87px; } -.toolbar a { - text-decoration: none; +#login-box { + display:block; + line-height:3.75ex; + position:absolute; + right:4ex; + text-align:right; + top:12px; +} + +#login-box a { + color: #337ACC; } -#nav {height:1em;padding-top:1ex;} +#navcontainer { + height:40px; +} -#nav a {display: inline-block;} +#navcontainer ul { + padding-left: 0; + margin-left: 0; + background-color: #fff; + color: #afb2bd; + float: left; + width: 100%; +} -#head {height:50px;} +#navcontainer ul li { display: inline; } -#login-box { - text-align:right; - /* - TODO: put this back in with a real logo when we have one. - background: url('../../images/logo_cumulus.png') left top no-repeat; - */ +#navcontainer ul li a { + padding: 12px 20px; + border-top: solid 2px transparent; + background: #fff; + color: #afb2bd; + font-weight: bold; + text-decoration: none; + text-transform: uppercase; + float: left; } -#content {margin-left:18px;} +#navcontainer ul li a:hover { + background: #fff; + color: #989ba7; +} + +#navcontainer ul li a.current { + border-top: solid 2px #337acc; + background: #e0eeff url(/images/tab_bg.png) repeat-x; + color: #404552; +} + +#content {margin-left:0;} #content table{width:100%;} -#content table tr.odd {background:#eef2f2;} +/* #content table tr.odd {background:#eef2f2;} */ -#content table tr:hover {background: #729FCF; color: #FFFFFF;} +#content table tr:hover {background: #fdfef1;} #content table th, #content table td { - border:1px solid #AAAAAA; + border:1px solid #E1E1E3; + border-right: 0; + border-left: 0; padding:0; text-align:left; } -#content table th {background-color: #F0F0F0;} +#content table th {background: none;border-top: none;} #content table div { - padding: 0.4ex; + padding: 0.5ex; } #content table th a { @@ -49,31 +92,35 @@ text-decoration: none; } +#content table th a:hover { + text-decoration: underline; +} + .sortup { - background: #F0F0F0 url('../../images/Sort_up_11.png') top center no-repeat !important; + background: transparent url('/images/Sort_up_11.png') top center no-repeat !important; } .sortdown { - background: #F0F0F0 url('../../images/Sort_down_11.png') top center no-repeat !important; + background: transparent url('/images/Sort_down_11.png') top center no-repeat !important; } -.sortable:hover {background-color: #DDDDDD !important;} +.sortable:hover {/* background-color: #DDDDDD !important; */} -.selected {background: #337ACC !important; color: #FFFFFF;} +.selected {background: #fbf0a7 !important;} .center {text-align:center;} .pagination {padding-top: 1ex;} -#list-view {} +#list-view {margin-bottom:2em;} + #detail-view { - border-top: 3px solid #AAAAAA; - margin-top: 2ex; + border-top: 2px solid #CECECE; } #graph { - border: 1px solid #AAAAAA; + border: 1px solid #EFEFEF; margin-bottom: 1.5ex; height: 15ex; } @@ -84,18 +131,34 @@ border: 0; color: #337ACC; cursor: pointer; + margin-right:12px; + font-size: 1em; + text-decoration: underline; +} + +input#submit_for_list { + margin:12px 16px 0 0; + padding:0; } #detail_header { - background-color: #F0F0F0; - height: 10ex; - margin-bottom: 1.5ex; + background-color: #EFEFEF; + height: 5em; + margin-bottom: 1em; +} + +#detail_header h3 { + color:#666666; + margin: 8px 12px 12px 16px; + display:inline-block; + font-size: 1.2em; } + /* ----- Backgrounds for states ----- */ .state-container { margin-left:5px; - text-indent:10px; + text-indent:12px; } .task-canceled {background:url(../../images/icon-canceled-11px.png) left center no-repeat;} @@ -115,52 +178,59 @@ .instance-creating {background:url(../../images/icon_startup_11px.png) left center no-repeat;} -/* ----- Toolbar Navigation -------- */ -#toolbar_nav { - background: #F0F0F0; +/* ----- Actions Toolbar -------- */ +#toolbar { + background: #e3eaf2; + border-top: 1px solid #d1dfee; + border-bottom: 1px solid #d1d7de; + margin-bottom: 1em; } -#toolbar_nav img { +#toolbar img { margin: 0; } -#toolbar_nav ul{ +#toolbar ul{ list-style: none; + margin:0; + padding:0; } -#toolbar_nav li { +#toolbar li { display: inline-block; position: relative; color: #666666; - padding: 0 1ex; + padding: 8px 16px; } -#toolbar_nav li:hover { + +#toolbar li:hover { background: #337ACC; color: #FFFFFF; cursor: pointer; } -#toolbar_nav li.current { /* This is not really needed right now, but will be useful when we add filters. */ +#toolbar li.current { /* This is not really needed right now, but will be useful when we add filters. */ background: #4B95B8; } -#toolbar_nav li ul { +#toolbar li ul { display: none; position: absolute; top: 1em; left: 0; - background: #F0F0F0; + background: #bec7e0; /* #F0F0F0; */ + padding: 4px; } -#toolbar_nav li ul li { +#toolbar li ul li { display: block; white-space: nowrap; - padding-right: 1ex; + padding-right: 1em; } -#toolbar_nav li > ul { +#toolbar li > ul { top: auto; left: auto; } -#toolbar_nav li:hover ul {display: block;} \ No newline at end of file +#toolbar li:hover ul {display: block;} -- 1.6.0.6 From jguiditt at redhat.com Thu Jun 18 17:46:37 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Thu, 18 Jun 2009 13:46:37 -0400 Subject: [Ovirt-devel] [PATCH server] UI tweaks for cloud In-Reply-To: <1245346869-4182-1-git-send-email-jeremy.perry@redhat.com> References: <1243455507-25964-1-git-send-email-jeremy.perry@redhat.com> <1245346869-4182-1-git-send-email-jeremy.perry@redhat.com> Message-ID: <1245347197.7701.0.camel@localhost.localdomain> On Thu, 2009-06-18 at 13:41 -0400, Jeremy Perry wrote: > Initial styling for the cloud, added a few images > > Signed-off-by: Jeremy Perry > --- > src/app/views/cloud/instance/index.rhtml | 2 +- > src/app/views/layouts/cloud/cloud.rhtml | 9 +- > src/public/images/mystery_cloud.png | Bin 0 -> 1984 bytes > src/public/images/tab_bg.png | Bin 0 -> 174 bytes > src/public/stylesheets/cloud/layout.css | 164 +++++++++++++++++++++--------- > 5 files changed, 124 insertions(+), 51 deletions(-) > create mode 100644 src/public/images/mystery_cloud.png > create mode 100644 src/public/images/tab_bg.png > ACK, pushed. From jboggs at redhat.com Thu Jun 18 17:54:36 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 18 Jun 2009 13:54:36 -0400 Subject: [Ovirt-devel] problem with ovirt-mongrel-rails on rails 2.3 Message-ID: <4A3A7F5C.9000901@redhat.com> I've figured out fixes for the installer portion for ovirt on Fedora 11 just running into this problem currently with the ovirt-mongrel-rails service, It will start but there are errors in the log and can't access /ovirt in the browser. Just wanted to get some input, I've tried a few fixes from google with no success and I'm no rails expert :) ** Daemonized, any open files are closed. Look at /var/run/ovirt-server/mongrel.pid and /var/log/ovirt-server/mongrel.log for info. ** Starting Mongrel listening at 127.0.0.1:3000 ** Initiating groups for "ovirt":"ovirt". ** Changing group to "ovirt". ** Changing user to "ovirt". ** Starting Rails with production environment... ** Mounting Rails at /ovirt... Creating field with name Creating field with owners Creating field with depth Creating field with virt_file_size Creating field with virt_path Creating field with xml_file Creating field with virt_bridge Creating field with file Creating field with parent /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:151:in `rails' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 from /usr/bin/mongrel_rails:19:in `load' from /usr/bin/mongrel_rails:19 From pronix.service at gmail.com Thu Jun 18 18:00:07 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Thu, 18 Jun 2009 22:00:07 +0400 Subject: Fwd: Re: [Ovirt-devel] problem with ovirt-mongrel-rails on rails 2.3 Message-ID: <4A3A80A7.9080508@gmail.com> temporary fix write in ./config/environment.rb RAILS_GEM_VERSION = '2.1.1' unless defined? RAILS_GEM_VERSION and "gem install rails --version"=2.1.1"" > I've figured out fixes for the installer portion for ovirt on Fedora > 11 just running into this problem currently with the > ovirt-mongrel-rails service, It will start but there are errors in the > log and can't access /ovirt in the browser. Just wanted to get some > input, I've tried a few fixes from google with no success and I'm no > rails expert :) > > ** Daemonized, any open files are closed. Look at > /var/run/ovirt-server/mongrel.pid and > /var/log/ovirt-server/mongrel.log for info. > ** Starting Mongrel listening at 127.0.0.1:3000 > ** Initiating groups for "ovirt":"ovirt". > ** Changing group to "ovirt". > ** Changing user to "ovirt". > ** Starting Rails with production environment... > ** Mounting Rails at /ovirt... > Creating field with name > Creating field with owners > Creating field with depth > Creating field with virt_file_size > Creating field with virt_path > Creating field with xml_file > Creating field with virt_bridge > Creating field with file > Creating field with parent > /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in > `load_missing_constant': uninitialized constant > ActionController::AbstractRequest (NameError) > from > /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in > `const_missing' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:151:in > `rails' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in > `cloaker_' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in > `call' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in > `listener' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in > `cloaker_' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in > `call' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in > `initialize' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in > `new' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in > `run' > from > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in > `run' > from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 > from /usr/bin/mongrel_rails:19:in `load' > from /usr/bin/mongrel_rails:19 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -- ? ?????????, ??????? From jguiditt at redhat.com Thu Jun 18 19:43:47 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Thu, 18 Jun 2009 15:43:47 -0400 Subject: [Ovirt-devel] problem with ovirt-mongrel-rails on rails 2.3 In-Reply-To: <4A3A7F5C.9000901@redhat.com> References: <4A3A7F5C.9000901@redhat.com> Message-ID: <1245354227.7701.3.camel@localhost.localdomain> On Thu, 2009-06-18 at 13:54 -0400, Joey Boggs wrote: > I've figured out fixes for the installer portion for ovirt on Fedora 11 > just running into this problem currently with the ovirt-mongrel-rails > service, It will start but there are errors in the log and can't access > /ovirt in the browser. Just wanted to get some input, I've tried a few > fixes from google with no success and I'm no rails expert :) Joey, you may have already tried this, but have you run rake commands to update app for current rails? rake rails:update Update both configs, scripts and public/javascripts from Rails rake rails:update:configs Update config/boot.rb from your current rails install Either or both of those would be worth trying if you haven't already. -j From jboggs at redhat.com Fri Jun 19 15:14:04 2009 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 19 Jun 2009 11:14:04 -0400 Subject: [Ovirt-devel] [PATCH server] make postgres wait for starting to complete before creating databases Message-ID: <1245424444-12965-1-git-send-email-jboggs@redhat.com> --- installer/modules/ovirt/manifests/postgres.pp | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp index 6620a88..a711e32 100644 --- a/installer/modules/ovirt/manifests/postgres.pp +++ b/installer/modules/ovirt/manifests/postgres.pp @@ -38,10 +38,15 @@ class postgres::bundled{ require => Package[postgresql-server] } + single_exec {"start_pgsql": + command => "/bin/su - postgres -c '/usr/bin/pg_ctl start -w -D /var/lib/pgsql/data'", + require => Single_exec["initialize_db"] + } + service {"postgresql" : ensure => running, enable => true, - require => Single_exec[initialize_db] + require => [Single_exec[initialize_db],Single_exec[start_pgsql]] } single_exec {"create_ovirt_db": -- 1.6.0.6 From mmorsi at redhat.com Fri Jun 19 17:15:21 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 19 Jun 2009 13:15:21 -0400 Subject: [Ovirt-devel] [PATCH server] add toggable sections to vm form Message-ID: <1245431721-16126-1-git-send-email-mmorsi@redhat.com> the vm form is getting cluttered, this patch simply add collapsable sections to the form, making the 'resources' and 'network' sections collapsed by default - icon added - methods added to the js - reorganization / cleanup in rhtml, indentation changes, no functionality or content changes --- src/app/views/vm/_form.rhtml | 109 +++++++++++++++++++++++------------ src/public/images/Sort_right_11.png | Bin 0 -> 212 bytes src/public/javascripts/ovirt.js | 25 ++++++++ 3 files changed, 97 insertions(+), 37 deletions(-) create mode 100644 src/public/images/Sort_right_11.png diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml index 034c3df..4be7bba 100644 --- a/src/app/views/vm/_form.rhtml +++ b/src/app/views/vm/_form.rhtml @@ -6,52 +6,77 @@ <%= hidden_field 'vm', 'vm_resource_pool_id' %> <%= hidden_field_tag 'hardware_pool_id', @hardware_pool.id if @hardware_pool %> - <%= text_field_with_label "Name:", "vm", "description", {:style=>"width:250px;"} %> - <%= text_field_with_label "UUID:", "vm", "uuid", {:style=>"width:250px;"} %> - <%= select_with_label "Operating System:", 'vm', 'provisioning_and_boot_settings', @provisioning_options, :style=>"width:250px;" %> - <% if controller.action_name == "edit" %>*Warning* Editing provision could overwrite vm<% end %> -
- -
Resources
-
-
-
- <%= text_field_with_label "CPUs:", "vm", "num_vcpus_allocated", {:style=>"width:100px; margin-bottom:2px;"}, {:style=>"padding-right: 50px;"} %> -
max to create: <%=create_resources[:cpus]%>
-
max to start: <%=start_resources[:cpus]%>
+
+ <%= link_to image_tag("Sort_down_11.png") + "General", "#", + :id => "vm_general_section_link" %>
-
- <%= text_field_with_label "Memory:", "vm", "memory_allocated_in_mb", {:style=>"width:100px; margin-bottom:2px;"}, {:afterfield=>" mb"} %> -
max to create: <%=create_resources[:memory_in_mb]%> mb
-
max to start: <%=start_resources[:memory_in_mb]%> mb
+
+ <%= text_field_with_label "Name:", "vm", "description", {:style=>"width:250px;"} %> + <%= text_field_with_label "UUID:", "vm", "uuid", {:style=>"width:250px;"} %> + <%= select_with_label "Operating System:", 'vm', 'provisioning_and_boot_settings', @provisioning_options, :style=>"width:250px;" %> + <% if controller.action_name == "edit" %>*Warning* Editing provision could overwrite vm<% end %>
-
-
-
Storage:
-
-
    +
    + +
    + <%= link_to image_tag("Sort_right_11.png") + "Resources", "#", + :id => "vm_resource_section_link" %>
    +
    +
    +
    +
    + <%= text_field_with_label "CPUs:", "vm", "num_vcpus_allocated", {:style=>"width:100px; margin-bottom:2px;"}, {:style=>"padding-right: 50px;"} %> +
    max to create: <%=create_resources[:cpus]%>
    +
    max to start: <%=start_resources[:cpus]%>
    +
    +
    + <%= text_field_with_label "Memory:", "vm", "memory_allocated_in_mb", {:style=>"width:100px; margin-bottom:2px;"}, {:afterfield=>" mb"} %> +
    max to create: <%=create_resources[:memory_in_mb]%> mb
    +
    max to start: <%=start_resources[:memory_in_mb]%> mb
    +
    +
    +
    - -
    Total:
    +
    Storage:
    +
    +
      +
      + + +
      Total:
      +
      -
      Network
      -
      -
      -
      - <%= text_field_with_label "VNIC:", "vm", "vnic_mac_addr", {:style=>"width:250;"} %> -
      -
      - <%= select_with_label "Network:", 'vm', 'network_id', @networks.insert(0, ""), :style=>"width:250px;" %> +
      + <%= link_to image_tag("Sort_right_11.png") + "Network", "#", + :id => "vm_network_section_link" %>
      -
      -
      -
      +
      +
      +
      +
      + <%= text_field_with_label "VNIC:", "vm", "vnic_mac_addr", {:style=>"width:250;"} %> +
      +
      +
      + <% if @networks.size > 0 %> + + <% else %> +
      No networks available + <% end %> +
      +
      +
      +
      - <%= check_box_tag_with_label "Forward vm's vnc port locally", "forward_vnc", 1, @vm.forward_vnc %> + <%= check_box_tag_with_label "Forward vm's vnc port locally", "forward_vnc", 1, @vm.forward_vnc %> +
      <%= check_box_tag_with_label "Start VM Now? (pending current resource availability)", "start_now", nil if create or @vm.state == Vm::STATE_STOPPED %> @@ -104,6 +129,16 @@ ${htmlList(pools, id)} refresh: VmCreator.returnToVmForm }); }); - + toggle_visability_on_click('#vm_general_config', '#vm_general_section_link', 'General'); + toggle_visability_on_click('#vm_resources_config','#vm_resource_section_link', 'Resources'); + toggle_visability_on_click('#vm_network_config', '#vm_network_section_link', 'Network'); + // initially show general, hide resources / networks section + $(document).ready(function(){ + show_section_with_header('#vm_general_config', '#vm_general_section_link', 'General'); + hide_section_with_header('#vm_resources_config', '#vm_resource_section_link', 'Resources'); + hide_section_with_header('#vm_network_config', '#vm_network_section_link', 'Network'); + }); + + diff --git a/src/public/images/Sort_right_11.png b/src/public/images/Sort_right_11.png new file mode 100644 index 0000000000000000000000000000000000000000..9162bd69dcf43c55431bf655eeaa5250b61c8083 GIT binary patch literal 212 zcmeAS at N?(olHy`uVBq!ia0vp^+#t-s1|(OmDOUqhjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=fm(z?n2}-D90{Nxdx at v7EBj40VSZUQ&8UBH7Z@*ZN7%C1bRV!m+s+4sM8iQP=u zRvZbx?{I`L{Jg9FXXS14Jv$F^=o=hLZId(q626k%RLSoX(0m3 at S3j3^P6 After build from "next" git the ovirt-vnc-proxy init script won't start.The daemon line is set as "DAEMON=src/vnc-proxy/vnc-proxy.rb" This has to be "DAEMON=/usr/share/ovirt-server/vnc-proxy/vnc-proxy.rb" wright? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbrock at redhat.com Fri Jun 19 20:38:58 2009 From: hbrock at redhat.com (Hugh O. Brock) Date: Fri, 19 Jun 2009 16:38:58 -0400 Subject: [Ovirt-devel] ovirt-vnc-proxy init script In-Reply-To: <51d1c06c0906191330qb9d784bu36a234ad859669e3@mail.gmail.com> References: <51d1c06c0906191330qb9d784bu36a234ad859669e3@mail.gmail.com> Message-ID: <20090619203858.GA21440@redhat.com> On Fri, Jun 19, 2009 at 10:30:07PM +0200, Freddy Stutterheim wrote: > After build from "next" git the ovirt-vnc-proxy init script won't start.The > daemon line is set as "DAEMON=src/vnc-proxy/vnc-proxy.rb" > This has to be "DAEMON=/usr/share/ovirt-server/vnc-proxy/vnc-proxy.rb" > wright? I would certainly think so! Can you make the change and check? Mo, what root is the init script expecting? Thanks, --Hugh From fstutter at gmail.com Fri Jun 19 20:52:15 2009 From: fstutter at gmail.com (Freddy Stutterheim) Date: Fri, 19 Jun 2009 22:52:15 +0200 Subject: [Ovirt-devel] ovirt-vnc-proxy init script Message-ID: <51d1c06c0906191352n374ee544w803078dbe8b9d433@mail.gmail.com> After setting it to "DAEMON=/usr/share/ovirt-server/vnc-proxy/vnc-proxy.rb" it starts up normaly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmorsi at redhat.com Fri Jun 19 21:08:09 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 19 Jun 2009 17:08:09 -0400 Subject: [Ovirt-devel] ovirt-vnc-proxy init script In-Reply-To: <51d1c06c0906191352n374ee544w803078dbe8b9d433@mail.gmail.com> References: <51d1c06c0906191352n374ee544w803078dbe8b9d433@mail.gmail.com> Message-ID: <4A3BFE39.9010603@redhat.com> Freddy Stutterheim wrote: > After setting it > to "DAEMON=/usr/share/ovirt-server/vnc-proxy/vnc-proxy.rb" it starts > up normaly. > ------------------------------------------------------------------------ > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > You are correct, this should be the value. This bug slipped in by mistake a few patches ago, and the fix has been pushed. Thanks for pointing it out. -Mo From mmorsi at redhat.com Fri Jun 19 21:29:02 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 19 Jun 2009 17:29:02 -0400 Subject: [Ovirt-devel] [PATCH server] add collapsable sections to vm form Message-ID: <1245446943-27115-1-git-send-email-mmorsi@redhat.com> the vm form is getting cluttered, this patch simply add collapsable sections to the form, making the 'storage' and 'network' sections collapsed by default --- src/app/helpers/application_helper.rb | 9 +++++ src/app/views/vm/_form.rhtml | 55 +++++++++++++++++++++++++-------- src/public/javascripts/ovirt.js | 25 +++++++++++++++ src/public/stylesheets/components.css | 15 +++++++++ 4 files changed, 91 insertions(+), 13 deletions(-) diff --git a/src/app/helpers/application_helper.rb b/src/app/helpers/application_helper.rb index 0178ad0..d3eecd7 100644 --- a/src/app/helpers/application_helper.rb +++ b/src/app/helpers/application_helper.rb @@ -77,6 +77,15 @@ module ApplicationHelper } end + # same as check_box_tag_with_label but w/ the checkbox appearing first + def rcheck_box_tag_with_label(label, name, value = "1", checked = false) + %{ +
      #{check_box_tag name, value, checked} +
      + } + end + + def radio_button_tag_with_label(label, name, value = "1", checked = false) %{
      diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml index 034c3df..373452d 100644 --- a/src/app/views/vm/_form.rhtml +++ b/src/app/views/vm/_form.rhtml @@ -6,15 +6,23 @@ <%= hidden_field 'vm', 'vm_resource_pool_id' %> <%= hidden_field_tag 'hardware_pool_id', @hardware_pool.id if @hardware_pool %> +
      + <%= link_to "", "#", :id => "vm_general_section_link" %> +
      +
      <%= text_field_with_label "Name:", "vm", "description", {:style=>"width:250px;"} %> <%= text_field_with_label "UUID:", "vm", "uuid", {:style=>"width:250px;"} %> <%= select_with_label "Operating System:", 'vm', 'provisioning_and_boot_settings', @provisioning_options, :style=>"width:250px;" %> <% if controller.action_name == "edit" %>*Warning* Editing provision could overwrite vm<% end %> +
      +
      +
      -
      Resources
      -
      -
      +
      + <%= link_to "", "#", :id => "vm_resources_section_link" %> +
      +
      <%= text_field_with_label "CPUs:", "vm", "num_vcpus_allocated", {:style=>"width:100px; margin-bottom:2px;"}, {:style=>"padding-right: 50px;"} %>
      max to create: <%=create_resources[:cpus]%>
      @@ -27,6 +35,13 @@
      +
      +
      + +
      + <%= link_to "", "#", :id => "vm_storage_section_link" %> +
      +
      Storage:
        @@ -35,10 +50,13 @@
        Total:
        -
        -
        +
        +
        -
        Network
        +
        + <%= link_to "", "#", :id => "vm_network_section_link" %> +
        +
        @@ -47,15 +65,14 @@
        <%= select_with_label "Network:", 'vm', 'network_id', @networks.insert(0, ""), :style=>"width:250px;" %>
        -
        -
        - <%= check_box_tag_with_label "Forward vm's vnc port locally", "forward_vnc", 1, @vm.forward_vnc %> -
        + <%= rcheck_box_tag_with_label "Forward vm's vnc port locally", "forward_vnc", 1, @vm.forward_vnc %> +
        +
        - <%= check_box_tag_with_label "Start VM Now? (pending current resource availability)", "start_now", nil if create or @vm.state == Vm::STATE_STOPPED %> - <%= check_box_tag_with_label "Restart VM Now? (pending current resource availability)", "restart_now", nil if @vm.state == Vm::STATE_RUNNING %> + <%= rcheck_box_tag_with_label "Start VM Now? (pending current resource availability)", "start_now", nil if create or @vm.state == Vm::STATE_STOPPED %> + <%= rcheck_box_tag_with_label "Restart VM Now? (pending current resource availability)", "restart_now", nil if @vm.state == Vm::STATE_RUNNING %> @@ -104,6 +121,18 @@ ${htmlList(pools, id)} refresh: VmCreator.returnToVmForm }); }); - + toggle_visability_on_click('#vm_general_config', '#vm_general_section_link', 'General'); + toggle_visability_on_click('#vm_resources_config', '#vm_resources_section_link', 'Resources'); + toggle_visability_on_click('#vm_storage_config', '#vm_storage_section_link', 'Storage'); + toggle_visability_on_click('#vm_network_config', '#vm_network_section_link', 'Network'); + + // initially show general / resources, hide storage / networks section + $(document).ready(function(){ + show_section_with_header('#vm_general_config', '#vm_general_section_link', 'General'); + show_section_with_header('#vm_resources_config', '#vm_resources_section_link', 'Resources'); + hide_section_with_header('#vm_storage_config', '#vm_storage_section_link', 'Storage'); + hide_section_with_header('#vm_network_config', '#vm_network_section_link', 'Network'); + }); + diff --git a/src/public/javascripts/ovirt.js b/src/public/javascripts/ovirt.js index 67dc455..6055e53 100644 --- a/src/public/javascripts/ovirt.js +++ b/src/public/javascripts/ovirt.js @@ -394,3 +394,28 @@ function get_server_from_url() var end = window.location.href.indexOf('/', 8) - start; return window.location.href.substr(start, end); } + +// hides the specified section, altering the specified header div with updated title / arrow +function hide_section_with_header(section, header, title){ + content = '
        ' + title + '
        '; + $(header).html(content); + $(section).hide('slow'); +}; + +// show the specified section, altering the specified header div with updated title / arrow +function show_section_with_header(section, header, title){ + content = '
        ' + title + '
        '; + $(header).html(content); + $(section).show('slow'); +}; + +// wire up the header to invoke either the show or hide function on click +function toggle_visability_on_click(section, header, title){ + $(header).bind('click', function(){ + if($(section).is(':hidden')){ + show_section_with_header(section, header, title); + }else{ + hide_section_with_header(section, header, title); + } + }); +}; diff --git a/src/public/stylesheets/components.css b/src/public/stylesheets/components.css index 41ad3d0..1409692 100644 --- a/src/public/stylesheets/components.css +++ b/src/public/stylesheets/components.css @@ -339,3 +339,18 @@ height: 11px; } +#vm_general_config, #vm_resources_config, #vm_storage_config, #vm_network_config{ + padding-left: 30px; +} + +#vm_general_section_link img, #vm_resources_section_link img, #vm_storage_section_link img, #vm_network_section_link img{ + float: left; + padding-top: 2px; +} + +#vm_general_section_link div, #vm_resources_section_link div, #vm_storage_section_link div, #vm_network_section_link div{ + padding-top: 3px; + padding-left: 20px; + padding-bottom: 3px; + width: 25%; +} -- 1.6.0.6 From mmorsi at redhat.com Fri Jun 19 21:29:03 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Fri, 19 Jun 2009 17:29:03 -0400 Subject: [Ovirt-devel] [PATCH server] provide default vm allocated cpu and memory values In-Reply-To: <1245446943-27115-1-git-send-email-mmorsi@redhat.com> References: <1245446943-27115-1-git-send-email-mmorsi@redhat.com> Message-ID: <1245446943-27115-2-git-send-email-mmorsi@redhat.com> adds a migration to provides default values for the vm table columns num_vcpus_allocated and memory_allocated. These propogate up to the add vm form so the user doesn't have to specify them default cpus = 1, memory = 262144 (256MB) --- src/db/migrate/039_vm_cpu_and_memory_defaults.rb | 29 ++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) create mode 100644 src/db/migrate/039_vm_cpu_and_memory_defaults.rb diff --git a/src/db/migrate/039_vm_cpu_and_memory_defaults.rb b/src/db/migrate/039_vm_cpu_and_memory_defaults.rb new file mode 100644 index 0000000..f33bc52 --- /dev/null +++ b/src/db/migrate/039_vm_cpu_and_memory_defaults.rb @@ -0,0 +1,29 @@ +# Copyright (C) 2009 Red Hat, Inc. +# Written by Mohammed Morsi +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +class VmCpuAndMemoryDefaults < ActiveRecord::Migration + def self.up + change_column :vms, :num_vcpus_allocated, :integer, :default => 1 + change_column :vms, :memory_allocated, :integer, :default => 262144 #256MB + end + + def self.down + change_column :vms, :num_vcpus_allocated, :integer, :default => nil + change_column :vms, :memory_allocated, :integer, :default => nil + end +end -- 1.6.0.6 From jboggs at redhat.com Sat Jun 20 01:57:14 2009 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 19 Jun 2009 21:57:14 -0400 Subject: [Ovirt-devel] [PATCH server] set postgres service to check init script status Message-ID: <1245463034-3879-1-git-send-email-jboggs@redhat.com> ignore the previous postgres patch and try this one instead --- installer/modules/ovirt/manifests/postgres.pp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp index 6620a88..c46b360 100644 --- a/installer/modules/ovirt/manifests/postgres.pp +++ b/installer/modules/ovirt/manifests/postgres.pp @@ -41,7 +41,8 @@ class postgres::bundled{ service {"postgresql" : ensure => running, enable => true, - require => Single_exec[initialize_db] + require => Single_exec[initialize_db], + hasstatus => true } single_exec {"create_ovirt_db": -- 1.6.2.2 From dpierce at redhat.com Mon Jun 22 18:23:49 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 22 Jun 2009 14:23:49 -0400 Subject: [Ovirt-devel] [PATCH node] Only allow initial networking to be configured. bz#507393 Message-ID: <1245695029-23238-1-git-send-email-dpierce@redhat.com> If an existing bridge configuration is detected, then an error message is shown to the user and the script exits. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index d29bd12..4081a9d 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -26,6 +26,14 @@ if ! is_local_storage_configured; then exit 99 fi +# if the network is already configured, then exit the script +ls /etc/sysconfig/network-scripts/ifcfg-br* > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + printf "\nExisting network configuration detected. Aborting...\n\n" + exit 99 +fi + function configure_interface { local NIC=$1 -- 1.6.0.6 From jguiditt at redhat.com Mon Jun 22 20:52:12 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Mon, 22 Jun 2009 16:52:12 -0400 Subject: [Ovirt-devel] Patch series for Cloud Vm Actions Message-ID: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> The following two patches should be applied in the order: * [PATCH server] Add svc_vm_actions method to VmService. * [PATCH server] Cloud UI layer to initiate actions on vms. The service layer patch should work fine on its own (and not break anything), but cloud patch relies on service being there. From jguiditt at redhat.com Mon Jun 22 20:52:13 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Mon, 22 Jun 2009 16:52:13 -0400 Subject: [Ovirt-devel] [PATCH server] Add svc_vm_actions method to VmService. In-Reply-To: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> References: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> Message-ID: <1245703934-30527-2-git-send-email-jguiditt@redhat.com> Also includes a couple minor model changes to support better error reporting. This method was added so that a client could submit multiple vms to the service layer in one call and get back appropriate messages showing any failures without those failures also causing the entire call to fail, or forcing the client to implement handling (begin/rescue blocks) of these errors to continue through the submitted vm list. Signed-off-by: Jason Guiditta --- src/app/models/vm.rb | 7 ++ src/app/models/vm_task.rb | 4 +- src/app/services/service_module_helper.rb | 34 +++++++ src/app/services/vm_service.rb | 33 ++++++- src/test/fixtures/permissions.yml | 6 +- src/test/fixtures/vms.yml | 13 +++ src/test/unit/vm_service_test.rb | 149 +++++++++++++++++++++++++++++ src/test/unit/vm_task_test.rb | 38 ++++++++ src/test/unit/vm_test.rb | 23 ++++- 9 files changed, 300 insertions(+), 7 deletions(-) create mode 100644 src/app/services/service_module_helper.rb create mode 100644 src/test/unit/vm_service_test.rb create mode 100644 src/test/unit/vm_task_test.rb diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index c1be4a6..3e3badc 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -280,6 +280,13 @@ class Vm < ActiveRecord::Base actions end + # Provide method to check if requested action exists, so caller can decide + # if they want to throw an error of some sort before continuing + # (ie in service api) + def valid_action?(action) + return VmTask::ACTIONS.include?(action) ? true : false + end + # these resource checks are made at VM start/restore time # use pending here by default since this is used for queueing VM # creation/start operations diff --git a/src/app/models/vm_task.rb b/src/app/models/vm_task.rb index 762438f..649001d 100644 --- a/src/app/models/vm_task.rb +++ b/src/app/models/vm_task.rb @@ -146,10 +146,10 @@ class VmTask < Task end def self.action_privilege(action) - return ACTIONS[action][:privilege][0] + return ACTIONS[action].nil? ? nil : ACTIONS[action][:privilege][0] end def self.action_privilege_object(action, obj) - return obj.send(ACTIONS[action][:privilege][1]) + return ACTIONS[action].nil? ? nil : obj.send(ACTIONS[action][:privilege][1]) end def self.action_label(action) return ACTIONS[action][:label] diff --git a/src/app/services/service_module_helper.rb b/src/app/services/service_module_helper.rb new file mode 100644 index 0000000..dd04f99 --- /dev/null +++ b/src/app/services/service_module_helper.rb @@ -0,0 +1,34 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + + +# This module is used to bootstrap testing for the service api, +# which depends on certain methods existing in the class which includes it. +# Clearly this is not the case with unit tests on the modules themselves, +# so any dependencies are set up here. +module ServiceModuleHelper + + def get_login_user + return @user + end + + def set_login_user(user=nil) + @user = user + end +end \ No newline at end of file diff --git a/src/app/services/vm_service.rb b/src/app/services/vm_service.rb index cfb3c5f..b743059 100644 --- a/src/app/services/vm_service.rb +++ b/src/app/services/vm_service.rb @@ -180,12 +180,41 @@ module VmService # VmTask.action_privilege(@action) def svc_vm_action(id, vm_action, action_args) @vm = Vm.find(id) + unless @vm.valid_action?(vm_action) + raise ActionError.new("#{vm_action} is an invalid action.") + end authorized!(VmTask.action_privilege(vm_action), VmTask.action_privilege_object(vm_action, at vm)) unless @vm.queue_action(@user, vm_action, action_args) - raise ActionError.new("#{vm_action} is an invalid action.") + raise ActionError.new("#{vm_action} cannot be performed on this vm.") + end + return "#{@vm.description}: #{vm_action} was successfully queued." + end + + # Perform action +vm_action+ on vms identified by +vm_id+ + # + # === Instance variables + # * @vms VMs identified by +vm_ids+ + # === Required permissions + # permission is action-specific as determined by + # VmTask.action_privilege(@action) + # This method can be called to initiate an action on one or more vms + def svc_vm_actions(vm_ids, vm_action, action_args) + vm_ids = [vm_ids] unless vm_ids.is_a?(Array) + successful_vms = [] + failed_vms = {} + vm_ids.each do |vm_id| + begin + successful_vms << svc_vm_action(vm_id, vm_action, action_args) + rescue Exception => ex + failed_vms[@vm.description] = ex.message + end + end + unless failed_vms.empty? + raise PartialSuccessError.new("Your request to #{vm_action} encountered the following errors: ", + failed_vms, successful_vms) end - return "#{vm_action} was successfully queued." + return "#{vm_action} successful." end # Cancels queued tasks for for Vm with +id+ diff --git a/src/test/fixtures/permissions.yml b/src/test/fixtures/permissions.yml index 4895f3e..eed95fd 100644 --- a/src/test/fixtures/permissions.yml +++ b/src/test/fixtures/permissions.yml @@ -35,5 +35,9 @@ ovirtadmin_prodops_pool: ovirtadmin_corp_com_qa_pool: role: monitor uid: ovirtadmin - pool: corp_com_qa + pool: corp_qa_vmpool parent_permission: ovirtadmin_root +testuser_corp_com_qa_pool: + role: user + uid: testuser + pool: corp_qa_vmpool diff --git a/src/test/fixtures/vms.yml b/src/test/fixtures/vms.yml index 69b1c2b..b2711b2 100644 --- a/src/test/fixtures/vms.yml +++ b/src/test/fixtures/vms.yml @@ -65,6 +65,19 @@ foobar_prod1_vm: boot_device: cdrom host: fedoraworkstation_foobar_com vm_resource_pool: corp_com_production_vmpool +corp_com_qa_postgres_vm: + uuid: f6059569-a81f-4728-bb61-6f16b1c594e7 + description: corp.com qa postgres vm + num_vcpus_allocated: 2 + num_vcpus_used: 2 + memory_allocated: 262144 + memory_used: 131072 + vnic_mac_addr: 00:16:3e:04:de:c8 + state: running + needs_restart: 0 + boot_device: hd + host: macworkstation_qa_corp_com + vm_resource_pool: corp_qa_vmpool foobar_prod2_vm: uuid: 24b9a994-d415-481d-ace8-1d810b601eb6 description: foobar prod2 diff --git a/src/test/unit/vm_service_test.rb b/src/test/unit/vm_service_test.rb new file mode 100644 index 0000000..7bd00ad --- /dev/null +++ b/src/test/unit/vm_service_test.rb @@ -0,0 +1,149 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + + +require File.dirname(__FILE__) + '/../test_helper' + +class VmServiceTest < ActiveSupport::TestCase + + include ServiceModuleHelper + include VmService + fixtures :vms + + def setup + set_login_user('ovirtadmin') + end + + # Ensure correct message is returned for a valid action requested + # by a user with the proper permissions + def test_svc_vm_action_valid_user + assert_equal("#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued.", + svc_vm_action(vms(:production_mysqld_vm).id, 'shutdown_vm', nil)) + end + + # Ensure that if a non-existant action is passed in, ActionError + # is thrown + def test_svc_vm_action_invalid_action + assert_raise ActionError do + svc_vm_action(vms(:production_httpd_vm).id, 'stop_vm', nil) + end + end + + # Ensure that if a user with the wrong permissions is passed in, + # PermissionError is thrown + def test_svc_vm_action_invalid_user + set_login_user('fred') + assert_raise PermissionError do + svc_vm_action(vms(:production_mysqld_vm).id, 'shutdown_vm', nil) + end + end + + # Ensure that if an invalid state change for a vm is requested, + # ActionError is thrown + def test_svc_vm_action_invalid_state_change + assert_raise ActionError do + svc_vm_action(vms(:production_httpd_vm).id, 'shutdown_vm', nil) + end + end + + # If only one vm was passed into svc_vm_actions, and that action cannot + # be performed, ActionError should be returned + def test_failed_single_vm_returns_partial_success_error + assert_raise PartialSuccessError do + svc_vm_actions(vms(:production_httpd_vm).id, 'shutdown_vm', nil) + end + end + + # If multiple vms were passed into svc_vm_actions, and one or more (but + # not all) actions cannot be performed, PartialSuccessError should be returned + def test_failed_multiple_vms_return_partial_success + assert_raise PartialSuccessError do + svc_vm_actions([vms(:production_httpd_vm).id, + vms(:production_mysqld_vm).id, + vms(:production_ftpd_vm).id], 'shutdown_vm', nil) + end + end + + # Ensure we receive the expected success message if all actions succeed + # (should be the same message if one or more, so we have one test for + # each of those cases) + def test_success_message_from_single_vm + assert_equal("shutdown_vm successful.", + svc_vm_actions(vms(:production_mysqld_vm).id, 'shutdown_vm', nil)) + end + + # Ensure we receive the expected success message if all actions succeed + # (should be the same message if one or more, so we have one test for + # each of those cases) + def test_success_message_for_multiple_vms + assert_equal("shutdown_vm successful.", + svc_vm_actions([vms(:production_postgresql_vm).id, + vms(:production_mysqld_vm).id, + vms(:foobar_prod1_vm).id], 'shutdown_vm', nil)) + end + + # Ensure that if a non-existant action is passed in, PartialSuccessError + # is thrown + def test_svc_vm_actions_invalid_action + assert_raise PartialSuccessError do + svc_vm_actions(vms(:production_httpd_vm).id, 'stop_vm', nil) + end + end + + # Ensure we receive the expected success message if all actions succeed + # (should be the same message if one or more, so we have one test for + # each of those cases) + def test_success_message_from_single_vm_with_less_privileged_user + set_login_user('testuser') + assert_equal("shutdown_vm successful.", + svc_vm_actions(vms(:corp_com_qa_postgres_vm).id, 'shutdown_vm', nil)) + end + + # Ensure that if a user with the wrong permissions is passed in, + # PartialSuccessError is thrown. This allows some vms to still pass + # while others with wrong perms fail. + def test_svc_vm_actions_invalid_user + set_login_user('testuser') + assert_raise PartialSuccessError do + svc_vm_actions([vms(:corp_com_qa_postgres_vm).id, + vms(:production_mysqld_vm).id], 'shutdown_vm', nil) + end + end + + # Ensure that if a user with the wrong permissions is passed in, + # PartialSuccessError contains the message of success and permission error. + def test_error_for_svc_vm_actions_invalid_user + set_login_user('testuser') + actual_error = nil + expected_error = PartialSuccessError.new( + "Your request to shutdown_vm encountered the following errors: ", + {vms(:production_mysqld_vm).description => "You have insufficient privileges to perform action."}, + ["#{vms(:corp_com_qa_postgres_vm).description}: shutdown_vm was successfully queued."]) + + begin + svc_vm_actions([vms(:corp_com_qa_postgres_vm).id, + vms(:production_mysqld_vm).id], 'shutdown_vm', nil) + rescue Exception => ex + actual_error = ex + end + assert_equal expected_error.message, actual_error.message + assert_equal expected_error.failures, actual_error.failures + assert_equal expected_error.successes, actual_error.successes + end +end diff --git a/src/test/unit/vm_task_test.rb b/src/test/unit/vm_task_test.rb new file mode 100644 index 0000000..39be915 --- /dev/null +++ b/src/test/unit/vm_task_test.rb @@ -0,0 +1,38 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + + +require File.dirname(__FILE__) + '/../test_helper' + +class VmTaskTest < ActiveSupport::TestCase + + fixtures :vms + + # Ensure action_privilege method returns nil if it is passed an action + # that does not exist. + def test_action_privilege_with_bad_action + assert_equal(nil, VmTask.action_privilege('stop_vm')) + end + + # Ensure action_privilege_object method returns nil if it is passed an action + # that does not exist. + def test_action_privilege_object_with_bad_action + assert_equal(nil, VmTask.action_privilege_object('stop_vm', vms(:production_httpd_vm).id)) + end +end diff --git a/src/test/unit/vm_test.rb b/src/test/unit/vm_test.rb index 5e03715..a5d6b3d 100644 --- a/src/test/unit/vm_test.rb +++ b/src/test/unit/vm_test.rb @@ -1,6 +1,7 @@ # # Copyright (C) 2008 Red Hat, Inc. -# Written by Scott Seago +# Written by Scott Seago , +# Jason Guiditta # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +20,7 @@ require File.dirname(__FILE__) + '/../test_helper' -class VmTest < Test::Unit::TestCase +class VmTest < ActiveSupport::TestCase fixtures :vms fixtures :pools @@ -173,6 +174,24 @@ class VmTest < Test::Unit::TestCase assert_equal 'stopped', vms(:production_httpd_vm).get_pending_state end + def test_get_action_list_with_no_user + empty_array = [] + assert_equal(empty_array, vms(:production_httpd_vm).get_action_list) + end + + def test_queue_action_returns_false_with_invalid_action + assert_equal(false, vms(:production_httpd_vm).queue_action('ovirtadmin', 'stop_vm')) + end + + def test_valid_action_with_invalid_param + assert_equal(false, vms(:production_httpd_vm).valid_action?('stop_vm')) + end + + # Ensure valid_action? returns true + def test_valid_action_with_valid_param + assert_equal(true, vms(:production_httpd_vm).valid_action?('shutdown_vm')) + end + def test_paginated_results assert_equal 5, Vm.paged_with_perms('ovirtadmin', Privilege::VIEW, 1, 'vms.id').size end -- 1.6.0.6 From jguiditt at redhat.com Mon Jun 22 20:52:14 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Mon, 22 Jun 2009 16:52:14 -0400 Subject: [Ovirt-devel] [PATCH server] Cloud UI layer to initiate actions on vms. In-Reply-To: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> References: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> Message-ID: <1245703934-30527-3-git-send-email-jguiditt@redhat.com> Signed-off-by: Jason Guiditta --- src/app/controllers/cloud/cloud_controller.rb | 20 +++++- src/app/controllers/cloud/instance_controller.rb | 25 +++---- src/app/views/cloud/instance/_show.rhtml | 1 - src/app/views/cloud/instance/index.rhtml | 31 +++++--- src/app/views/layouts/cloud/_notification.rhtml | 31 ++++++++ src/public/stylesheets/cloud/layout.css | 73 +++++++++++++++++++- .../functional/cloud/instance_controller_test.rb | 65 +++++++++++++++++- 7 files changed, 215 insertions(+), 31 deletions(-) create mode 100644 src/app/views/layouts/cloud/_notification.rhtml diff --git a/src/app/controllers/cloud/cloud_controller.rb b/src/app/controllers/cloud/cloud_controller.rb index 154d15d..19c56b6 100644 --- a/src/app/controllers/cloud/cloud_controller.rb +++ b/src/app/controllers/cloud/cloud_controller.rb @@ -26,9 +26,27 @@ class Cloud::CloudController < ApplicationController protected + # Override the default in ApplicationController, cloud has its own + # template for rendering these errors + def html_error_page(title, msg) + flash[:error] = msg + redirect_to params + end + + # Override the default in ApplicationController, cloud has its own + # way of handling these (hooked into VmService::svc_vm_actions + def handle_partial_success_error(error) + handle_error(:error => error, :status => :ok, + :message => {:summary => error.message, + :failures => error.failures, + :successes => error.successes}, + :title => "Some actions failed") + end # NOTE: This probably will/should be moved to use set_perms in - # ApplicationService once that is ready to go. + # ApplicationService once that is ready to go. Only problem with that + # idea is that there is currently no before filter to make sure that + # gets called. def set_vars @user = get_login_user end diff --git a/src/app/controllers/cloud/instance_controller.rb b/src/app/controllers/cloud/instance_controller.rb index a4d0fd8..130f30b 100644 --- a/src/app/controllers/cloud/instance_controller.rb +++ b/src/app/controllers/cloud/instance_controller.rb @@ -44,7 +44,7 @@ class Cloud::InstanceController < Cloud::CloudController task_order = find_in_params_or_default(:task_order, "tasks.id") @vm_details = Vm.find(ids) if ids if @vm_details - @tasks = VmTask.paginate(:conditions => ["task_target_id in (:ids)",{:ids => ids}], + @tasks = VmTask.paginate(:include => :vm, :conditions => ["task_target_id in (:ids)",{:ids => ids}], :per_page => 5, :page => task_page, :order => task_order) end end @@ -76,19 +76,18 @@ class Cloud::InstanceController < Cloud::CloudController return params[key] && params[key] != "" ? params[key] : default end -# This redirects the user to a get url if they are just trying to view details for one or more -# instances. -# TODO: if the user is trying to submit an acton on selected instances, call the service -# layer and display the :flash (might still want to do :get redirect to keep pagination/sorting -# correct. +# This implements the Post/Redirect/Get pattern, and redirects the user to +# a get url so an action is not accidentally posted twice. def handle_form - case params[:submit_for_list] - when "Show Selected" - params.delete(:submit_for_list) - redirect_to :action => "index", :params => params - return -# Do this if we have submitted an action on one or more vms. -# svc_vm_action(params[:ids], params[:vm_action], params[:action_args]) + if params[:submit_for_list] + submit_type = params[:submit_for_list] + params.delete(:submit_for_list) + if params[:ids].nil? + flash[:warning] = "You must select at least one instance to perform an action." + elsif submit_type != "Show Selected" + flash[:notice] = svc_vm_actions(params[:ids], submit_type.downcase << '_vm', params[:action_args]) + end + redirect_to params end end diff --git a/src/app/views/cloud/instance/_show.rhtml b/src/app/views/cloud/instance/_show.rhtml index 001286e..186c4ba 100644 --- a/src/app/views/cloud/instance/_show.rhtml +++ b/src/app/views/cloud/instance/_show.rhtml @@ -1,7 +1,6 @@
        <%= submit_tag 'Show Selected', :id => 'submit_for_list', :name => 'submit_for_list' %> - <% if @vm_details %>

        <% if @vm_details.size == 1 %> diff --git a/src/app/views/cloud/instance/index.rhtml b/src/app/views/cloud/instance/index.rhtml index 757d67c..330dd58 100644 --- a/src/app/views/cloud/instance/index.rhtml +++ b/src/app/views/cloud/instance/index.rhtml @@ -1,23 +1,30 @@ +
        -
        • New Instance
        • Actions -
            - <% @actions.each {|action| %> -
          • <%= image_tag action[2]%><%= action[0] %>
          • - <% } %> -
          + <%# This form tag is terminated in _show.rhtml %> + <%=%> +
            + <% @actions.each {|action| %> + +
          • + <%= image_tag action[2]%> + <%= submit_tag action[0], :name => 'submit_for_list', :class => 'button_as_link' %> +
          • + <% } %> +
        - <%# This form tag is terminated in _show.rhtml %>
        - <%= render :partial => 'list' %> + <% if !flash.empty? %> + <%= render :partial => '/layouts/cloud/notification' %> + <% end %> + <%= render :partial => 'list' %>
        - <%= render :partial => 'show' %> -
        \ No newline at end of file + <%= render :partial => 'show' %> +

        + \ No newline at end of file diff --git a/src/app/views/layouts/cloud/_notification.rhtml b/src/app/views/layouts/cloud/_notification.rhtml new file mode 100644 index 0000000..96042fc --- /dev/null +++ b/src/app/views/layouts/cloud/_notification.rhtml @@ -0,0 +1,31 @@ +
        class="error-align"<%end%>"> + <%= link_to "", params, :id => "close-notify" %> + <% if flash[:error] %> + <% if !flash[:error][:successes].empty? %> +
        +

        The following items were successful:

        +
          + <% flash[:error][:successes].each {|item| %> +
        • <%= item %>
        • + <% } %> +
        +
        + <% end %> + <% if !flash[:error][:failures].empty? %> +

        <%= flash[:error][:summary]%>

        +
        +
          + <% flash[:error][:failures].each {|key, value| %> +
        • <%= key %>: <%= value %>
        • + <% } %> +
        +
        + <% end %> + <% end %> + <% if flash[:warning] %> +

        <%= flash[:warning] %>

        + <% end %> + <% if flash[:notice] %> +
        • <%= flash[:notice] %>
        + <% end %> +
        \ No newline at end of file diff --git a/src/public/stylesheets/cloud/layout.css b/src/public/stylesheets/cloud/layout.css index 0fd158d..1d1fa07 100644 --- a/src/public/stylesheets/cloud/layout.css +++ b/src/public/stylesheets/cloud/layout.css @@ -28,6 +28,14 @@ html {min-width:640px;} color: #337ACC; } +/* Make buttons look like links */ +.button_as_link { + background: none; + color: #666666; + border: none; + cursor: pointer; +} + #navcontainer { height:40px; } @@ -205,8 +213,10 @@ input#submit_for_list { #toolbar li:hover { background: #337ACC; +} + +#toolbar li:hover > .button_as_link { color: #FFFFFF; - cursor: pointer; } #toolbar li.current { /* This is not really needed right now, but will be useful when we add filters. */ @@ -234,3 +244,64 @@ input#submit_for_list { } #toolbar li:hover ul {display: block;} + +/****** Notification styles ******/ +#notification { + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; + position: absolute; + z-index: 1; + top: 2em; + left: 35%; + margin: 0 auto; + padding: 1.5em; + background: #337ACC; + border: solid 0.2em; +} + +.error-align {left: 25% !important;} + +#notification > div { + margin-bottom: 1em; +} + +#notification h4 { + text-indent: 3em; +} + +#close-notify { + position: absolute; + right: 0.2em; + top: 0.2em; + width:11px; + height:11px; + background: url(/images/closebox-11px.png) no-repeat; +} + +.success { + width: 100%; + background:url(/images/icon_conf_success.png) left center no-repeat #CCFFCC; + border: solid 0.2em green; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} + +.success li, .error li { + margin-left:3em; +} + +.error { + width: 100%; + background:url(/images/icon_conf_error.png) left center no-repeat #EC9999; + border: solid 0.2em red; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} + +.warning { + width: 100%; + background:url(/images/icon_conf_warning.png) left center no-repeat #FFFFCC; + border: solid 0.2em yellow; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb index 213d2e0..71d132b 100644 --- a/src/test/functional/cloud/instance_controller_test.rb +++ b/src/test/functional/cloud/instance_controller_test.rb @@ -1,6 +1,27 @@ -require 'test_helper' +# +# Copyright (C) 2008 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +require File.dirname(__FILE__) + '/../../test_helper' class Cloud::InstanceControllerTest < ActionController::TestCase + + include ServiceModuleHelper fixtures :vms, :tasks def setup @controller = Cloud::InstanceController.new @@ -14,10 +35,48 @@ class Cloud::InstanceControllerTest < ActionController::TestCase assert_template 'index' assert_not_nil assigns(:vms) assert_not_nil assigns(:user) + assert_equal({}, flash, "flash object is not empty!") + assert_equal(true, flash.empty?) + assert_select "#notification", false, "This page must contain no notification block" end - def test_should_redirect_if_request_for_selected + def test_should_redirect_if_form_submitted post(:index,{:submit_for_list => 'Show Selected'}) - assert_response :redirect + assert_redirected_to :action => :index + #TODO: since this is a redirect, it returns a 302 and nil template, + # would be good to figure out how to get the actual result returned to + # browser so we can do an assert_select + end + + def test_add_valid_task + post(:index,{:submit_for_list => 'Shutdown', :ids => [vms(:production_mysqld_vm).id]}) + assert_equal('shutdown_vm successful.', flash[:notice]) + assert_redirected_to :action => :index, :ids => vms(:production_mysqld_vm).id + end + + def test_add_invalid_task + post(:index,{:submit_for_list => 'Shutdown', + :ids => [vms(:production_mysqld_vm).id,vms(:production_httpd_vm).id]}) + expected_failures = {:summary => "Your request to shutdown_vm encountered the following errors: ", + :failures => {vms(:production_httpd_vm).description => "shutdown_vm cannot be performed on this vm."}, + :successes => ["#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued."]} + assert_equal(expected_failures, flash[:error]) + assert_redirected_to :action => :index, :ids => [vms(:production_mysqld_vm).id,vms(:production_httpd_vm).id] + end + + def test_add_task_no_perms_for_some_vms + post(:index,{:submit_for_list => 'Shutdown', + :ids => [vms(:production_mysqld_vm).id,vms(:corp_com_qa_postgres_vm).id]}) + expected_failures = {:summary => "Your request to shutdown_vm encountered the following errors: ", + :failures => {vms(:corp_com_qa_postgres_vm).description => "You have insufficient privileges to perform action."}, + :successes => ["#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued."]} + assert_equal(expected_failures, flash[:error]) + assert_redirected_to :action => :index, :ids => [vms(:production_mysqld_vm).id,vms(:corp_com_qa_postgres_vm).id] + end + + # Make sure we get warning back if no instance was chosen to perform an action on. + def test_no_instance_chosen + post(:index,{:submit_for_list => 'Shutdown'}) + assert_equal("You must select at least one instance to perform an action.", flash[:warning]) end end -- 1.6.0.6 From mmorsi at redhat.com Mon Jun 22 21:54:24 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Mon, 22 Jun 2009 17:54:24 -0400 Subject: [Ovirt-devel] [PATCH server] set postgres service to check init script status In-Reply-To: <1245463034-3879-1-git-send-email-jboggs@redhat.com> References: <1245463034-3879-1-git-send-email-jboggs@redhat.com> Message-ID: <4A3FFD90.9050806@redhat.com> Joey Boggs wrote: > ignore the previous postgres patch and try this one instead > > > --- > installer/modules/ovirt/manifests/postgres.pp | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp > index 6620a88..c46b360 100644 > --- a/installer/modules/ovirt/manifests/postgres.pp > +++ b/installer/modules/ovirt/manifests/postgres.pp > @@ -41,7 +41,8 @@ class postgres::bundled{ > service {"postgresql" : > ensure => running, > enable => true, > - require => Single_exec[initialize_db] > + require => Single_exec[initialize_db], > + hasstatus => true > } > > single_exec {"create_ovirt_db": > The problem has not appear again since this patch has been applied so ACK. Appreciate the help. -Mo From jboggs at redhat.com Mon Jun 22 22:43:12 2009 From: jboggs at redhat.com (Joey Boggs) Date: Mon, 22 Jun 2009 18:43:12 -0400 Subject: [Ovirt-devel] [PATCH server] set postgres service to check init script status In-Reply-To: <4A3FFD90.9050806@redhat.com> References: <1245463034-3879-1-git-send-email-jboggs@redhat.com> <4A3FFD90.9050806@redhat.com> Message-ID: <4A400900.7070907@redhat.com> On 06/22/2009 05:54 PM, Mohammed Morsi wrote: > Joey Boggs wrote: > >> ignore the previous postgres patch and try this one instead >> >> >> --- >> installer/modules/ovirt/manifests/postgres.pp | 3 ++- >> 1 files changed, 2 insertions(+), 1 deletions(-) >> >> diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp >> index 6620a88..c46b360 100644 >> --- a/installer/modules/ovirt/manifests/postgres.pp >> +++ b/installer/modules/ovirt/manifests/postgres.pp >> @@ -41,7 +41,8 @@ class postgres::bundled{ >> service {"postgresql" : >> ensure => running, >> enable => true, >> - require => Single_exec[initialize_db] >> + require => Single_exec[initialize_db], >> + hasstatus => true >> } >> >> single_exec {"create_ovirt_db": >> >> > The problem has not appear again since this patch has been applied so > ACK. Appreciate the help. > > -Mo > pushed -------------- next part -------------- An HTML attachment was scrubbed... URL: From pronix.service at gmail.com Tue Jun 23 13:15:33 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Tue, 23 Jun 2009 17:15:33 +0400 Subject: [Ovirt-devel] node boot error Message-ID: <4A40D575.5050105@gmail.com> Hello i have fedora 11 and build from next branch ovirt during boot by network (pxe) second node appear error. host stay anavailable and not sent to manage node identify data. ping return "unreachable host" Where may be error ? in /var/log/message selinux is permissive Jun 23 06:07:50 main dnsmasq[4500]: DHCPDISCOVER(eth0) 00:30:48:5f:28:40 Jun 23 06:07:50 main dnsmasq[4500]: DHCPOFFER(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 23 06:07:52 main dnsmasq[4500]: DHCPREQUEST(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 23 06:07:52 main dnsmasq[4500]: DHCPACK(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 23 06:07:52 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/pxelinux.0 to 10.12.105.179 Jun 23 06:07:52 main dnsmasq[4500]: TFTP error 0 TFTP Aborted received from 10.12.105.179 Jun 23 06:07:52 main dnsmasq[4500]: TFTP failed sending /var/lib/tftpboot/pxelinux.0 to 10.12.105.179 Jun 23 06:07:52 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/pxelinux.0 to 10.12.105.179 Jun 23 06:07:52 main kernel: type=1400 audit(1245755272.294:206): avc: denied { search } for pid=4500 comm="dnsmasq" name="tftpboot" dev=sda2 ino=4809233 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:tftpdir_t:s0 tclass=dir Jun 23 06:07:52 main kernel: type=1400 audit(1245755272.294:207): avc: denied { read } for pid=4500 comm="dnsmasq" name="pxelinux.0" dev=sda2 ino=4809627 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=unconfined_u:object_r:tftpdir_t:s0 tclass=file Jun 23 06:07:52 main kernel: type=1400 audit(1245755272.294:208): avc: denied { getattr } for pid=4500 comm="dnsmasq" path="/var/lib/tftpboot/pxelinux.0" dev=sda2 ino=4809627 scontext=unconfined_u:system_r:dnsmasq_t:s0 tcontext=unconfined_u:object_r:tftpdir_t:s0 tclass=file Jun 23 06:07:52 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/pxelinux.cfg/default to 10.12.105.179 Jun 23 06:07:52 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/menu.c32 to 10.12.105.179 Jun 23 06:07:52 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/pxelinux.cfg/default to 10.12.105.179 Jun 23 06:08:14 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/images/oVirt-Node-x86_64/vmlinuz0 to 10.12.105.179 Jun 23 06:08:14 main dnsmasq[4500]: TFTP sent /var/lib/tftpboot/images/oVirt-Node-x86_64/initrd0.img to 10.12.105.179 -- ? ?????????, ??????? From apevec at gmail.com Tue Jun 23 14:10:08 2009 From: apevec at gmail.com (Alan Pevec) Date: Tue, 23 Jun 2009 16:10:08 +0200 Subject: [Ovirt-devel] [PATCH node] Only allow initial networking to be configured. bz#507393 In-Reply-To: <1245695029-23238-1-git-send-email-dpierce@redhat.com> References: <1245695029-23238-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0906230710m5a24f1e8j95749e19acde88a8@mail.gmail.com> NAK, it should still be possible to reconfigure networking, but only from scratch - i.e. must start by selecting NIC and then DNS, NTP, earsing the old configuration. The actual bug is that configure_ntp modifies ntp.conf directly, it should be applied only when confirmed, as for the other configs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmyers at redhat.com Tue Jun 23 15:29:47 2009 From: pmyers at redhat.com (Perry Myers) Date: Tue, 23 Jun 2009 11:29:47 -0400 Subject: [Ovirt-devel] [PATCH node] Only allow initial networking to be configured. bz#507393 In-Reply-To: <2be7262f0906230710m5a24f1e8j95749e19acde88a8@mail.gmail.com> References: <1245695029-23238-1-git-send-email-dpierce@redhat.com> <2be7262f0906230710m5a24f1e8j95749e19acde88a8@mail.gmail.com> Message-ID: <4A40F4EB.9070601@redhat.com> On 06/23/2009 10:10 AM, Alan Pevec wrote: > NAK, it should still be possible to reconfigure networking, but only from > scratch - i.e. must start by selecting NIC and then DNS, NTP, earsing the > old configuration. > The actual bug is that configure_ntp modifies ntp.conf directly, it should > be applied only when confirmed, as for the other configs. We should also allow the user to reenter this menu with an already set up nic and just edit DNS/NTP settings w/o having to re setup the NIC. Perry From sseago at redhat.com Tue Jun 23 16:32:55 2009 From: sseago at redhat.com (Scott Seago) Date: Tue, 23 Jun 2009 12:32:55 -0400 Subject: [Ovirt-devel] [PATCH server] Cloud UI layer to initiate actions on vms. In-Reply-To: <1245703934-30527-3-git-send-email-jguiditt@redhat.com> References: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> <1245703934-30527-3-git-send-email-jguiditt@redhat.com> Message-ID: <4A4103B7.90209@redhat.com> Just a couple comments/questions, as I haven't tried it out yet. Looks good overall though -- will hopefully test it out later today. Jason Guiditta wrote: > Signed-off-by: Jason Guiditta > --- > src/app/controllers/cloud/cloud_controller.rb | 20 +++++- > src/app/controllers/cloud/instance_controller.rb | 25 +++---- > src/app/views/cloud/instance/_show.rhtml | 1 - > src/app/views/cloud/instance/index.rhtml | 31 +++++--- > src/app/views/layouts/cloud/_notification.rhtml | 31 ++++++++ > src/public/stylesheets/cloud/layout.css | 73 +++++++++++++++++++- > .../functional/cloud/instance_controller_test.rb | 65 +++++++++++++++++- > 7 files changed, 215 insertions(+), 31 deletions(-) > create mode 100644 src/app/views/layouts/cloud/_notification.rhtml > > diff --git a/src/app/controllers/cloud/cloud_controller.rb b/src/app/controllers/cloud/cloud_controller.rb > index 154d15d..19c56b6 100644 > --- a/src/app/controllers/cloud/cloud_controller.rb > +++ b/src/app/controllers/cloud/cloud_controller.rb > @@ -26,9 +26,27 @@ class Cloud::CloudController < ApplicationController > > protected > > # NOTE: This probably will/should be moved to use set_perms in > - # ApplicationService once that is ready to go. > + # ApplicationService once that is ready to go. Only problem with that > + # idea is that there is currently no before filter to make sure that > + # gets called. > It should probably eventually be handled via the svc_* calls. Once a permission-checking svc method is called, @user will already be set for you. > def set_vars > @user = get_login_user > end > diff --git a/src/app/views/cloud/instance/_show.rhtml b/src/app/views/cloud/instance/_show.rhtml > index 001286e..186c4ba 100644 > --- a/src/app/views/cloud/instance/_show.rhtml > +++ b/src/app/views/cloud/instance/_show.rhtml > @@ -1,7 +1,6 @@ >
        >
        > <%= submit_tag 'Show Selected', :id => 'submit_for_list', :name => 'submit_for_list' %> > - > <% if @vm_details %> >

        > <% if @vm_details.size == 1 %> > diff --git a/src/app/views/cloud/instance/index.rhtml b/src/app/views/cloud/instance/index.rhtml > index 757d67c..330dd58 100644 > --- a/src/app/views/cloud/instance/index.rhtml > +++ b/src/app/views/cloud/instance/index.rhtml > @@ -1,23 +1,30 @@ > +
        >
        > - >
          >
        • New Instance
        • >
        • > Actions > -
            > - <% @actions.each {|action| %> > -
          • <%= image_tag action[2]%><%= action[0] %>
          • > - <% } %> > -
          > + <%# This form tag is terminated in _show.rhtml %> > Which form tag? And above a lone closing
        • tag is removed from _show.rhtml > + <%=%> > +
            > + <% @actions.each {|action| %> > + > +
          • > + <%= image_tag action[2]%> > + <%= submit_tag action[0], :name => 'submit_for_list', :class => 'button_as_link' %> > +
          • > + <% } %> > +
          > >
        >
        > -
        <%# This form tag is terminated in _show.rhtml %> >
        > - <%= render :partial => 'list' %> > + <% if !flash.empty? %> > + <%= render :partial => '/layouts/cloud/notification' %> > + <% end %> > + <%= render :partial => 'list' %> >
        >
        > - <%= render :partial => 'show' %> > -
        > \ No newline at end of file > + <%= render :partial => 'show' %> > +

        > + > \ No newline at end of file > From jguiditt at redhat.com Tue Jun 23 16:53:01 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Tue, 23 Jun 2009 12:53:01 -0400 Subject: [Ovirt-devel] [PATCH server] Cloud UI layer to initiate actions on vms. In-Reply-To: <4A4103B7.90209@redhat.com> References: <1245703934-30527-1-git-send-email-jguiditt@redhat.com> <1245703934-30527-3-git-send-email-jguiditt@redhat.com> <4A4103B7.90209@redhat.com> Message-ID: <1245775981.4190.3.camel@localhost.localdomain> On Tue, 2009-06-23 at 12:32 -0400, Scott Seago wrote: > Just a couple comments/questions, as I haven't tried it out yet. Looks > good overall though -- will hopefully test it out later today. > > > Jason Guiditta wrote: > > Signed-off-by: Jason Guiditta > > --- > > src/app/controllers/cloud/cloud_controller.rb | 20 +++++- > > src/app/controllers/cloud/instance_controller.rb | 25 +++---- > > src/app/views/cloud/instance/_show.rhtml | 1 - > > src/app/views/cloud/instance/index.rhtml | 31 +++++--- > > src/app/views/layouts/cloud/_notification.rhtml | 31 ++++++++ > > src/public/stylesheets/cloud/layout.css | 73 +++++++++++++++++++- > > .../functional/cloud/instance_controller_test.rb | 65 +++++++++++++++++- > > 7 files changed, 215 insertions(+), 31 deletions(-) > > create mode 100644 src/app/views/layouts/cloud/_notification.rhtml > > > > diff --git a/src/app/controllers/cloud/cloud_controller.rb b/src/app/controllers/cloud/cloud_controller.rb > > index 154d15d..19c56b6 100644 > > --- a/src/app/controllers/cloud/cloud_controller.rb > > +++ b/src/app/controllers/cloud/cloud_controller.rb > > @@ -26,9 +26,27 @@ class Cloud::CloudController < ApplicationController > > > > protected > > > > # NOTE: This probably will/should be moved to use set_perms in > > - # ApplicationService once that is ready to go. > > + # ApplicationService once that is ready to go. Only problem with that > > + # idea is that there is currently no before filter to make sure that > > + # gets called. > > > It should probably eventually be handled via the svc_* calls. Once a > permission-checking svc method is called, @user will already be set for > you. As we discussed in irc, yes - that makes sense. > > def set_vars > > @user = get_login_user > > end > > diff --git a/src/app/views/cloud/instance/_show.rhtml b/src/app/views/cloud/instance/_show.rhtml > > index 001286e..186c4ba 100644 > > --- a/src/app/views/cloud/instance/_show.rhtml > > +++ b/src/app/views/cloud/instance/_show.rhtml > > @@ -1,7 +1,6 @@ > >
        > >
        > > <%= submit_tag 'Show Selected', :id => 'submit_for_list', :name => 'submit_for_list' %> > > - > > <% if @vm_details %> > >

        > > <% if @vm_details.size == 1 %> > > diff --git a/src/app/views/cloud/instance/index.rhtml b/src/app/views/cloud/instance/index.rhtml > > index 757d67c..330dd58 100644 > > --- a/src/app/views/cloud/instance/index.rhtml > > +++ b/src/app/views/cloud/instance/index.rhtml > > @@ -1,23 +1,30 @@ > > +
        > >
        > > - > >
          > >
        • New Instance
        • > >
        • > > Actions > > -
            > > - <% @actions.each {|action| %> > > -
          • <%= image_tag action[2]%><%= action[0] %>
          • > > - <% } %> > > -
          > > + <%# This form tag is terminated in _show.rhtml %> > > > Which form tag? And above a lone closing
        • tag is removed from That is an error, I forgot to remove that comment, just killed it in my local copy, updated my patch. > _show.rhtml > > + <%=%> > > +
            > > + <% @actions.each {|action| %> > > + > > +
          • > > + <%= image_tag action[2]%> > > + <%= submit_tag action[0], :name => 'submit_for_list', :class => 'button_as_link' %> > > +
          • > > + <% } %> > > +
          > > > >
        > >
        > > -
        <%# This form tag is terminated in _show.rhtml %> > >
        > > - <%= render :partial => 'list' %> > > + <% if !flash.empty? %> > > + <%= render :partial => '/layouts/cloud/notification' %> > > + <% end %> > > + <%= render :partial => 'list' %> > >
        > >
        > > - <%= render :partial => 'show' %> > > -
        > > \ No newline at end of file > > + <%= render :partial => 'show' %> > > +

        > > + > > \ No newline at end of file > > > From mmorsi at redhat.com Tue Jun 23 20:00:53 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Tue, 23 Jun 2009 16:00:53 -0400 Subject: [Ovirt-devel] [PATCH server] added ovirt-wait4service and invokation in installer to wait for psql/ldap Message-ID: <1245787253-3426-1-git-send-email-mmorsi@redhat.com> FIXME this patch isn't complete, still need to figure out the ldap command to wait for that service, something along the lines of: ldapsearch -b dc=priv,dc=ovirt,dc=org -x (but how will we parse the base from the installer? also this cmd fails, how to fix?) --- installer/modules/ovirt/manifests/ovirt.pp | 8 +++++- installer/modules/ovirt/manifests/postgres.pp | 13 ++++++--- ovirt-server.spec.in | 2 + scripts/ovirt-wait4service | 34 +++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100755 scripts/ovirt-wait4service diff --git a/installer/modules/ovirt/manifests/ovirt.pp b/installer/modules/ovirt/manifests/ovirt.pp index d953ebe..f293375 100644 --- a/installer/modules/ovirt/manifests/ovirt.pp +++ b/installer/modules/ovirt/manifests/ovirt.pp @@ -111,9 +111,15 @@ class ovirt::setup { single_exec { "create_ovirtadmin_acct" : command => "/usr/share/ovirt-server/script/grant_admin_privileges ovirtadmin", - require => [Single_Exec[db_migrate],Single_exec[set_ldap_hostname],Single_exec[set_ldap_dn]] + require => [Single_Exec[db_migrate],Single_exec[wait_for_ldap]] } + single_exec { "wait_for_ldap" : + command => "/usr/bin/ovirt-wait4service 'true' 10 2", + require => [Single_exec[set_ldap_hostname],Single_exec[set_ldap_dn]] + } + + single_exec { "set_ldap_hostname" : command => "/bin/sed -i -e 's/management.priv.ovirt.org/$ipa_host/' /usr/share/ovirt-server/config/ldap.yml", require => Package[ovirt-server] diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp index c46b360..9a4afa1 100644 --- a/installer/modules/ovirt/manifests/postgres.pp +++ b/installer/modules/ovirt/manifests/postgres.pp @@ -45,14 +45,19 @@ class postgres::bundled{ hasstatus => true } + single_exec { "wait_for_postgres" : + command => "/usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2", + require => Service[postgresql] + } + single_exec {"create_ovirt_db": command => "/usr/bin/createdb ovirt -U postgres", - require => [Exec[postgres_add_all_trust], Service[postgresql]] + require => [Exec[postgres_add_all_trust], Single_exec[wait_for_postgres]] } single_exec {"create_ovirt_development_db": command => "/usr/bin/createdb ovirt_development -U postgres", - require => [Exec[postgres_add_all_trust], Service[postgresql]] + require => [Exec[postgres_add_all_trust], Single_exec[wait_for_postgres]] } postgres_execute_command {"ovirt_db_create_role": @@ -70,13 +75,13 @@ class postgres::bundled{ exec {"postgres_add_all_trust": command => "/bin/echo 'local all all trust' > /var/lib/pgsql/data/pg_hba.conf", require => Single_exec[initialize_db], - notify => Service[postgresql] + notify => Single_exec[wait_for_postgres] } exec {"postgres_add_localhost_trust": command => "/bin/echo 'host all all 127.0.0.1 255.255.255.0 trust' >> /var/lib/pgsql/data/pg_hba.conf", require => Exec[postgres_add_all_trust], - notify => Service[postgresql] + notify => Single_exec[wait_for_postgres] } file { "/etc/ovirt-server/" : diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in index 1569a9a..eff1f2f 100644 --- a/ovirt-server.spec.in +++ b/ovirt-server.spec.in @@ -132,6 +132,7 @@ touch %{buildroot}%{_localstatedir}/log/%{name}/db-omatic.log %{__cp} -a %{pbuild}/scripts/ovirt-add-host %{buildroot}%{_bindir} %{__cp} -a %{pbuild}/scripts/ovirt-vm2node %{buildroot}%{_bindir} +%{__cp} -a %{pbuild}/scripts/ovirt-wait4service %{buildroot}%{_bindir} %{__cp} -a %{pbuild}/scripts/ovirt-reindex-search %{buildroot}%{_sbindir} %{__cp} -a %{pbuild}/scripts/ovirt-update-search %{buildroot}%{_sbindir} %{__rm} -rf %{buildroot}%{app_root}/tmp @@ -205,6 +206,7 @@ fi %{_sbindir}/ovirt-update-search %{_bindir}/ovirt-add-host %{_bindir}/ovirt-vm2node +%{_bindir}/ovirt-wait4service %{_initrddir}/ovirt-host-browser %{_initrddir}/ovirt-db-omatic %{_initrddir}/ovirt-host-collect diff --git a/scripts/ovirt-wait4service b/scripts/ovirt-wait4service new file mode 100755 index 0000000..65dbe2a --- /dev/null +++ b/scripts/ovirt-wait4service @@ -0,0 +1,34 @@ +#!/bin/sh +# ovirt-wait4service +# run a command a specified number times or until succesful, +# sleeping a specified number of seconds between tries + +testcmd=$1; shift +n_retries=$1; shift +sleep_seconds=$1; shift +total=$((n_retries*sleep_seconds)) + +print_usage(){ + echo "ovirt-wait4service test_command number_of_retries seconds_between_retries" +} + +if [ "$testcmd" == "" -o \ + "$sleep_seconds" == "" -o \ + "$n_retries" == "" ]; then + print_usage + exit 1 +fi + +echo "running command $testcmd $n_retries times or until succesful, sleeping $sleep_seconds seconds between tries" + +while [ $n_retries -gt 0 ] +do +echo $n_retries + eval "$testcmd" > /dev/null 2>&1 && exit 0 + echo service not ready yet, retrying... + n_retries=$((n_retries-1)) + sleep $sleep_seconds +done + +printf 'service not ready after %d seconds, giving up\n' $total 1>&2 +exit 1 -- 1.6.0.6 From mmorsi at redhat.com Tue Jun 23 20:34:19 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Tue, 23 Jun 2009 16:34:19 -0400 Subject: [Ovirt-devel] Re: [PATCH server] added ovirt-wait4service and invokation in installer to wait for psql/ldap In-Reply-To: <1245787253-3426-1-git-send-email-mmorsi@redhat.com> References: <1245787253-3426-1-git-send-email-mmorsi@redhat.com> Message-ID: <4A413C4B.7030303@redhat.com> Unfortunately the build failed for the same reason, eg postgres isn't available, with the patch applied. http://llama.virt.bos/builder-old/ovirt/06-23-2009_15:52/module-ovirt-server.html Interestingly the wait_for_postgres bit fails: [0;37mdebug: //postgres::bundled/Single_exec[wait_for_postgres]: Changing returns debug: //postgres::bundled/Single_exec[wait_for_postgres]: 1 change(s) debug: //postgres::bundled/Single_exec[wait_for_postgres]: Executing '/usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2' debug: Executing '/usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2' err: //postgres::bundled/Single_exec[wait_for_postgres]/returns: change from notrun to 0 failed: /usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2 returned 1 instead of 0 at /usr/share/ace/modules/ovirt/manifests/postgres.pp:51 notice: //postgres::bundled/Single_exec[wait_for_postgres]: Triggering 'refresh' from 2 dependencies debug: //postgres::bundled/Single_exec[wait_for_postgres]: Executing '/usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2' debug: Executing '/usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2' err: //postgres::bundled/Single_exec[wait_for_postgres]: Failed to call refresh on Single_exec[wait_for_postgres]: /usr/bin/ovirt-wait4service 'psql -l -U postgres' 10 2 returned 1 instead of 0 at /usr/share/ace/modules/ovirt/manifests/postgres.pp:51 notice: //postgres::bundled/Single_exec[create_ovirt_development_db]: Dependency single_exec[wait_for_postgres] has 1 failures warning: //postgres::bundled/Single_exec[create_ovirt_development_db]: Skipping because of failed dependencies notice: //postgres::bundled/Single_exec[create_ovirt_db]: Dependency single_exec[wait_for_postgres] has 1 failures warning: //postgres::bundled/Single_exec[create_ovirt_db]: Skipping because of failed dependencies Any thoughts? -Mo From jboggs at redhat.com Tue Jun 23 20:51:26 2009 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 23 Jun 2009 16:51:26 -0400 Subject: [Ovirt-devel] [PATCH server] add postgres permissions requires prior to starting service Message-ID: <1245790286-3591-1-git-send-email-jboggs@redhat.com> Give this one a try which will require the user/hosts permissions to be setup prior to starting postgres --- installer/modules/ovirt/manifests/postgres.pp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp index c46b360..381d67c 100644 --- a/installer/modules/ovirt/manifests/postgres.pp +++ b/installer/modules/ovirt/manifests/postgres.pp @@ -41,7 +41,7 @@ class postgres::bundled{ service {"postgresql" : ensure => running, enable => true, - require => Single_exec[initialize_db], + require => [Single_exec[initialize_db],Exec[postgres_add_localhost_trust]Exec[postgres_add_all_trust]], hasstatus => true } -- 1.6.2.2 From jboggs at redhat.com Tue Jun 23 20:53:06 2009 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 23 Jun 2009 16:53:06 -0400 Subject: [Ovirt-devel] Re: [PATCH server] add postgres permissions requires prior to starting service In-Reply-To: <1245790286-3591-1-git-send-email-jboggs@redhat.com> References: <1245790286-3591-1-git-send-email-jboggs@redhat.com> Message-ID: <4A4140B2.7080509@redhat.com> On 06/23/2009 04:51 PM, Joey Boggs wrote: > Give this one a try which will require the user/hosts permissions to be setup prior to starting postgres > > --- > installer/modules/ovirt/manifests/postgres.pp | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp > index c46b360..381d67c 100644 > --- a/installer/modules/ovirt/manifests/postgres.pp > +++ b/installer/modules/ovirt/manifests/postgres.pp > @@ -41,7 +41,7 @@ class postgres::bundled{ > service {"postgresql" : > ensure => running, > enable => true, > - require => Single_exec[initialize_db], > + require => [Single_exec[initialize_db],Exec[postgres_add_localhost_trust]Exec[postgres_add_all_trust]], > hasstatus => true > } > > ignore this one it's missing a comma From jboggs at redhat.com Tue Jun 23 20:56:39 2009 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 23 Jun 2009 16:56:39 -0400 Subject: [Ovirt-devel] [PATCH server] updated: add postgres permissions requires prior to starting service Message-ID: <1245790599-3664-1-git-send-email-jboggs@redhat.com> --- installer/modules/ovirt/manifests/postgres.pp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp index c46b360..36bcdc0 100644 --- a/installer/modules/ovirt/manifests/postgres.pp +++ b/installer/modules/ovirt/manifests/postgres.pp @@ -41,7 +41,7 @@ class postgres::bundled{ service {"postgresql" : ensure => running, enable => true, - require => Single_exec[initialize_db], + require => [Single_exec[initialize_db],Exec[postgres_add_localhost_trust],Exec[postgres_add_all_trust]], hasstatus => true } -- 1.6.2.2 From imain at redhat.com Wed Jun 24 00:07:39 2009 From: imain at redhat.com (Ian Main) Date: Tue, 23 Jun 2009 17:07:39 -0700 Subject: [Ovirt-devel] node boot error In-Reply-To: <4A40D575.5050105@gmail.com> References: <4A40D575.5050105@gmail.com> Message-ID: <20090623170739.7cec6a15@tp.mains.net> On Tue, 23 Jun 2009 17:15:33 +0400 dima vasiletc wrote: > Hello > i have fedora 11 and build from next branch ovirt > during boot by network (pxe) second node appear error. > host stay anavailable and not sent to manage node identify data. > ping return "unreachable host" > > Where may be error ? To see the real error you have to look at the console on the booting node. We're having issues with fedora 11 nodes, Alan and I are working on resolving it right now. Hopefully it won't be long! I'm getting frustrated with this one myself :). Ian From apevec at gmail.com Wed Jun 24 13:19:19 2009 From: apevec at gmail.com (Alan Pevec) Date: Wed, 24 Jun 2009 15:19:19 +0200 Subject: [Ovirt-devel] node boot error In-Reply-To: <20090623170739.7cec6a15@tp.mains.net> References: <4A40D575.5050105@gmail.com> <20090623170739.7cec6a15@tp.mains.net> Message-ID: <2be7262f0906240619t3265bd5eh71cd661e5f8a0a03@mail.gmail.com> On Wed, Jun 24, 2009 at 2:07 AM, Ian Main wrote: > On Tue, 23 Jun 2009 17:15:33 +0400 > dima vasiletc wrote: > > > Hello > > i have fedora 11 and build from next branch ovirt > > during boot by network (pxe) second node appear error. > > host stay anavailable and not sent to manage node identify data. > > ping return "unreachable host" > > > > Where may be error ? > > To see the real error you have to look at the console on the booting > node. We're having issues with fedora 11 nodes, Alan and I are working > on resolving it right now. Hopefully it won't be long! I'm getting > frustrated with this one myself :). Two issue were identified with livecd initrd in F11: - PXE boot failing with "Could not find any loop device." - loop is built-in since F10 so actually /dev/loop* was missing b/c udev didn't create it in time. Fixed by adding back udevadm settle (removed for F11 in http://git.fedorahosted.org/git/?p=mkinitrd;a=commitdiff;h=0016a5fb236839db31344fef1c87ad68680e301b) - udev sometimes hangs on startup, root cause unclear: Running plymouthd udev: starting version 141 Note that I didn't get any injected echo output after nash daemonize call in /init !? Workaround for this hang is to remove plymouth completely from initrd scripts, but that's clearly suboptimal. Attached is the patch for livecd-iso-to-pxeboot.sh which adds above workarounds into initrd, proper fixes need to be discussed with mkinitrd guys, but with this we can at least get reliable PXE boot. Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: livecd-iso-to-pxeboot.diff Type: application/octet-stream Size: 1128 bytes Desc: not available URL: From mmorsi at redhat.com Wed Jun 24 14:18:48 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Wed, 24 Jun 2009 10:18:48 -0400 Subject: [Ovirt-devel] [PATCH server] test vm: increased memory, raw disk image Message-ID: <1245853128-4511-1-git-send-email-mmorsi@redhat.com> --- autobuild.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 4c2aed9..9c79d27 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -94,7 +94,7 @@ sudo virsh undefine ovirt-server-test || true # create new vm for server, configuring via kickstart, boot it sudo appliance-creator --config ovirt-server-test.ks --name ovirt-server-test \ - -f qcow2 -p tar -d -v + -f raw --vmem=2048 -p tar -d -v # restore original kickstart mv ovirt-server-test.ks.orig ovirt-server-test.ks -- 1.6.0.6 From mmorsi at redhat.com Wed Jun 24 14:25:06 2009 From: mmorsi at redhat.com (Mohammed Morsi) Date: Wed, 24 Jun 2009 10:25:06 -0400 Subject: [Ovirt-devel] [PATCH server] updated: add postgres permissions requires prior to starting service In-Reply-To: <1245790599-3664-1-git-send-email-jboggs@redhat.com> References: <1245790599-3664-1-git-send-email-jboggs@redhat.com> Message-ID: <4A423742.8080604@redhat.com> Joey Boggs wrote: > --- > installer/modules/ovirt/manifests/postgres.pp | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp > index c46b360..36bcdc0 100644 > --- a/installer/modules/ovirt/manifests/postgres.pp > +++ b/installer/modules/ovirt/manifests/postgres.pp > @@ -41,7 +41,7 @@ class postgres::bundled{ > service {"postgresql" : > ensure => running, > enable => true, > - require => Single_exec[initialize_db], > + require => [Single_exec[initialize_db],Exec[postgres_add_localhost_trust],Exec[postgres_add_all_trust]], > hasstatus => true > } > > ACK From jboggs at redhat.com Wed Jun 24 14:27:46 2009 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Jun 2009 10:27:46 -0400 Subject: [Ovirt-devel] [PATCH server] updated: add postgres permissions requires prior to starting service In-Reply-To: <4A423742.8080604@redhat.com> References: <1245790599-3664-1-git-send-email-jboggs@redhat.com> <4A423742.8080604@redhat.com> Message-ID: <4A4237E2.40104@redhat.com> On 06/24/2009 10:25 AM, Mohammed Morsi wrote: > Joey Boggs wrote: > >> --- >> installer/modules/ovirt/manifests/postgres.pp | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/installer/modules/ovirt/manifests/postgres.pp b/installer/modules/ovirt/manifests/postgres.pp >> index c46b360..36bcdc0 100644 >> --- a/installer/modules/ovirt/manifests/postgres.pp >> +++ b/installer/modules/ovirt/manifests/postgres.pp >> @@ -41,7 +41,7 @@ class postgres::bundled{ >> service {"postgresql" : >> ensure => running, >> enable => true, >> - require => Single_exec[initialize_db], >> + require => [Single_exec[initialize_db],Exec[postgres_add_localhost_trust],Exec[postgres_add_all_trust]], >> hasstatus => true >> } >> >> >> > ACK > pushed -------------- next part -------------- An HTML attachment was scrubbed... URL: From slinabery at redhat.com Wed Jun 24 16:38:40 2009 From: slinabery at redhat.com (Steve Linabery) Date: Wed, 24 Jun 2009 11:38:40 -0500 Subject: [Ovirt-devel] [PATCH server] Vm state change auditing/accounting Message-ID: <1245861520-26014-1-git-send-email-slinabery@redhat.com> Adds VmStateChangeEvent class and uses VmObserver to track/audit state changes for Vm objects. Callbacks in VmObserver also update the new total_uptime and total_uptime_timestamp attributes of Vm class, which allows easy calculation of time spent in running states for user resource use accounting. --- src/app/models/vm.rb | 34 +++++++++++ src/app/models/vm_observer.rb | 96 ++++++++++++++++++++++++++++++ src/app/models/vm_state_change_event.rb | 22 +++++++ src/config/environment.rb | 2 +- src/db/migrate/039_add_vm_state_audit.rb | 49 +++++++++++++++ 5 files changed, 202 insertions(+), 1 deletions(-) create mode 100644 src/app/models/vm_observer.rb create mode 100644 src/app/models/vm_state_change_event.rb create mode 100644 src/db/migrate/039_add_vm_state_audit.rb diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index c1be4a6..a45342e 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -41,6 +41,14 @@ class Vm < ActiveRecord::Base :order => 'time_started DESC', :dependent => :destroy + + has_many :vm_state_change_events, + :order => 'created_at' do + def previous_state_with_type(state_type) + find(:first, :conditions=> { :to_state => state_type }, :order=> 'created_at DESC') + end + end + alias history vm_host_histories validates_presence_of :uuid, :description, :num_vcpus_allocated, @@ -138,6 +146,25 @@ class Vm < ActiveRecord::Base STATE_CREATE_FAILED = "create_failed" STATE_INVALID = "invalid" + ALL_STATES = [STATE_PENDING, + STATE_CREATING, + STATE_RUNNING, + STATE_UNREACHABLE, + STATE_POWERING_OFF, + STATE_STOPPING, + STATE_STOPPED, + STATE_STARTING, + STATE_SUSPENDING, + STATE_SUSPENDED, + STATE_RESUMING, + STATE_SAVING, + STATE_SAVED, + STATE_RESTORING, + STATE_MIGRATING, + STATE_CREATE_FAILED, + STATE_INVALID] + + DESTROYABLE_STATES = [STATE_PENDING, STATE_STOPPED, STATE_CREATE_FAILED, @@ -176,6 +203,13 @@ class Vm < ActiveRecord::Base validates_inclusion_of :state, :in => EFFECTIVE_STATE.keys + def get_calculated_uptime + if VmObserver::AUDIT_RUNNING_STATES.include?(state) + total_uptime_timestamp ? total_uptime + (Time.now - total_uptime_timestamp) : 0 + else + total_uptime + end + end def get_vm_pool vm_resource_pool diff --git a/src/app/models/vm_observer.rb b/src/app/models/vm_observer.rb new file mode 100644 index 0000000..914fd35 --- /dev/null +++ b/src/app/models/vm_observer.rb @@ -0,0 +1,96 @@ +# +# Copyright (C) 2008 Red Hat, Inc. +# Written by Steve Linabery +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +class VmObserver < ActiveRecord::Observer + + AUDIT_RUNNING_STATES = [Vm::STATE_RUNNING, + Vm::STATE_POWERING_OFF, + Vm::STATE_STOPPING, + Vm::STATE_STARTING, + Vm::STATE_RESUMING, + Vm::STATE_SAVING, + Vm::STATE_RESTORING, + Vm::STATE_MIGRATING] + + AUDIT_NON_RUNNING_STATES = Vm::ALL_STATES - AUDIT_RUNNING_STATES - [Vm::STATE_UNREACHABLE] + + def after_save(a_vm) + if a_vm.changed? + change = a_vm.changes['state'] + if change + event = VmStateChangeEvent.new({ :vm => a_vm, + :from_state => change[0], + :to_state => change[1]}) + event.save! + end + end + end + + def before_save(a_vm) + if a_vm.changed? + change = a_vm.changes['state'] + if change + #When going from a non-running state to a running state, update the + #total uptime timestamp to indicate the start of the running period. + + if AUDIT_NON_RUNNING_STATES.include?(change[0]) && + AUDIT_RUNNING_STATES.include?(change[1]) + a_vm.total_uptime_timestamp = Time.now + end + + #When going from a running state to anything but a running state, + #add the time since the last timestamp to the total uptime, and then + #update the total uptime timestamp. + #Note that this also matches the transition to unreachable + + if AUDIT_RUNNING_STATES.include?(change[0]) && + !AUDIT_RUNNING_STATES.include?(change[1]) + a_vm.total_uptime = a_vm.total_uptime + + (Time.now - a_vm.total_uptime_timestamp) + a_vm.total_uptime_timestamp = Time.now + end + + + #Leaving the unreachable state for a running state is a special case. + + if change[0] == Vm::STATE_UNREACHABLE && + AUDIT_RUNNING_STATES.include?(change[1]) + + #We need to know from what state the Vm most recently entered the + #unreachable state + prev = a_vm.vm_state_change_events.previous_state_with_type(Vm::STATE_UNREACHABLE) + + if prev + #If it entered unreachable from a running state, then we consider + #the time spent in unreachable as running time. Add the time + #spent in unreachable to total uptime, and update the timestamp. + if AUDIT_RUNNING_STATES.include?(prev.from_state) + a_vm.total_uptime = a_vm.total_uptime + + (Time.now - a_vm.total_uptime_timestamp) + a_vm.total_uptime_timestamp = Time.now + end + end + end + + end + end + end +end + +VmObserver.instance diff --git a/src/app/models/vm_state_change_event.rb b/src/app/models/vm_state_change_event.rb new file mode 100644 index 0000000..033e9da --- /dev/null +++ b/src/app/models/vm_state_change_event.rb @@ -0,0 +1,22 @@ +# +# Copyright (C) 2008 Red Hat, Inc. +# Written by Steve Linabery +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +class VmStateChangeEvent < ActiveRecord::Base + belongs_to :vm +end diff --git a/src/config/environment.rb b/src/config/environment.rb index 4014613..98a2fbb 100644 --- a/src/config/environment.rb +++ b/src/config/environment.rb @@ -82,7 +82,7 @@ Rails::Initializer.run do |config| # Activate observers that should always be running # config.active_record.observers = :cacher, :garbage_collector - config.active_record.observers = :host_observer + config.active_record.observers = :host_observer, :vm_observer end # Add new inflection rules using the following format diff --git a/src/db/migrate/039_add_vm_state_audit.rb b/src/db/migrate/039_add_vm_state_audit.rb new file mode 100644 index 0000000..f16fb8b --- /dev/null +++ b/src/db/migrate/039_add_vm_state_audit.rb @@ -0,0 +1,49 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Steve Linabery +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +class AddVmStateAudit < ActiveRecord::Migration + def self.up + add_column :vms, :total_uptime, :integer, :default => 0 + add_column :vms, :total_uptime_timestamp, :timestamp + + create_table :vm_state_change_events do |t| + t.timestamp :created_at + t.integer :vm_id + t.string :from_state + t.string :to_state + t.integer :lock_version, :default => 0 + end + + Vm.transaction do + Vm.find(:all).each do |vm| + event = VmStateChangeEvent.new(:vm_id => vm.id, + :to_state => vm.state + ) + event.save! + end + end + end + + def self.down + remove_column :vms, :total_uptime + remove_column :vms, :total_uptime_timestamp + + drop_table :vm_state_change_events + end +end -- 1.6.0.6 From imain at redhat.com Wed Jun 24 18:53:29 2009 From: imain at redhat.com (Ian Main) Date: Wed, 24 Jun 2009 14:53:29 -0400 Subject: [Ovirt-devel] [PATCH node-image] Add libboost_system to whitelist. Message-ID: <1245869609-29315-1-git-send-email-imain@redhat.com> Apparently libvirt-qpid requires libboost_system.so now. This adds it to the node image. Signed-off-by: Ian Main --- common-blacklist.ks | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/common-blacklist.ks b/common-blacklist.ks index 8a132d4..2452237 100644 --- a/common-blacklist.ks +++ b/common-blacklist.ks @@ -126,10 +126,12 @@ drop /usr/lib/libboost* keep /usr/lib/libboost_program_options.so* keep /usr/lib/libboost_filesystem.so* keep /usr/lib/libboost_thread-mt.so* +keep /usr/lib/libboost_system.so* drop /usr/lib64/libboost* keep /usr/lib64/libboost_program_options.so* keep /usr/lib64/libboost_filesystem.so* keep /usr/lib64/libboost_thread-mt.so* +keep /usr/lib64/libboost_system.so* drop /usr/kerberos keep /usr/kerberos/bin/kinit keep /usr/kerberos/bin/klist -- 1.6.2.2 From dpierce at redhat.com Wed Jun 24 18:58:32 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Jun 2009 14:58:32 -0400 Subject: [Ovirt-devel] node boot error In-Reply-To: <2be7262f0906240619t3265bd5eh71cd661e5f8a0a03@mail.gmail.com> References: <4A40D575.5050105@gmail.com> <20090623170739.7cec6a15@tp.mains.net> <2be7262f0906240619t3265bd5eh71cd661e5f8a0a03@mail.gmail.com> Message-ID: <20090624185832.GL5396@mcpierce-laptop.rdu.redhat.com> On Wed, Jun 24, 2009 at 03:19:19PM +0200, Alan Pevec wrote: > Attached is the patch for livecd-iso-to-pxeboot.sh which adds above > workarounds into initrd, proper fixes need to be discussed with mkinitrd > guys, > but with this we can at least get reliable PXE boot. This works perfectly for me. Autotests now completed successfully on F11. -- 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 ktf000 at gmail.com Wed Jun 24 19:55:28 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Wed, 24 Jun 2009 21:55:28 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool Message-ID: Hi there, I just installed oVirt and cobbler (I'm 100% novice!, so this could be a 100% silly question...). I can't get my initial host into the hardware pool. It PXE boots through cobbler, then fails with message "WARNING: Cannot find root file system!" and "Create symlink /dev/root and then exit this shell to continue the boot sequence." I suspect I didn't set up my ovirt-node correctly in cobbler. I used "/usr/share/ovirt-node-image/tftpboot/vmlinuz0" as the kernel and "/usr/share/ovirt-node-image/tftpboot/initrd0.img" as initrd. Can you please help me with this, I just ran out of ideas?.. Thanks a lot! L- -------------- next part -------------- An HTML attachment was scrubbed... URL: From imain at redhat.com Wed Jun 24 20:41:58 2009 From: imain at redhat.com (Ian Main) Date: Wed, 24 Jun 2009 13:41:58 -0700 Subject: [Ovirt-devel] node boot error In-Reply-To: <20090624185832.GL5396@mcpierce-laptop.rdu.redhat.com> References: <4A40D575.5050105@gmail.com> <20090623170739.7cec6a15@tp.mains.net> <2be7262f0906240619t3265bd5eh71cd661e5f8a0a03@mail.gmail.com> <20090624185832.GL5396@mcpierce-laptop.rdu.redhat.com> Message-ID: <20090624134158.39cf9e81@tp.mains.net> On Wed, 24 Jun 2009 14:58:32 -0400 "Darryl L. Pierce" wrote: > On Wed, Jun 24, 2009 at 03:19:19PM +0200, Alan Pevec wrote: > > Attached is the patch for livecd-iso-to-pxeboot.sh which adds above > > workarounds into initrd, proper fixes need to be discussed with mkinitrd > > guys, > > but with this we can at least get reliable PXE boot. > > This works perfectly for me. Autotests now completed successfully on > F11. Working for me too. So now we have to get this fixed in f11 somehow? We're going to need a readily buildable f11 node for release this week.. Ian From justin at redfish-group.com Thu Jun 25 08:35:39 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Thu, 25 Jun 2009 18:35:39 +1000 Subject: [Ovirt-devel] node servers show as unavailable after reboot of management server Message-ID: <4A4336DB.404@redfish-group.com> Hi, I had to reboot my management server today and when it comes back up the node machine has a status of "unavailable (enabled)". I saw this the last time I rebooted the management server and rebooting the node fixed the problem. What is the expected behaviour in this instance? My expectation would be that when the management server is reset, the nodes keep running (which they do) and once the management server is up the nodes should reconnect so they can be managed once again (which they don't). I don't imagine on a larger install you'd want to reboot every node whenever you rebooted the management server. Is anyone else seeing this? Cheers, Justin. From pronix.service at gmail.com Thu Jun 25 09:48:27 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Thu, 25 Jun 2009 13:48:27 +0400 Subject: [Ovirt-devel] node boot error In-Reply-To: <2be7262f0906240619t3265bd5eh71cd661e5f8a0a03@mail.gmail.com> References: <4A40D575.5050105@gmail.com> <20090623170739.7cec6a15@tp.mains.net> <2be7262f0906240619t3265bd5eh71cd661e5f8a0a03@mail.gmail.com> Message-ID: <4A4347EB.1050700@gmail.com> On 06/24/2009 05:19 PM, Alan Pevec wrote: > On Wed, Jun 24, 2009 at 2:07 AM, Ian Main > wrote: > > On Tue, 23 Jun 2009 17:15:33 +0400 > dima vasiletc > wrote: > > > Hello > > i have fedora 11 and build from next branch ovirt > > during boot by network (pxe) second node appear error. > > host stay anavailable and not sent to manage node identify data. > > ping return "unreachable host" > > > > Where may be error ? > > To see the real error you have to look at the console on the booting > node. We're having issues with fedora 11 nodes, Alan and I are > working > on resolving it right now. Hopefully it won't be long! I'm getting > frustrated with this one myself :). > > > Two issue were identified with livecd initrd in F11: > - PXE boot failing with "Could not find any loop device." - loop is > built-in since F10 so actually /dev/loop* was missing b/c udev didn't > create it in time. > Fixed by adding back udevadm settle (removed for F11 in > http://git.fedorahosted.org/git/?p=mkinitrd;a=commitdiff;h=0016a5fb236839db31344fef1c87ad68680e301b > ) > > - udev sometimes hangs on startup, root cause unclear: > Running plymouthd > udev: starting version 141 > > Note that I didn't get any injected echo output after nash daemonize > call in /init !? > Workaround for this hang is to remove plymouth completely from initrd > scripts, but that's clearly suboptimal. > > Attached is the patch for livecd-iso-to-pxeboot.sh which adds above > workarounds into initrd, proper fixes need to be discussed with > mkinitrd guys, > but with this we can at least get reliable PXE boot. > > Alan > Thanks it realy work. -- ? ?????????, ??????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pronix.service at gmail.com Thu Jun 25 09:56:24 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Thu, 25 Jun 2009 13:56:24 +0400 Subject: [Ovirt-devel] error with gssapi Message-ID: <4A4349C8.2000101@gmail.com> Hello I found on ovirt.org instruction for set unavailable(enable) to available(enable) i run "ruby /usr/share/ovirt-server/qmf-libvirt-example.rb" and get Error caching credentials; attempting to continue... Connecting to amqp://main.forex-24h.com:5672.. /usr/lib/ruby/site_ruby/1.8/qpid/delegates.rb:209:in `connection_start'/usr/lib/ruby/site_ruby/1.8/qpid/delegates.rb:209: [BUG] Segmentation fault ruby 1.8.6 (2008-08-11) [x86_64-linux] Aborted in log files i get this messages ==> /var/log/messages <== Jun 25 04:53:50 main ruby: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (No credentials cache found) ==> /var/log/krb5kdc.log <== Jun 25 04:53:49 main.forex-24h.com krb5kdc[1862](info): AS_REQ (7 etypes {18 17 16 23 1 3 2}) 10.12.105.132: ISSUE: authtime 1245923629, etypes {rep=18 tkt=18 ses=18}, qpidd/main.forex-24h.com at FOREX-24H.COM for krbtgt/FOREX-24H.COM at FOREX-24H.COM Bad configured dns can cause this error ? I think so because when second node try connect to qpid appear message ==> /var/log/messages <== Jun 25 04:53:27 main qpidd[30870]: 2009-06-25 04:53:27 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) -- ? ?????????, ??????? From justin at redfish-group.com Thu Jun 25 13:09:16 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Thu, 25 Jun 2009 23:09:16 +1000 Subject: [Ovirt-devel] iscsi storage creation Message-ID: <4A4376FC.2060608@redfish-group.com> Hi, I have set up a 40GB iscsi target on my san and when I add it in to the storage pool and it shows up as 40GB. When I try to create a 40GB volume in the ovirt UI it tries to but fails. The error message is that the volume will not fit. If I create one smaller than 40GB it works. Is anyone else experiencing this? Also, if I then start a virtual machine up to install on the newly created volume it sees both the smaller (39GB in this case) partition and a 40GB partition (presumably the failed one). Cheers, Justin. From jguiditt at redhat.com Thu Jun 25 14:42:35 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Thu, 25 Jun 2009 10:42:35 -0400 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: Message-ID: <1245940955.7392.1.camel@localhost.localdomain> On Wed, 2009-06-24 at 21:55 +0200, Laurent Monnoye wrote: > Hi there, > > I just installed oVirt and cobbler (I'm 100% novice!, so this could be > a 100% silly question...). I can't get my initial host into the > hardware pool. It PXE boots through cobbler, then fails with message > "WARNING: Cannot find root file system!" and "Create symlink /dev/root > and then exit this shell to continue the boot sequence." > > I suspect I didn't set up my ovirt-node correctly in cobbler. I used > "/usr/share/ovirt-node-image/tftpboot/vmlinuz0" as the kernel and > "/usr/share/ovirt-node-image/tftpboot/initrd0.img" as initrd. > > Can you please help me with this, I just ran out of ideas?.. > > Thanks a lot! > L- > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Did you install ovirt-node-image-pxe? If so, what does your pxelinux/cfg/default file look like? From jguiditt at redhat.com Thu Jun 25 14:45:34 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Thu, 25 Jun 2009 10:45:34 -0400 Subject: [Ovirt-devel] node servers show as unavailable after reboot of management server In-Reply-To: <4A4336DB.404@redfish-group.com> References: <4A4336DB.404@redfish-group.com> Message-ID: <1245941134.7392.5.camel@localhost.localdomain> On Thu, 2009-06-25 at 18:35 +1000, Justin Clacherty wrote: > Hi, > > I had to reboot my management server today and when it comes back up the > node machine has a status of "unavailable (enabled)". I saw this the > last time I rebooted the management server and rebooting the node fixed > the problem. > > What is the expected behaviour in this instance? My expectation would > be that when the management server is reset, the nodes keep running > (which they do) and once the management server is up the nodes should > reconnect so they can be managed once again (which they don't). I don't > imagine on a larger install you'd want to reboot every node whenever you > rebooted the management server. > > Is anyone else seeing this? > > Cheers, > Justin. > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel No, clearly, that is not what anyone wants. I have seen this as well, and I believe it is related to something in the qpid layer timing out (which I know that group has been working on, we have filed some bugs with them). Ian, is that what would cause this, or is there another reason? From sseago at redhat.com Thu Jun 25 14:47:44 2009 From: sseago at redhat.com (Scott Seago) Date: Thu, 25 Jun 2009 10:47:44 -0400 Subject: [Ovirt-devel] iscsi storage creation In-Reply-To: <4A4376FC.2060608@redfish-group.com> References: <4A4376FC.2060608@redfish-group.com> Message-ID: <4A438E10.2010302@redhat.com> Justin Clacherty wrote: > Hi, > > I have set up a 40GB iscsi target on my san and when I add it in to > the storage pool and it shows up as 40GB. When I try to create a 40GB > volume in the ovirt UI it tries to but fails. The error message is > that the volume will not fit. If I create one smaller than 40GB it > works. Is anyone else experiencing this? > > Also, if I then start a virtual machine up to install on the newly > created volume it sees both the smaller (39GB in this case) partition > and a 40GB partition (presumably the failed one). > > Cheers, > Justin. > Hi Justin, Ian may be able to provide a more complete answer, but there are a couple things that are probably going on with the 39GB vs. 40GB size. First of all, if you've got a 40GB iSCSI LUN and you want to create an oVirt storage volume under it, we're creating a Volume Group on the LUN and creating Logical Volumes as storage volumes via libvirt, so the size available for a single LVM volume on the lun will be slightly smaller due to the LVM overhead. The second issue is that while libvirt (and the oVirt DB) deal with storage sizes internally in KB, we're using GB in the UI at the moment and converting on the back end. This means for now you can only deal with an integral number of gigabytes. We need to do some re-thinking on how we handle storage and memory units -- in the above case you may have been able to create a 39.6GB volume (or some other value between 39 and 40 GB). If you really want to use the whole 40GB lun for a single VM you don't need to create an LVM volume -- just use the iscsi lun (shown in the UI as an iscsi storage volume). As for why you see both in your VM I haven't seen that, so I'm not sure what would cause that -- Ian do you have any ideas on this point? Scott From ktf000 at gmail.com Thu Jun 25 15:06:40 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Thu, 25 Jun 2009 17:06:40 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: <1245940955.7392.1.camel@localhost.localdomain> References: <1245940955.7392.1.camel@localhost.localdomain> Message-ID: > Did you install ovirt-node-image-pxe? yes > If so, what does your pxelinux/cfg/default file look like? $ cat /var/lib/tftpboot/pxelinux.cfg/default DEFAULT menu PROMPT 0 MENU TITLE Cobbler | http://cobbler.et.redhat.com TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT 0 LABEL sark4 kernel /images/ovirt4/vmlinuz0 MENU LABEL sark4 append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ipappend 2 MENU end On Thu, Jun 25, 2009 at 4:42 PM, Jason Guiditta wrote: > On Wed, 2009-06-24 at 21:55 +0200, Laurent Monnoye wrote: > > Hi there, > > > > I just installed oVirt and cobbler (I'm 100% novice!, so this could be > > a 100% silly question...). I can't get my initial host into the > > hardware pool. It PXE boots through cobbler, then fails with message > > "WARNING: Cannot find root file system!" and "Create symlink /dev/root > > and then exit this shell to continue the boot sequence." > > > > I suspect I didn't set up my ovirt-node correctly in cobbler. I used > > "/usr/share/ovirt-node-image/tftpboot/vmlinuz0" as the kernel and > > "/usr/share/ovirt-node-image/tftpboot/initrd0.img" as initrd. > > > > Can you please help me with this, I just ran out of ideas?.. > > > > Thanks a lot! > > L- > > _______________________________________________ > > Ovirt-devel mailing list > > Ovirt-devel at redhat.com > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > Did you install ovirt-node-image-pxe? If so, what does your > pxelinux/cfg/default file look like? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish-group.com Thu Jun 25 16:30:01 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Fri, 26 Jun 2009 02:30:01 +1000 Subject: [Ovirt-devel] iscsi storage creation In-Reply-To: <4A438E10.2010302@redhat.com> References: <4A4376FC.2060608@redfish-group.com> <4A438E10.2010302@redhat.com> Message-ID: <4A43A609.4080902@redfish-group.com> Scott Seago wrote: > Ian may be able to provide a more complete answer, but there are a > couple things that are probably going on with the 39GB vs. 40GB size. > First of all, if you've got a 40GB iSCSI LUN and you want to create an > oVirt storage volume under it, we're creating a Volume Group on the > LUN and creating Logical Volumes as storage volumes via libvirt, so > the size available for a single LVM volume on the lun will be slightly > smaller due to the LVM overhead. > > The second issue is that while libvirt (and the oVirt DB) deal with > storage sizes internally in KB, we're using GB in the UI at the moment > and converting on the back end. This means for now you can only deal > with an integral number of gigabytes. We need to do some re-thinking > on how we handle storage and memory units -- in the above case you may > have been able to create a 39.6GB volume (or some other value between > 39 and 40 GB). I figured it was something like that, I was just checking before I asked if gigabytes was the most appropriate value for the UI. Perhaps there should be a way to say "use the remaining free space". > If you really want to use the whole 40GB lun for a single VM you > don't need to create an LVM volume -- just use the iscsi lun (shown in > the UI as an iscsi storage volume). hmmm...when I tried this the first time it didn't work for me so I just assumed you had to create the LVM volume. I'll try it again without doing that. My plan was to create a LUN per VM because as I was unsure if multiple nodes could use the same LUN. My assumption was that the node mounted the iSCSI LUN and exported it as a disk to the VM. In the case of volumes under the LUN, the node would mount the LUN and export the volume as a disk to the VM. If you have two volumes on the LUN used for two different VMs it's conceivable they would be running on seperate nodes so two nodes would be mounting the same iSCSI LUN which is generally a bad thing. I guess it should be ok as each node is only writing to it's own volume on the LUN and not touching the partition table on the LUN itself. Hopefully that wasn't too confusing :) Am I justified in worrying about two nodes mounting the same LUN? Cheers, Justin. From imain at redhat.com Thu Jun 25 17:49:16 2009 From: imain at redhat.com (Ian Main) Date: Thu, 25 Jun 2009 10:49:16 -0700 Subject: [Ovirt-devel] node servers show as unavailable after reboot of management server In-Reply-To: <1245941134.7392.5.camel@localhost.localdomain> References: <4A4336DB.404@redfish-group.com> <1245941134.7392.5.camel@localhost.localdomain> Message-ID: <20090625104916.235b3114@tp.mains.net> On Thu, 25 Jun 2009 10:45:34 -0400 Jason Guiditta wrote: > On Thu, 2009-06-25 at 18:35 +1000, Justin Clacherty wrote: > > Hi, > > > > I had to reboot my management server today and when it comes back up the > > node machine has a status of "unavailable (enabled)". I saw this the > > last time I rebooted the management server and rebooting the node fixed > > the problem. > > > > What is the expected behaviour in this instance? My expectation would > > be that when the management server is reset, the nodes keep running > > (which they do) and once the management server is up the nodes should > > reconnect so they can be managed once again (which they don't). I don't > > imagine on a larger install you'd want to reboot every node whenever you > > rebooted the management server. > > > > Is anyone else seeing this? > > > > Cheers, > > Justin. > > > > _______________________________________________ > > Ovirt-devel mailing list > > Ovirt-devel at redhat.com > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > No, clearly, that is not what anyone wants. I have seen this as well, > and I believe it is related to something in the qpid layer timing out > (which I know that group has been working on, we have filed some bugs > with them). Ian, is that what would cause this, or is there another > reason? Sadly that's the issue. Hopefully it will be resolved soon. Ian From imain at redhat.com Thu Jun 25 17:50:35 2009 From: imain at redhat.com (Ian Main) Date: Thu, 25 Jun 2009 10:50:35 -0700 Subject: [Ovirt-devel] error with gssapi In-Reply-To: <4A4349C8.2000101@gmail.com> References: <4A4349C8.2000101@gmail.com> Message-ID: <20090625105035.23411f41@tp.mains.net> On Thu, 25 Jun 2009 13:56:24 +0400 dima vasiletc wrote: > Hello > I found on ovirt.org instruction for set unavailable(enable) to > available(enable) > i run "ruby /usr/share/ovirt-server/qmf-libvirt-example.rb" > and get > > Error caching credentials; attempting to continue... > Connecting to amqp://main.forex-24h.com:5672.. > /usr/lib/ruby/site_ruby/1.8/qpid/delegates.rb:209:in > `connection_start'/usr/lib/ruby/site_ruby/1.8/qpid/delegates.rb:209: > [BUG] Segmentation fault > ruby 1.8.6 (2008-08-11) [x86_64-linux] qmf-libvirt-example has to access the ovirt qpid kerberos ticket in order to connect to qpidd. In order to that it has to be run as root. If everything else is working (looks like it is) then that should fix it. Ian From jboggs at redhat.com Thu Jun 25 18:03:36 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Jun 2009 14:03:36 -0400 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: <1245940955.7392.1.camel@localhost.localdomain> Message-ID: <4A43BBF8.7010402@redhat.com> On 06/25/2009 11:06 AM, Laurent Monnoye wrote: > LABEL sark4 > kernel /images/ovirt4/vmlinuz0 > MENU LABEL sark4 > append initrd=/images/ovirt4/initrd0.img ksdevice=bootif > lang= kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 > ipappend 2 Looks like you're missing a few options on the append line, add them in like: ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso LABEL sark4 kernel /images/ovirt4/vmlinuz0 MENU LABEL sark4 append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso ipappend 2 From imain at redhat.com Thu Jun 25 18:21:16 2009 From: imain at redhat.com (Ian Main) Date: Thu, 25 Jun 2009 11:21:16 -0700 Subject: [Ovirt-devel] iscsi storage creation In-Reply-To: <4A4376FC.2060608@redfish-group.com> References: <4A4376FC.2060608@redfish-group.com> Message-ID: <20090625112116.52712eb8@tp.mains.net> On Thu, 25 Jun 2009 23:09:16 +1000 Justin Clacherty wrote: > Hi, > > I have set up a 40GB iscsi target on my san and when I add it in to the > storage pool and it shows up as 40GB. When I try to create a 40GB > volume in the ovirt UI it tries to but fails. The error message is that > the volume will not fit. If I create one smaller than 40GB it works. > Is anyone else experiencing this? > > Also, if I then start a virtual machine up to install on the newly > created volume it sees both the smaller (39GB in this case) partition > and a 40GB partition (presumably the failed one). I forget now if that's normal :). I really need to set up iscsi again and play with it. I'm also wondering if you are seeing this: https://bugzilla.redhat.com/show_bug.cgi?id=507015 Are you running 'next', or a release? Ian From ktf000 at gmail.com Thu Jun 25 19:00:54 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Thu, 25 Jun 2009 21:00:54 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: <4A43BBF8.7010402@redhat.com> References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> Message-ID: > Looks like you're missing a few options on the append line, add them in like: > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso I just added these parameters but with no success, same problem (I see them on the console, so they are indeed being picked up). On the server, where should ovirt-node-image.iso be located? Maybe that's my problem. Where are those parameters documented as part of the oVirt installation guide? Did I miss them in the doc? Thanks a lot for your help, much appreciated!!! L- On Thu, Jun 25, 2009 at 8:03 PM, Joey Boggs wrote: > On 06/25/2009 11:06 AM, Laurent Monnoye wrote: > >> LABEL sark4 >> kernel /images/ovirt4/vmlinuz0 >> MENU LABEL sark4 >> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 >> ipappend 2 >> > > Looks like you're missing a few options on the append line, add them in > like: > > > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > > > LABEL sark4 > kernel /images/ovirt4/vmlinuz0 > MENU LABEL sark4 > append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= > kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro > rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > ipappend 2 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktf000 at gmail.com Thu Jun 25 19:22:26 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Thu, 25 Jun 2009 21:22:26 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> Message-ID: In case of it helps, I've taken a screenshot of the console output (attached), but it only shows the last part. On Thu, Jun 25, 2009 at 9:00 PM, Laurent Monnoye wrote: > > Looks like you're missing a few options on the append line, add them in > like: > > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > > I just added these parameters but with no success, same problem (I see them > on the console, so they are indeed being picked up). > > On the server, where should ovirt-node-image.iso be located? Maybe that's > my problem. > > Where are those parameters documented as part of the oVirt installation > guide? Did I miss them in the doc? > > Thanks a lot for your help, much appreciated!!! > > L- > > > On Thu, Jun 25, 2009 at 8:03 PM, Joey Boggs wrote: > >> On 06/25/2009 11:06 AM, Laurent Monnoye wrote: >> >>> LABEL sark4 >>> kernel /images/ovirt4/vmlinuz0 >>> MENU LABEL sark4 >>> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >>> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 >>> ipappend 2 >>> >> >> Looks like you're missing a few options on the append line, add them in >> like: >> >> >> ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >> >> >> LABEL sark4 >> kernel /images/ovirt4/vmlinuz0 >> MENU LABEL sark4 >> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro >> rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >> ipappend 2 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: console_output.jpg Type: image/jpeg Size: 88789 bytes Desc: not available URL: From jboggs at redhat.com Thu Jun 25 19:25:42 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Jun 2009 15:25:42 -0400 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> Message-ID: <4A43CF36.6060302@redhat.com> On 06/25/2009 03:00 PM, Laurent Monnoye wrote: > > Looks like you're missing a few options on the append line, add them > in like: > > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > > I just added these parameters but with no success, same problem (I see > them on the console, so they are indeed being picked up). > > On the server, where should ovirt-node-image.iso be located? Maybe > that's my problem. > > Where are those parameters documented as part of the oVirt > installation guide? Did I miss them in the doc? > > Thanks a lot for your help, much appreciated!!! > > L- > > On Thu, Jun 25, 2009 at 8:03 PM, Joey Boggs > wrote: > > On 06/25/2009 11:06 AM, Laurent Monnoye wrote: > > LABEL sark4 > kernel /images/ovirt4/vmlinuz0 > MENU LABEL sark4 > append initrd=/images/ovirt4/initrd0.img > ksdevice=bootif lang= kssendmac text > ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 > ipappend 2 > > > Looks like you're missing a few options on the append line, add > them in like: > > > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > > > > LABEL sark4 > kernel /images/ovirt4/vmlinuz0 > MENU LABEL sark4 > append initrd=/images/ovirt4/initrd0.img ksdevice=bootif > lang= kssendmac text > ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro > rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > ipappend 2 > > ovirt-node-image.iso should be under /usr/share/ovirt-node-image but in the pxe case it's actually embedded in the initrd0.img file. Im guessing some things are out of sync, I'd try running the cobbler-import command which should setup a cobbler profile for you named oVirt-Node-Image-$arch if that command fails capture the output for us. If it succeeds verify if there are any files under /usr/share/ovirt-node-image/tftpboot -------------- next part -------------- An HTML attachment was scrubbed... URL: From jboggs at redhat.com Thu Jun 25 19:26:33 2009 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Jun 2009 15:26:33 -0400 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> Message-ID: <4A43CF69.8070203@redhat.com> Are you building from the next branch or a released version? On 06/25/2009 03:22 PM, Laurent Monnoye wrote: > In case of it helps, I've taken a screenshot of the console output > (attached), but it only shows the last part. > > On Thu, Jun 25, 2009 at 9:00 PM, Laurent Monnoye > wrote: > > > Looks like you're missing a few options on the append line, add > them in like: > > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > > I just added these parameters but with no success, same problem (I > see them on the console, so they are indeed being picked up). > > On the server, where should ovirt-node-image.iso be located? Maybe > that's my problem. > > Where are those parameters documented as part of the oVirt > installation guide? Did I miss them in the doc? > > Thanks a lot for your help, much appreciated!!! > > L- > > > On Thu, Jun 25, 2009 at 8:03 PM, Joey Boggs > wrote: > > On 06/25/2009 11:06 AM, Laurent Monnoye wrote: > > LABEL sark4 > kernel /images/ovirt4/vmlinuz0 > MENU LABEL sark4 > append initrd=/images/ovirt4/initrd0.img > ksdevice=bootif lang= kssendmac text > ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 > ipappend 2 > > > Looks like you're missing a few options on the append line, > add them in like: > > > ro rootflags=loop text rootfstype=iso9660 > root=/ovirt-node-image.iso > > > > LABEL sark4 > kernel /images/ovirt4/vmlinuz0 > MENU LABEL sark4 > append initrd=/images/ovirt4/initrd0.img > ksdevice=bootif lang= kssendmac text > ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro > rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > ipappend 2 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktf000 at gmail.com Thu Jun 25 19:56:46 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Thu, 25 Jun 2009 21:56:46 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: <4A43CF36.6060302@redhat.com> References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> <4A43CF36.6060302@redhat.com> Message-ID: cobbler-import output: # cobbler-import + set -e + for dir in '$ksdir/*' + ova=/var/www/cobbler/ks_mirror/brol/.treeinfo.ova + '[' '!' -f /var/www/cobbler/ks_mirror/brol/.treeinfo.ova ']' + echo 'Skipping /var/www/cobbler/ks_mirror/brol, no /var/www/cobbler/ks_mirror/brol/.treeinfo.ova file present' Skipping /var/www/cobbler/ks_mirror/brol, no /var/www/cobbler/ks_mirror/brol/.treeinfo.ova file present + continue + for dir in '$ksdir/*' + ova=/var/www/cobbler/ks_mirror/config/.treeinfo.ova + '[' '!' -f /var/www/cobbler/ks_mirror/config/.treeinfo.ova ']' + echo 'Skipping /var/www/cobbler/ks_mirror/config, no /var/www/cobbler/ks_mirror/config/.treeinfo.ova file present' Skipping /var/www/cobbler/ks_mirror/config, no /var/www/cobbler/ks_mirror/config/.treeinfo.ova file present + continue + for dir in '$ksdir/*' + ova=/var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova + '[' '!' -f /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova ']' + echo 'Skipping /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD, no /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova file present' Skipping /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD, no /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova file present + continue + for dir in '$ksdir/*' + ova=/var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova + '[' '!' -f /var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova ']' + echo 'Skipping /var/www/cobbler/ks_mirror/ovirt-node, no /var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova file present' Skipping /var/www/cobbler/ks_mirror/ovirt-node, no /var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova file present + continue ++ rpm -q --qf '%{arch}' ovirt-node-image + node_arch=x86_64 + node_dir=/usr/share/ovirt-node-image + cobbler distro add --name=oVirt-Node-x86_64 --arch=x86_64 --initrd=/usr/share/ovirt-node-image/tftpboot/initrd0.img --kernel=/usr/share/ovirt-node-image/tftpboot/vmlinuz0 '--kopts=rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8' + cobbler profile add --name=oVirt-Node-x86_64 --distro=oVirt-Node-x86_64 + cobbler system add --netboot-enabled=1 --profile=oVirt-Node-x86_64 --name=node3 --mac=00:16:3e:12:34:57 + cobbler system add --netboot-enabled=1 --profile=oVirt-Node-x86_64 --name=node4 --mac=00:16:3e:12:34:58 '--kopts=ovirt_init=scsi ovirt_local_boot' + cobbler system add --netboot-enabled=1 --profile=oVirt-Node-x86_64 --name=node5 --mac=00:16:3e:12:34:59 --kopts=ovirt_init=scsi + sed -i -e '/kernel /a \\tIPAPPEND 2' /etc/cobbler/pxe/pxesystem.template + sed -i -e 's/^ONTIMEOUT.*/ONTIMEOUT oVirt-Node-x86_64/' /etc/cobbler/pxe/pxedefault.template + service cobblerd restart Stopping cobbler daemon: [ OK ] Starting cobbler daemon: [ OK ] + cobbler sync Here's what I have under /usr/share/ovirt-node-image: # ls -l /usr/share/ovirt-node-image total 68388 drwxr-xr-x 2 root root 4096 2009-06-24 11:56 manifests -rw-r--r-- 1 root root 69947392 2009-06-05 14:44 ovirt-node-image.iso drwxr-xr-x 3 root root 4096 2009-06-25 12:43 tftpboot # ls -l /usr/share/ovirt-node-image/tftpboot total 7052 -rw-r--r-- 9 root root 4537334 2009-06-25 08:46 initrd0.img -rw-r--r-- 1 root root 14716 2009-06-24 11:56 pxelinux.0 drwxr-xr-x 2 root root 4096 2009-06-25 12:13 pxelinux.cfg -r--r--r-- 9 root root 2644128 2009-06-25 08:46 vmlinuz0 I've tried to boot that new profile "oVirt-Node-x86_64". This time I don't get the error message anymore. The system just hangs at the end (see console output attached). Is that expected? > Are you building from the next branch or a released version? standard 0.96. I just installed everything with yum. > ovirt-node-image.iso should be under /usr/share/ovirt-node-image but in the pxe case it's actually embedded in the initrd0.img file How come initrd0.img is so much smaller than the iso, then? On Thu, Jun 25, 2009 at 9:25 PM, Joey Boggs wrote: > On 06/25/2009 03:00 PM, Laurent Monnoye wrote: > > > Looks like you're missing a few options on the append line, add them in > like: > > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso > > I just added these parameters but with no success, same problem (I see them > on the console, so they are indeed being picked up). > > On the server, where should ovirt-node-image.iso be located? Maybe that's > my problem. > > Where are those parameters documented as part of the oVirt installation > guide? Did I miss them in the doc? > > Thanks a lot for your help, much appreciated!!! > > L- > > On Thu, Jun 25, 2009 at 8:03 PM, Joey Boggs wrote: > >> On 06/25/2009 11:06 AM, Laurent Monnoye wrote: >> >>> LABEL sark4 >>> kernel /images/ovirt4/vmlinuz0 >>> MENU LABEL sark4 >>> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >>> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 >>> ipappend 2 >>> >> >> Looks like you're missing a few options on the append line, add them in >> like: >> >> >> ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >> >> >> LABEL sark4 >> kernel /images/ovirt4/vmlinuz0 >> MENU LABEL sark4 >> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro >> rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >> ipappend 2 >> > > > ovirt-node-image.iso should be under /usr/share/ovirt-node-image but in the > pxe case it's actually embedded in the initrd0.img file. Im guessing some > things are out of sync, I'd try running the cobbler-import command which > should setup a cobbler profile for you named oVirt-Node-Image-$arch if that > command fails capture the output for us. If it succeeds verify if there are > any files under /usr/share/ovirt-node-image/tftpboot > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: console_output2.jpg Type: image/jpeg Size: 103753 bytes Desc: not available URL: From dpierce at redhat.com Thu Jun 25 19:57:12 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Jun 2009 15:57:12 -0400 Subject: [Ovirt-devel] [PATCH node] Rerunning network config resets all network config. bz#507393 Message-ID: <1245959832-11462-1-git-send-email-dpierce@redhat.com> When the user runs o-c-networking then it ensures that all features of networking that we configure are reset and only those settings touched are applied. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 46 +++++++++++++++++++++++++------------- 1 files changed, 30 insertions(+), 16 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index d29bd12..81f017c 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -16,8 +16,10 @@ WORKDIR=$(mktemp -d) || exit 1 trap '__st=$?; rm -rf "$WORKDIR"; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 -CONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" +IFCONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" +NTPCONF_FILE_ROOT="/files/etc/ntp" NTP_CONFIG_FILE="/etc/ntp.conf" +NTPSERVERS="" CONFIGURED_NIC="" # if local storage is not configured, then exit the script @@ -55,10 +57,10 @@ function configure_interface printf "\nConfigure $BRIDGE for use by $NIC..\n\n" - local IF_ROOT="$CONFIG_FILE_ROOT-$NIC" + local IF_ROOT="$IFCONFIG_FILE_ROOT-$NIC" local IF_CONFIG="rm $IF_ROOT\nset $IF_ROOT/DEVICE $NIC" - local BR_ROOT="$CONFIG_FILE_ROOT-$BRIDGE" + local BR_ROOT="$IFCONFIG_FILE_ROOT-$BRIDGE" local BR_CONFIG="rm $BR_ROOT\nset $BR_ROOT/DEVICE $BRIDGE" BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/TYPE Bridge" BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/PEERNTP yes" @@ -202,7 +204,7 @@ function configure_dns fi local IF_FILENAME="$WORKDIR/augtool-br${CONFIGURED_NIC}" - local IF_ROOT="$CONFIG_FILE_ROOT-br${CONFIGURED_NIC}" + local IF_ROOT="$IFCONFIG_FILE_ROOT-br${CONFIGURED_NIC}" local IF_CONFIG= if [ -z "$AUTO" ]; then @@ -241,12 +243,11 @@ function configure_dns function configure_ntp { - local NTP=$1 local AUTO=$2 if [[ "$AUTO" == "AUTO" && -n "$OVIRT_NTP" ]]; then - NTP=$OVIRT_NTP + NTPSERVERS=$OVIRT_NTP else - NTP="" + NTPSERVERS="" fi if [ -z "$AUTO" ]; then @@ -255,18 +256,29 @@ function configure_ntp if [ -z "$REPLY" ]; then break; fi - NTP="$NTP $REPLY" + NTPSERVERS="$NTPSERVERS $REPLY" done fi +} - if [ -n "$NTP" ]; then - # strip out all current servers from /etc/npt.conf and insert our own - BACKUP="${WORKDIR}/ntp.conf-backup" - egrep -v '^server .* # added by ovirt-config-network' < $NTP_CONFIG_FILE > $BACKUP - for server in $NTP; do - echo "server $server # added by ovirt-config-network" >> $BACKUP +function save_ntp_configuration +{ + local ntpconf="$WORKDIR/augtool-ntp" + local ntproot="/files/etc/ntp.conf" + + printf "\ +rm ${ntproot}\n\n +set ${ntproot}/driftfile /var/lib/ntp/drift\n\ +set ${ntproot}/includefile /etc/ntp/crypto/pw\n\ +set ${ntproot}/keys /etc/ntp/keys\n\ +save\n" > $ntpconf + + if [ -n "$NTPSERVERS" ]; then + offset=1 + for server in $NTPSERVERS; do + printf "set /files/etc/ntp.conf/server[${offset}] ${server}\n" >> $ntpconf + offset=$(echo "$offset+1" | bc) done - cp -f $BACKUP $NTP_CONFIG_FILE fi } @@ -317,7 +329,9 @@ else "$DNS") configure_dns "$OVIRT_DNS"; break ;; "$NTP") configure_ntp "$OVIRT_NTP"; break ;; "$Abort") rm -f "${WORKDIR}"/augtool-*; exit 99;; - "$Save") break 2;; + "$Save") + save_ntp_configuration + break 2;; *) if [[ -n "${NIC}" ]] && [[ "${NICS}" =~ "${NIC}" ]]; then configure_interface $NIC $IFACE_NUMBER -- 1.6.0.6 From imain at redhat.com Thu Jun 25 20:46:35 2009 From: imain at redhat.com (Ian Main) Date: Thu, 25 Jun 2009 13:46:35 -0700 Subject: [Ovirt-devel] [PATCH] Fix dbomatic state changes. Message-ID: <1245962795-32501-1-git-send-email-imain@redhat.com> This patch fixes state changes in dbomatic so that there is no intermediate 'stopped' state after being unreachable or on startup of dbomatic etc. Also fixes a number of smaller bugs around host associations, state changes, etc. Signed-off-by: Ian Main --- src/db-omatic/db_omatic.rb | 85 +++++++++++++++++++++++++++++++------------- 1 files changed, 60 insertions(+), 25 deletions(-) diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb index b3d5e73..1091333 100755 --- a/src/db-omatic/db_omatic.rb +++ b/src/db-omatic/db_omatic.rb @@ -113,6 +113,15 @@ class DbOmatic < Qpid::Qmf::Console end end + def set_vm_stopped(db_vm) + db_vm.host_id = nil + db_vm.memory_used = nil + db_vm.num_vcpus_used = nil + db_vm.needs_restart = nil + db_vm.vnc_port = nil + db_vm.state = Vm::STATE_STOPPED + end + def update_domain_state(domain, state_override = nil) vm = Vm.find(:first, :conditions => [ "uuid = ?", domain['uuid'] ]) if vm == nil @@ -190,12 +199,7 @@ class DbOmatic < Qpid::Qmf::Console result = qmf_vm.undefine if result.status == 0 @logger.info "Delete of VM #{vm.description} successful, syncing DB." - vm.host_id = nil - vm.memory_used = nil - vm.num_vcpus_used = nil - vm.state = Vm::STATE_STOPPED - vm.needs_restart = nil - vm.vnc_port = nil + set_vm_stopped(vm) end end end @@ -223,20 +227,37 @@ class DbOmatic < Qpid::Qmf::Console host_info[:synced] = true if state == Host::STATE_AVAILABLE - # At this point we want to set all domains that are - # unreachable to stopped. If a domain is indeed running - # then dbomatic will see that and set it either before - # or after. If the node was rebooted, the VMs will all - # be gone and dbomatic won't see them so we need to set - # them to stopped. - db_vm = Vm.find(:all, :conditions => ["host_id = ? AND state = ?", db_host.id, Vm::STATE_UNREACHABLE]) - db_vm.each do |vm| - @logger.info "Moving vm #{vm.description} in state #{vm.state} to state stopped." - vm.state = Vm::STATE_STOPPED - vm.save! + Thread.new do + @logger.info "#{host_info['hostname']} has moved to available, sleeping for updates to vms." + sleep(20) + + # At this point we want to set all domains that are + # unreachable to stopped. We're using a thread here to + # sleep for 10 seconds outside of the main dbomatic loop. + # If after 10 seconds with this host up there are still + # domains set to 'unreachable', then we're going to guess + # the node rebooted and so the domains should be set to + # stopped. + @logger.info "Checking for dead VMs on newly available host #{host_info['hostname']}." + + # Double check to make sure this host is still up. + begin + qmf_host = @session.object(:class => 'node', 'hostname' => host_info['hostname']) + if !qmf_host + @logger.info "Host #{host_info['hostname']} is not up after waiting 20 seconds, skipping dead VM check." + else + db_vm = Vm.find(:all, :conditions => ["host_id = ? AND state = ?", db_host.id, Vm::STATE_UNREACHABLE]) + db_vm.each do |vm| + @logger.info "Moving vm #{vm.description} in state #{vm.state} to state stopped." + set_vm_stopped(vm) + vm.save! + end + end + rescue Exception => e # just log any errors here + @logger.info "Exception checking for dead VMs (could be normal): #{e.message}" + end end end - else # FIXME: This would be a newly registered host. We could put it in the database. @logger.info "Unknown host #{host_info['hostname']}, probably not registered yet??" @@ -344,6 +365,7 @@ class DbOmatic < Qpid::Qmf::Console end def heartbeat(agent, timestamp) + puts "heartbeat from agent #{agent}" return if agent == nil synchronize do bank_key = "#{agent.agent_bank}.#{agent.broker.broker_bank}" @@ -376,6 +398,8 @@ class DbOmatic < Qpid::Qmf::Console values[:timed_out] = true end end + bank_key = "#{agent.agent_bank}.#{agent.broker.broker_bank}" + @heartbeats.delete(bank_key) end # The opposite of above, this is called when an agent is alive and well and makes sure @@ -415,11 +439,21 @@ class DbOmatic < Qpid::Qmf::Console @logger.error "Error with closing all VM VNCs operation: #{e.message}" end - db_vm = Vm.find(:all) - db_vm.each do |vm| - @logger.info "Marking vm #{vm.description} as stopped." - vm.state = Vm::STATE_STOPPED - vm.save! + Thread.new do + sleep(20) + + # At this point we want to set all domains that are + # unreachable to stopped. We're using a thread here to + # sleep for 20 seconds outside of the main dbomatic loop. + # After 20 seconds all domains should be synced and so + # anything that's still unreachable is marked as stopped because we + # haven't seen any instances of it. + db_vm = Vm.find(:all, :conditions => ["state = ?", Vm::STATE_UNREACHABLE]) + db_vm.each do |vm| + @logger.info "After startup delay, VM #{vm.description} is still unreachable, setting to stopped." + set_vm_stopped(vm) + vm.save! + end end end @@ -444,6 +478,7 @@ class DbOmatic < Qpid::Qmf::Console # Get seconds from the epoch t = Time.new.to_i + puts "going through heartbeats.." @heartbeats.keys.each do | key | agent, timestamp = @heartbeats[key] @@ -451,11 +486,11 @@ class DbOmatic < Qpid::Qmf::Console s = timestamp / 1000000000 delta = t - s + puts "Checking time delta for agent #{agent} - #{delta}" + if delta > 30 # No heartbeat for 30 seconds.. deal with dead/disconnected agent. agent_disconnected(agent) - - @heartbeats.delete(key) else agent_connected(agent) end -- 1.6.0.6 From dpierce at redhat.com Thu Jun 25 20:47:35 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Jun 2009 16:47:35 -0400 Subject: [Ovirt-devel] [PATCH node] Fixes when a removable media is removed. bz#507455 Message-ID: <1245962855-26953-1-git-send-email-dpierce@redhat.com> If a device is a removeable media device, then o-c-storage will now check if there's media present before attempting to get the storage size for the device. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-storage | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 0fcc0bc..41177a4 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -62,7 +62,10 @@ get_drive_size() size=$(hal-get-property --udi "$udi" --key storage.size) if [[ "${size}" == "0" ]]; then # disk is probably hot-swappable, use different HAL key - size=$(hal-get-property --udi "$udi" --key storage.removable.media_size) + # but first check that it is removeable media and that media is present + if [[ "true" == "$(hal-get-property --udi "$udi" --key storage.removable.media_available)" ]]; then + size=$(hal-get-property --udi "$udi" --key storage.removable.media_size) + fi fi fi -- 1.6.0.6 From imain at redhat.com Thu Jun 25 20:53:14 2009 From: imain at redhat.com (Ian Main) Date: Thu, 25 Jun 2009 13:53:14 -0700 Subject: [Ovirt-devel] [PATCH] Extend timeouts on libvirt calls. Message-ID: <1245963194-32603-1-git-send-email-imain@redhat.com> This patch increases the timeout value on taskomatic calls so that we get back the real libvirt errors instead of just having qmf timeout. Signed-off-by: Ian Main --- src/task-omatic/task_storage.rb | 6 +++--- src/task-omatic/taskomatic.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/task-omatic/task_storage.rb b/src/task-omatic/task_storage.rb index 77363ac..8165818 100644 --- a/src/task-omatic/task_storage.rb +++ b/src/task-omatic/task_storage.rb @@ -132,7 +132,7 @@ class LibvirtPool if @remote_pool == nil @logger.debug("Defining new storage pool: #{@xml.to_s} on host: #{node.hostname}") - result = node.storagePoolDefineXML(@xml.to_s, :timeout => 60 * 2) + result = node.storagePoolDefineXML(@xml.to_s, :timeout => 60 * 10) raise "Error creating pool: #{result.text}" unless result.status == 0 @remote_pool = session.object(:object_id => result.pool) raise "Error finding newly created remote pool." unless @remote_pool @@ -141,7 +141,7 @@ class LibvirtPool # destroy existing data if @build_on_start @logger.debug("Building remote pool #{@remote_pool.name}") - result = @remote_pool.build(:timeout => 60 * 2) + result = @remote_pool.build(:timeout => 60 * 10) raise "Error building pool: #{result.text}" unless result.status == 0 end @remote_pool_defined = true @@ -155,7 +155,7 @@ class LibvirtPool if @remote_pool.state == "inactive" # only try to start the pool if it is currently inactive; in all other # states, assume it is already running - result = @remote_pool.create(:timeout => 60 * 2) + result = @remote_pool.create(:timeout => 60 * 10) raise "Error defining pool: #{result.text}" unless result.status == 0 # Refresh qpid object with new properties. diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 6e21160..b3c0592 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -258,14 +258,14 @@ class TaskOmatic # libvirt-qpid sets parentVolume to the name of the parent volume # if this is an LVM pool, else it leaves it empty. if pool.parentVolume != '' - result = pool.destroy - result = pool.undefine + result = pool.destroy(:timeout => 60 * 2) + result = pool.undefine(:timeout => 60 * 2) end end pools.each do |pool| - result = pool.destroy - result = pool.undefine + result = pool.destroy(:timeout => 60 * 2) + result = pool.undefine(:timeout => 60 * 2) end end @@ -534,7 +534,7 @@ class TaskOmatic dest_uri = "qemu+tcp://" + dest_node.hostname + "/system" @logger.debug("Migrating from #{src_uri} to #{dest_uri}") - result = vm.migrate(dest_uri, Libvirt::Domain::MIGRATE_LIVE, '', '', 0, :timeout => 60 * 4) + result = vm.migrate(dest_uri, Libvirt::Domain::MIGRATE_LIVE, '', '', 0, :timeout => 60 * 10) @logger.error "Error migrating VM: #{result.text}" unless result.status == 0 # undefine can fail, for instance, if we live migrated from A -> B, and -- 1.6.0.6 From apevec at redhat.com Thu Jun 25 21:31:53 2009 From: apevec at redhat.com (Alan Pevec) Date: Thu, 25 Jun 2009 23:31:53 +0200 Subject: [Ovirt-devel] Re: [PATCH node] Only allow initial networking to be configured. bz#507393 In-Reply-To: <4A40F4EB.9070601@redhat.com> References: <1245695029-23238-1-git-send-email-dpierce@redhat.com> <2be7262f0906230710m5a24f1e8j95749e19acde88a8@mail.gmail.com> <4A40F4EB.9070601@redhat.com> Message-ID: <4A43ECC9.30503@redhat.com> Perry Myers wrote: > On 06/23/2009 10:10 AM, Alan Pevec wrote: >> NAK, it should still be possible to reconfigure networking, but only from >> scratch - i.e. must start by selecting NIC and then DNS, NTP, earsing the >> old configuration. >> The actual bug is that configure_ntp modifies ntp.conf directly, it >> should >> be applied only when confirmed, as for the other configs. > > We should also allow the user to reenter this menu with an already set > up nic and just edit DNS/NTP settings w/o having to re setup the NIC. it must always be from scratch b/c of possible side-effects how NIC is setup: e.g. DNS/NTP is overwritten if DHCP is selected (if, like in most cases, DHCP server is configured to send those settings) From apevec at redhat.com Thu Jun 25 21:49:29 2009 From: apevec at redhat.com (Alan Pevec) Date: Thu, 25 Jun 2009 23:49:29 +0200 Subject: [Ovirt-devel] [PATCH node] kdump support Message-ID: <1245966569-11764-1-git-send-email-apevec@redhat.com> - when /data is created, configure kdump to use /data/core/ - prepare a symlink to the kernel image, so that kdump initscript can find it Signed-off-by: Alan Pevec --- scripts/ovirt-early | 13 +++++++++++++ scripts/ovirt-functions | 8 ++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index ac54e4b..1732f9c 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -395,6 +395,19 @@ start() { start_log fi + # link to the kernel image for kdump + mount_live + if [ -e /live/*linux/vmlinuz0 ]; then + ln -s /live/*linux/vmlinuz0 /boot-kdump/vmlinuz-$(uname -r) + else + mount_boot + if [ -e /boot/vmlinuz0 ]; then + ln -s /boot/vmlinuz0 /boot-kdump/vmlinuz-$(uname -r) + else + log "Cannot find kernel for kdump" + fi + fi + if [ "$standalone" = 1 ]; then # In standalone mode, fix libvirt to not use gssapi sed -c -i -e s/^keytab/#keytab/ \ diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index e938256..e6218cc 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -394,6 +394,14 @@ mount_data() { mount /var/log/core restorecon -rv /var/log/core + # configure kdump + cat > /etc/kdump.conf <<\EOF +ext3 /dev/HostVG/Data +path /core +EOF + ovirt_store_config /etc/kdump.conf + service kdump restart + return 0 else # /data is not available -- 1.6.0.6 From apevec at redhat.com Thu Jun 25 21:50:57 2009 From: apevec at redhat.com (Alan Pevec) Date: Thu, 25 Jun 2009 23:50:57 +0200 Subject: [Ovirt-devel] [PATCH node-image] kdump support Message-ID: <1245966657-11800-1-git-send-email-apevec@redhat.com> Requires "kdump support" patch for ovirt-node Signed-off-by: Alan Pevec --- common-blacklist.ks | 2 +- common-pkgs.ks | 2 ++ ovirt-node-image.ks | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common-blacklist.ks b/common-blacklist.ks index 2452237..af7fa07 100644 --- a/common-blacklist.ks +++ b/common-blacklist.ks @@ -10,7 +10,7 @@ echo "Removing excess RPMs" RPMS="system-config-firewall-tui system-config-network-tui rhpl \ rpm-python dbus-python kudzu newt-python newt libsemanage-python" -RPMS="$RPMS kpartx mkinitrd isomd5sum dmraid checkpolicy" +RPMS="$RPMS mkinitrd isomd5sum dmraid checkpolicy" # Remove additional RPMs forcefully RPMS="$RPMS gamin pm-utils kbd usermode vbetool ConsoleKit hdparm \ diff --git a/common-pkgs.ks b/common-pkgs.ks index cc507cf..f53131f 100644 --- a/common-pkgs.ks +++ b/common-pkgs.ks @@ -68,3 +68,5 @@ isomd5sum irqbalance cpuspeed acpid +# kdump +kexec-tools diff --git a/ovirt-node-image.ks b/ovirt-node-image.ks index 802b6a5..894de79 100644 --- a/ovirt-node-image.ks +++ b/ovirt-node-image.ks @@ -30,6 +30,14 @@ mkdir -p /config mkdir -p /data mkdir -p /liveos echo "/dev/HostVG/Config /config ext3 defaults,noauto 0 0" >> /etc/fstab + +# kdump configuration +augtool <<\EOF +set /files/etc/sysconfig/kdump/KDUMP_BOOTDIR /boot-kdump +save +EOF +mkdir -p /boot-kdump + %end %post @@ -63,7 +71,7 @@ sed -i -e 's/ quiet//' $LIVE_ROOT/isolinux/isolinux.cfg awk ' BEGIN { # append additional default boot parameters - add_boot_params="check" + add_boot_params="check crashkernel=128M at 16M" } /^label linux0/ { linux0=1 } linux0==1 && $1=="append" { -- 1.6.0.6 From justin at redfish-group.com Thu Jun 25 22:07:50 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Fri, 26 Jun 2009 08:07:50 +1000 Subject: [Ovirt-devel] iscsi storage creation In-Reply-To: <20090625112116.52712eb8@tp.mains.net> References: <4A4376FC.2060608@redfish-group.com> <20090625112116.52712eb8@tp.mains.net> Message-ID: <4A43F536.4090006@redfish-group.com> Ian Main wrote: > > I forget now if that's normal :). I really need to set up iscsi again > and play with it. I'm also wondering if you are seeing this: > > https://bugzilla.redhat.com/show_bug.cgi?id=507015 > I don't believe so no. > Are you running 'next', or a release? > I'm running a release: ovirt-docs.noarch 0.99-1.fc10 installed ovirt-node-image.x86_64 1.0.1-1.fc10 installed ovirt-node-image-pxe.x86_64 1.0.1-1.fc10 installed ovirt-release.noarch 0.99-1.fc10 installed ovirt-server.noarch 0.99-1.fc10 installed ovirt-server-installer.noarch 0.99-1.fc10 installed Also, I'm seeing other strangeness :) In trying to get this all working I've created and deleted several LUNs. Storage devices and volumes which no longer appear (or in some cases even exist on the san) are still showing up in the task output. It looks as though it's trying to delete volumes that no longer exist. Looking in the database I see entries for non-existent volumes in storage_volumes. Some are maked as pending delete. Justin. From apevec at gmail.com Thu Jun 25 23:14:04 2009 From: apevec at gmail.com (Alan Pevec) Date: Fri, 26 Jun 2009 01:14:04 +0200 Subject: [Ovirt-devel] [PATCH node] Fixes when a removable media is removed. bz#507455 In-Reply-To: <1245962855-26953-1-git-send-email-dpierce@redhat.com> References: <1245962855-26953-1-git-send-email-dpierce@redhat.com> Message-ID: <2be7262f0906251614s2cf5c85bg74531a3b92efcf22@mail.gmail.com> ACK -------------- next part -------------- An HTML attachment was scrubbed... URL: From dpierce at redhat.com Fri Jun 26 00:12:44 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Jun 2009 20:12:44 -0400 Subject: [Ovirt-devel] [PATCH node] Fixes when a removable media is removed. bz#507455 In-Reply-To: <2be7262f0906251614s2cf5c85bg74531a3b92efcf22@mail.gmail.com> References: <1245962855-26953-1-git-send-email-dpierce@redhat.com> <2be7262f0906251614s2cf5c85bg74531a3b92efcf22@mail.gmail.com> Message-ID: <20090626001244.GA6712@mcpierce-laptop.mcpierce.org> On Fri, Jun 26, 2009 at 01:14:04AM +0200, Alan Pevec wrote: > ACK Pushed. Thanks. -- 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 pronix.service at gmail.com Fri Jun 26 08:10:31 2009 From: pronix.service at gmail.com (dima vasiletc) Date: Fri, 26 Jun 2009 12:10:31 +0400 Subject: [Ovirt-devel] error with gssapi In-Reply-To: <20090625105035.23411f41@tp.mains.net> References: <4A4349C8.2000101@gmail.com> <20090625105035.23411f41@tp.mains.net> Message-ID: <4A448277.4080308@gmail.com> On 06/25/2009 09:50 PM, Ian Main wrote: > On Thu, 25 Jun 2009 13:56:24 +0400 > dima vasiletc wrote: > > >> Hello >> I found on ovirt.org instruction for set unavailable(enable) to >> available(enable) >> i run "ruby /usr/share/ovirt-server/qmf-libvirt-example.rb" >> and get >> >> Error caching credentials; attempting to continue... >> Connecting to amqp://main.forex-24h.com:5672.. >> /usr/lib/ruby/site_ruby/1.8/qpid/delegates.rb:209:in >> `connection_start'/usr/lib/ruby/site_ruby/1.8/qpid/delegates.rb:209: >> [BUG] Segmentation fault >> ruby 1.8.6 (2008-08-11) [x86_64-linux] >> > > qmf-libvirt-example has to access the ovirt qpid kerberos ticket in order > to connect to qpidd. In order to that it has to be run as root. > > If everything else is working (looks like it is) then that should fix it. > > Ian > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > > Hello i attache all log message during boot second node and authorization. this is not first boot second node - so key for this server is generated. tail -f /var/log/messages /var/log/ovirt-server/* /var/log/krb5kdc.log Jun 26 03:05:56 main dnsmasq[3698]: DHCPDISCOVER(eth0) 00:30:48:5f:28:40 Jun 26 03:05:56 main dnsmasq[3698]: DHCPOFFER(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 26 03:05:56 main dnsmasq[3698]: DHCPREQUEST(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 26 03:05:56 main dnsmasq[3698]: DHCPACK(eth0) 10.12.105.179 00:30:48:5f:28:40 ==> /var/log/ovirt-server/rails.log <== Processing ManagedNodeController#config (for 10.12.105.179 at 2009-06-26 03:05:58) [GET] Session ID: ef118671295d084759b5449883515755 Parameters: {"action"=>"config", "controller"=>"managed_node", "macs"=>"00:30:48:5f:28:41=eth1,", "host"=>"node179.forex-24h.com"} Sending data Completed in 0.17506 (5 reqs/sec) | Rendering: 0.00025 (0%) | LDAP: 0.00000 (0%) | DB: 0.02527 (14%) | 200 OK [http://main.forex-24h.com./ovirt/managed_node/config?host=node179.forex-24h.com&macs=00:30:48:5f:28:41=eth1,] ==> /var/log/messages <== Jun 26 03:06:00 main dnsmasq[3698]: DHCPDISCOVER(eth0) 00:30:48:5f:28:40 Jun 26 03:06:00 main dnsmasq[3698]: DHCPOFFER(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 26 03:06:00 main dnsmasq[3698]: DHCPREQUEST(eth0) 10.12.105.179 00:30:48:5f:28:40 Jun 26 03:06:00 main dnsmasq[3698]: DHCPACK(eth0) 10.12.105.179 00:30:48:5f:28:40 ==> /var/log/ovirt-server/host-browser.log <== Connected to node179.forex-24h.com Jun 26 03:06:01 10.12.105.179 Begin conversation Jun 26 03:06:01 10.12.105.179 Determining the runtime mode. Jun 26 03:06:01 10.12.105.179 MODE=AWAKEN Jun 26 03:06:01 10.12.105.179 Ending conversation Disconnected from node179.forex-24h.com ==> /var/log/krb5kdc.log <== Jun 26 03:06:13 main.forex-24h.com krb5kdc[2790](info): AS_REQ (7 etypes {18 17 16 23 1 3 2}) 10.12.105.179: ISSUE: authtime 1246003573, etypes {rep=18 tkt=18 ses=18}, qpidd/node179.forex-24h.com at FOREX-24H.COM for krbtgt/FOREX-24H.COM at FOREX-24H.COM ==> /var/log/messages <== Jun 26 03:06:14 main qpidd[2199]: 2009-06-26 03:06:14 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) Jun 26 03:06:16 main qpidd[2199]: 2009-06-26 03:06:16 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) ==> /var/log/ovirt-server/host-browser.log <== Connected to node179.forex-24h.com Jun 26 03:06:14 10.12.105.179 Begin conversation Jun 26 03:06:14 10.12.105.179 Determining the runtime mode. Jun 26 03:06:14 10.12.105.179 MODE=IDENTIFY Jun 26 03:06:14 10.12.105.179 Begin remote info collection Received info='ARCH=x86_64' Jun 26 03:06:14 10.12.105.179 ::Received - ARCH:x86_64 Received info='UUID=00020003-0004-0005-0006-000700080009' Jun 26 03:06:14 10.12.105.179 ::Received - UUID:00020003-0004-0005-0006-000700080009 Received info='MEMSIZE=16302720' Jun 26 03:06:14 10.12.105.179 ::Received - MEMSIZE:16302720 Received info='CPU' Begin receiving CPU details Jun 26 03:06:14 10.12.105.179 ::Received - CPUNUM:0 Jun 26 03:06:14 10.12.105.179 ::Received - CORENUM:0 Jun 26 03:06:14 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:14 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:14 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:14 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:14 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:14 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:14 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:14 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:14 10.12.105.179 ::Received - CPUNUM:1 Jun 26 03:06:14 10.12.105.179 ::Received - CORENUM:1 Jun 26 03:06:14 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:14 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:14 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:14 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:15 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:15 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:15 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:15 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:15 10.12.105.179 ::Received - CPUNUM:2 Jun 26 03:06:15 10.12.105.179 ::Received - CORENUM:0 Jun 26 03:06:15 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:15 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:15 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:15 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:15 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:15 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:15 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:15 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:15 10.12.105.179 ::Received - CPUNUM:3 Jun 26 03:06:15 10.12.105.179 ::Received - CORENUM:1 Jun 26 03:06:15 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:15 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:15 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:15 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:15 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:16 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:16 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:16 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:16 10.12.105.179 ::Received - CPUNUM:4 Jun 26 03:06:16 10.12.105.179 ::Received - CORENUM:0 Jun 26 03:06:16 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:16 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:16 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:16 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:16 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:16 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:16 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:16 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:16 10.12.105.179 ::Received - CPUNUM:5 Jun 26 03:06:16 10.12.105.179 ::Received - CORENUM:1 Jun 26 03:06:16 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:16 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:16 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:16 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:16 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:16 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:17 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:17 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:17 10.12.105.179 ::Received - CPUNUM:6 Jun 26 03:06:17 10.12.105.179 ::Received - CORENUM:0 Jun 26 03:06:17 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:17 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:17 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:17 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:17 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:17 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:17 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:17 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='CPU' Begin receiving CPU details Jun 26 03:06:17 10.12.105.179 ::Received - CPUNUM:7 Jun 26 03:06:17 10.12.105.179 ::Received - CORENUM:1 Jun 26 03:06:17 10.12.105.179 ::Received - NUMCORES:2 Jun 26 03:06:17 10.12.105.179 ::Received - VENDOR:AuthenticAMD Jun 26 03:06:17 10.12.105.179 ::Received - MODEL:65 Jun 26 03:06:17 10.12.105.179 ::Received - FAMILY:15 Jun 26 03:06:17 10.12.105.179 ::Received - CPUIDLVL:1 Jun 26 03:06:17 10.12.105.179 ::Received - SPEED:1000.000 Jun 26 03:06:17 10.12.105.179 ::Received - CACHE:1024 KB Jun 26 03:06:18 10.12.105.179 ::Received - FLAGS:fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy Received info='NIC' Begin receiving NIC details Jun 26 03:06:18 10.12.105.179 ::Received - MAC:00:30:48:5f:28:41 Jun 26 03:06:18 10.12.105.179 ::Received - BANDWIDTH:1000 Jun 26 03:06:18 10.12.105.179 ::Received - IFACE_NAME:eth1 Received info='ENDINFO' Searching for existing host record... Deleting any existing CPUs Saving new CPU records Updating NIC records for the node Searching for existing record for: 00:30:48:5F:28:41 Updating details for: eth1 [00:30:48:5F:28:41]} Jun 26 03:06:18 10.12.105.179 Ending conversation Disconnected from node179.forex-24h.com ==> /var/log/messages <== Jun 26 03:06:20 main qpidd[2199]: 2009-06-26 03:06:20 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) Jun 26 03:06:28 main qpidd[2199]: 2009-06-26 03:06:28 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) Jun 26 03:06:44 main qpidd[2199]: 2009-06-26 03:06:44 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) Jun 26 03:07:16 main qpidd[2199]: 2009-06-26 03:07:16 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) Jun 26 03:08:20 main qpidd[2199]: 2009-06-26 03:08:20 warning Client closed connection with 501: internal-error: Sasl error: SASL(-4): no mechanism available: No worthy mechs found (qpid/client/SaslFactory.cpp:226) -- ? ?????????, ??????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktf000 at gmail.com Fri Jun 26 10:30:21 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Fri, 26 Jun 2009 12:30:21 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> <4A43CF36.6060302@redhat.com> Message-ID: Well, the hanging at the end was only due to the kernel param "console=ttyS0,115200n8". If I take it out, then the error message appears on the console again: "WARNING: Cannot find root file system!" I'm still wondering how pxe can find ovirt-node-image.iso. It's located only under /usr/share/ovirt-node-image and given the size of initrd0.img (4537334 bytes), it's obviously not embedded into it. Did I miss a step in the installation which embeds ovirt-node-image.iso into initrd0.img? What is the size of your initrd0.img? On Thu, Jun 25, 2009 at 9:56 PM, Laurent Monnoye wrote: > > cobbler-import output: > > # cobbler-import > + set -e > + for dir in '$ksdir/*' > + ova=/var/www/cobbler/ks_mirror/brol/.treeinfo.ova > + '[' '!' -f /var/www/cobbler/ks_mirror/brol/.treeinfo.ova ']' > + echo 'Skipping /var/www/cobbler/ks_mirror/brol, no > /var/www/cobbler/ks_mirror/brol/.treeinfo.ova file present' > Skipping /var/www/cobbler/ks_mirror/brol, no > /var/www/cobbler/ks_mirror/brol/.treeinfo.ova file present > + continue > + for dir in '$ksdir/*' > + ova=/var/www/cobbler/ks_mirror/config/.treeinfo.ova > + '[' '!' -f /var/www/cobbler/ks_mirror/config/.treeinfo.ova ']' > + echo 'Skipping /var/www/cobbler/ks_mirror/config, no > /var/www/cobbler/ks_mirror/config/.treeinfo.ova file present' > Skipping /var/www/cobbler/ks_mirror/config, no > /var/www/cobbler/ks_mirror/config/.treeinfo.ova file present > + continue > + for dir in '$ksdir/*' > + ova=/var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova > + '[' '!' -f /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova > ']' > + echo 'Skipping /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD, no > /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova file present' > Skipping /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD, no > /var/www/cobbler/ks_mirror/Fedora-11-x86_64-DVD/.treeinfo.ova file present > + continue > + for dir in '$ksdir/*' > + ova=/var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova > + '[' '!' -f /var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova ']' > + echo 'Skipping /var/www/cobbler/ks_mirror/ovirt-node, no > /var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova file present' > Skipping /var/www/cobbler/ks_mirror/ovirt-node, no > /var/www/cobbler/ks_mirror/ovirt-node/.treeinfo.ova file present > + continue > ++ rpm -q --qf '%{arch}' ovirt-node-image > + node_arch=x86_64 > + node_dir=/usr/share/ovirt-node-image > + cobbler distro add --name=oVirt-Node-x86_64 --arch=x86_64 > --initrd=/usr/share/ovirt-node-image/tftpboot/initrd0.img > --kernel=/usr/share/ovirt-node-image/tftpboot/vmlinuz0 > '--kopts=rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro > console=tty0 console=ttyS0,115200n8' > + cobbler profile add --name=oVirt-Node-x86_64 --distro=oVirt-Node-x86_64 > + cobbler system add --netboot-enabled=1 --profile=oVirt-Node-x86_64 > --name=node3 --mac=00:16:3e:12:34:57 > + cobbler system add --netboot-enabled=1 --profile=oVirt-Node-x86_64 > --name=node4 --mac=00:16:3e:12:34:58 '--kopts=ovirt_init=scsi > ovirt_local_boot' > + cobbler system add --netboot-enabled=1 --profile=oVirt-Node-x86_64 > --name=node5 --mac=00:16:3e:12:34:59 --kopts=ovirt_init=scsi > + sed -i -e '/kernel /a \\tIPAPPEND 2' /etc/cobbler/pxe/pxesystem.template > + sed -i -e 's/^ONTIMEOUT.*/ONTIMEOUT oVirt-Node-x86_64/' > /etc/cobbler/pxe/pxedefault.template > + service cobblerd restart > Stopping cobbler daemon: [ OK ] > Starting cobbler daemon: [ OK ] > + cobbler sync > > Here's what I have under /usr/share/ovirt-node-image: > > # ls -l /usr/share/ovirt-node-image > total 68388 > drwxr-xr-x 2 root root 4096 2009-06-24 11:56 manifests > -rw-r--r-- 1 root root 69947392 2009-06-05 14:44 ovirt-node-image.iso > drwxr-xr-x 3 root root 4096 2009-06-25 12:43 tftpboot > # ls -l /usr/share/ovirt-node-image/tftpboot > total 7052 > -rw-r--r-- 9 root root 4537334 2009-06-25 08:46 initrd0.img > -rw-r--r-- 1 root root 14716 2009-06-24 11:56 pxelinux.0 > drwxr-xr-x 2 root root 4096 2009-06-25 12:13 pxelinux.cfg > -r--r--r-- 9 root root 2644128 2009-06-25 08:46 vmlinuz0 > > I've tried to boot that new profile "oVirt-Node-x86_64". This time I don't > get the error message anymore. The system just hangs at the end (see console > output attached). Is that expected? > > > Are you building from the next branch or a released version? > > standard 0.96. I just installed everything with yum. > > > ovirt-node-image.iso should be under /usr/share/ovirt-node-image but in > the pxe case it's actually embedded in the initrd0.img file > > How come initrd0.img is so much smaller than the iso, then? > > > > > On Thu, Jun 25, 2009 at 9:25 PM, Joey Boggs wrote: > >> On 06/25/2009 03:00 PM, Laurent Monnoye wrote: >> >> > Looks like you're missing a few options on the append line, add them in >> like: >> > ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >> >> I just added these parameters but with no success, same problem (I see >> them on the console, so they are indeed being picked up). >> >> On the server, where should ovirt-node-image.iso be located? Maybe that's >> my problem. >> >> Where are those parameters documented as part of the oVirt installation >> guide? Did I miss them in the doc? >> >> Thanks a lot for your help, much appreciated!!! >> >> L- >> >> On Thu, Jun 25, 2009 at 8:03 PM, Joey Boggs wrote: >> >>> On 06/25/2009 11:06 AM, Laurent Monnoye wrote: >>> >>>> LABEL sark4 >>>> kernel /images/ovirt4/vmlinuz0 >>>> MENU LABEL sark4 >>>> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >>>> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 >>>> ipappend 2 >>>> >>> >>> Looks like you're missing a few options on the append line, add them in >>> like: >>> >>> >>> ro rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >>> >>> >>> LABEL sark4 >>> kernel /images/ovirt4/vmlinuz0 >>> MENU LABEL sark4 >>> append initrd=/images/ovirt4/initrd0.img ksdevice=bootif lang= >>> kssendmac text ks=http://192.168.66.1/cblr/svc/op/ks/profile/sark4 ro >>> rootflags=loop text rootfstype=iso9660 root=/ovirt-node-image.iso >>> ipappend 2 >>> >> >> >> ovirt-node-image.iso should be under /usr/share/ovirt-node-image but in >> the pxe case it's actually embedded in the initrd0.img file. Im guessing >> some things are out of sync, I'd try running the cobbler-import command >> which should setup a cobbler profile for you named oVirt-Node-Image-$arch if >> that command fails capture the output for us. If it succeeds verify if there >> are any files under /usr/share/ovirt-node-image/tftpboot >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish-group.com Fri Jun 26 10:37:18 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Fri, 26 Jun 2009 20:37:18 +1000 Subject: [Ovirt-devel] iscsi storage creation In-Reply-To: <4A43A609.4080902@redfish-group.com> References: <4A4376FC.2060608@redfish-group.com> <4A438E10.2010302@redhat.com> <4A43A609.4080902@redfish-group.com> Message-ID: <4A44A4DE.4000903@redfish-group.com> Justin Clacherty wrote: > >> If you really want to use the whole 40GB lun for a single VM you >> don't need to create an LVM volume -- just use the iscsi lun (shown >> in the UI as an iscsi storage volume). > hmmm...when I tried this the first time it didn't work for me so I > just assumed you had to create the LVM volume. I'll try it again > without doing that. I've tried again. I added the storage servers, an individual iscsi volume for each VM. I create a VM and select an iscsi volume but the VM fails to start. The task list show "Unable to find volume 11.0.0.0 attached to pool 192.168.50.37-iqn.2009-3.san0:zimbra-3260." This is the same problem I found when I first tried. Any thoughts on what's going on here? Cheers, Justin. From apevec at gmail.com Fri Jun 26 10:44:00 2009 From: apevec at gmail.com (Alan Pevec) Date: Fri, 26 Jun 2009 12:44:00 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> <4A43CF36.6060302@redhat.com> Message-ID: <2be7262f0906260344g3a23da45iccedd5a14600d588@mail.gmail.com> On Fri, Jun 26, 2009 at 12:30 PM, Laurent Monnoye wrote: > Well, the hanging at the end was only due to the kernel param > "console=ttyS0,115200n8". If I take it out, then the error message appears > on the console again: "WARNING: Cannot find root file system!" > > I'm still wondering how pxe can find ovirt-node-image.iso. It's located > only under /usr/share/ovirt-node-image and given the size of initrd0.img > (4537334 bytes), it's obviously not embedded into it. > > Did I miss a step in the installation which embeds ovirt-node-image.iso > into initrd0.img? What is the size of your initrd0.img? > step of embedding iso into PXE initrd0.img should be performed when ovirt-node-image-pxe RPM is installed, its %post http://git.et.redhat.com/?p=ovirt-node-image.git;a=blob;f=ovirt-node-image.spec.in;h=e64f4de2e495fe008cba79ddf4dbf585f6e593d0;hb=refs/heads/next#l75 Try running this manually, with output redirection to see if there are any error messages: cd /usr/share/ovirt-node-image rm -rf tftpboot livecd-iso-to-pxeboot ovirt-node-image.iso cobbler sync -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish-group.com Fri Jun 26 10:53:59 2009 From: justin at redfish-group.com (Justin Clacherty) Date: Fri, 26 Jun 2009 20:53:59 +1000 Subject: [Ovirt-devel] iscsi storage creation In-Reply-To: <4A44A4DE.4000903@redfish-group.com> References: <4A4376FC.2060608@redfish-group.com> <4A438E10.2010302@redhat.com> <4A43A609.4080902@redfish-group.com> <4A44A4DE.4000903@redfish-group.com> Message-ID: <4A44A8C7.5080904@redfish-group.com> Justin Clacherty wrote: > I've tried again. I added the storage servers, an individual iscsi > volume for each VM. I create a VM and select an iscsi volume but the > VM fails to start. The task list show "Unable to find volume 11.0.0.0 > attached to pool 192.168.50.37-iqn.2009-3.san0:zimbra-3260." This is > the same problem I found when I first tried. Any thoughts on what's > going on here? More strangeness. I looked at the VM setup again and under the zimbra iscsi storage server another lun has magically appeared, this one has volume number 4.0.0.0. If I choose this one it boots. Now if I look in the storage section of the UI I see both 11.0.0.0 and 4.0.0.0. I have another VM that's experiencing the same problem, I'll wait and see if it gets a magical new volume number... Justin. From ktf000 at gmail.com Fri Jun 26 11:16:28 2009 From: ktf000 at gmail.com (Laurent Monnoye) Date: Fri, 26 Jun 2009 13:16:28 +0200 Subject: [Ovirt-devel] Adding hosts to the hardware pool In-Reply-To: <2be7262f0906260344g3a23da45iccedd5a14600d588@mail.gmail.com> References: <1245940955.7392.1.camel@localhost.localdomain> <4A43BBF8.7010402@redhat.com> <4A43CF36.6060302@redhat.com> <2be7262f0906260344g3a23da45iccedd5a14600d588@mail.gmail.com> Message-ID: Ok, that was it. Problem solved :-) Thanks a lot !!! I don't know why livecd-iso-to-pxeboot wasn't run during the install. I might have to dig into the log files to find out. I have installed the whole thing as indicated in the doc (http://www.ovirt.org/install-instructions.html): # rpm -ivh http://ovirt.org/repos/ovirt/ovirt-release-LATEST.noarch.rpm # yum update --enablerepo=ovirt # yum install --enablerepo=ovirt ovirt-server ovirt-server-installer ovirt-node-image ovirt-node-image-pxe. So either I made a mistake then, or there's a bug in the install process. I will have to install other ovirt servers in the future, so I'll pay attention to that and update this thread accordingly. Now I can finally start having some fun!.. Thanks again for your help! On Fri, Jun 26, 2009 at 12:44 PM, Alan Pevec wrote: > > > On Fri, Jun 26, 2009 at 12:30 PM, Laurent Monnoye wrote: >> >> Well, the hanging at the end was only due to the kernel param "console=ttyS0,115200n8". If I take it out, then the error message appears on the console again: "WARNING: Cannot find root file system!" >> >> I'm still wondering how pxe can find ovirt-node-image.iso. It's located only under /usr/share/ovirt-node-image and given the size of initrd0.img (4537334 bytes), it's obviously not embedded into it. >> >> Did I miss a step in the installation which embeds ovirt-node-image.iso into initrd0.img? What is the size of your initrd0.img? > > step of embedding iso into PXE initrd0.img should be performed when ovirt-node-image-pxe RPM is installed, its %post > http://git.et.redhat.com/?p=ovirt-node-image.git;a=blob;f=ovirt-node-image.spec.in;h=e64f4de2e495fe008cba79ddf4dbf585f6e593d0;hb=refs/heads/next#l75 > > Try running this manually, with output redirection to see if there are any error messages: > > cd /usr/share/ovirt-node-image > rm -rf tftpboot > livecd-iso-to-pxeboot ovirt-node-image.iso > cobbler sync > From mdehaan at redhat.com Fri Jun 26 15:40:59 2009 From: mdehaan at redhat.com (Michael DeHaan) Date: Fri, 26 Jun 2009 11:40:59 -0400 Subject: [Ovirt-devel] [PATCH server] cleanup cobbler and put all cobbler traffic on the admin network In-Reply-To: <1240421375-9335-1-git-send-email-jboggs@redhat.com> References: <1240421375-9335-1-git-send-email-jboggs@redhat.com> Message-ID: <4A44EC0B.5050900@redhat.com> Joey Boggs wrote: > This set the cobbler modules dns/dhcp to dnsmasq, removes a duplicate ip replacement in /etc/cobbler/settings, and sets the ip address to the admin network instead of the guest networkwhere it should've been in the first place. > > --- > installer/modules/ovirt/files/modules.conf | 4 ++-- > installer/modules/ovirt/manifests/cobbler.pp | 16 ++++------------ > 2 files changed, 6 insertions(+), 14 deletions(-) > > diff --git a/installer/modules/ovirt/files/modules.conf b/installer/modules/ovirt/files/modules.conf > index 236ef4c..7bfc2f8 100644 > --- a/installer/modules/ovirt/files/modules.conf > +++ b/installer/modules/ovirt/files/modules.conf > @@ -74,7 +74,7 @@ module = authz_allowall > # https://fedorahosted.org/cobbler/wiki/ManageDns > > [dns] > -module = manage_bind > +module = manage_dnsmasq > > # chooses the DHCP management engine if manage_dhcp is enabled > # in /etc/cobbler/settings, which is off by default. > @@ -89,7 +89,7 @@ module = manage_bind > # https://fedorahosted.org/cobbler/wiki/ManageDhcp > > [dhcp] > -module = manage_isc > +module = manage_dnsmasq > > You guys are using the DHCP+DNS management features now (and these are turned on in settings)? I should point out -- most folks use ISC+BIND instead here. When we do the network objects feature for 2.0 (which will possibly impact the way we template out those configs), it may no longer be supported as we have to dual maintain it and ISC/BIND seems to be the proper "production" option as dnsmasq says it is for "small networks". From jboggs at redhat.com Fri Jun 26 15:47:19 2009 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 26 Jun 2009 11:47:19 -0400 Subject: [Ovirt-devel] [PATCH server] cleanup cobbler and put all cobbler traffic on the admin network In-Reply-To: <4A44EC0B.5050900@redhat.com> References: <1240421375-9335-1-git-send-email-jboggs@redhat.com> <4A44EC0B.5050900@redhat.com> Message-ID: <4A44ED87.9020102@redhat.com> On 06/26/2009 11:40 AM, Michael DeHaan wrote: > Joey Boggs wrote: >> This set the cobbler modules dns/dhcp to dnsmasq, removes a duplicate >> ip replacement in /etc/cobbler/settings, and sets the ip address to >> the admin network instead of the guest networkwhere it should've been >> in the first place. >> >> --- >> installer/modules/ovirt/files/modules.conf | 4 ++-- >> installer/modules/ovirt/manifests/cobbler.pp | 16 ++++------------ >> 2 files changed, 6 insertions(+), 14 deletions(-) >> >> diff --git a/installer/modules/ovirt/files/modules.conf >> b/installer/modules/ovirt/files/modules.conf >> index 236ef4c..7bfc2f8 100644 >> --- a/installer/modules/ovirt/files/modules.conf >> +++ b/installer/modules/ovirt/files/modules.conf >> @@ -74,7 +74,7 @@ module = authz_allowall >> # https://fedorahosted.org/cobbler/wiki/ManageDns >> >> [dns] >> -module = manage_bind >> +module = manage_dnsmasq >> >> # chooses the DHCP management engine if manage_dhcp is enabled >> # in /etc/cobbler/settings, which is off by default. >> @@ -89,7 +89,7 @@ module = manage_bind >> # https://fedorahosted.org/cobbler/wiki/ManageDhcp >> >> [dhcp] >> -module = manage_isc >> +module = manage_dnsmasq >> > > You guys are using the DHCP+DNS management features now (and these are > turned on in settings)? > > I should point out -- most folks use ISC+BIND instead here. > When we do the network objects feature for 2.0 (which will possibly > impact the way we template out those configs), it may no longer be > supported as we have to dual maintain it and ISC/BIND seems to be the > proper "production" option as dnsmasq says it is for "small networks". > > Actually I meant to nak that part of the patch with dns/dhcp changes myself but forgot to. So we shouldn't have an issue at this point. From lutter at redhat.com Fri Jun 26 16:38:00 2009 From: lutter at redhat.com (David Lutterkort) Date: Fri, 26 Jun 2009 09:38:00 -0700 Subject: [Ovirt-devel] QMF API for Ovirt Message-ID: <1246034280.4572.18.camel@avon.watzmann.net> Hi, Scott, Ian, and I have been working on the beginnings of a QMF[1] API for Ovirt over the last few weeks. That work happened on the dev/qmf2 branch in the git repo. While the API is not finished, the code is at a point where it would be better to merge it into next and continue development on that branch. Since the branch has a rather large number of patches, and almost all of it is new code that doesn't affect any of the existing bits, we decided to merge the branch into next without spamming the world with a huge number of patches. We would of course still appreciate any feedback on the code - if you want to review it, you can do that based on the dev/qmf2 branch. The most important aspect of this of course is the actual API; I attach the API definition and would really appreciate feedback on that. As I said, the API isn't fully implemented yet, and there's some additional work around basic plumbing like an init script etc. but all that will happen on the next branch. I will merge dev/qmf2 into next in the next few minutes. David [1] http://qpid.apache.org/qpid-management-framework.html -------------- next part -------------- A non-text attachment was scrubbed... Name: ovirt_api.xml Type: application/xml Size: 17670 bytes Desc: not available URL: From imain at redhat.com Fri Jun 26 19:29:24 2009 From: imain at redhat.com (Ian Main) Date: Fri, 26 Jun 2009 12:29:24 -0700 Subject: [Ovirt-devel] Re: [PATCH] Fix dbomatic state changes. In-Reply-To: <1245962795-32501-1-git-send-email-imain@redhat.com> References: <1245962795-32501-1-git-send-email-imain@redhat.com> Message-ID: <20090626122924.0e770eea@tp.mains.net> On Thu, 25 Jun 2009 13:46:35 -0700 Ian Main wrote: > This patch fixes state changes in dbomatic so that there is no > intermediate 'stopped' state after being unreachable or on startup > of dbomatic etc. Also fixes a number of smaller bugs around host > associations, state changes, etc. > > Signed-off-by: Ian Main Just found an issue with this one.. new patch coming.. Ian From imain at redhat.com Fri Jun 26 19:30:46 2009 From: imain at redhat.com (Ian Main) Date: Fri, 26 Jun 2009 12:30:46 -0700 Subject: [Ovirt-devel] [PATCH] Fix dbomatic state changes. In-Reply-To: <1245962795-32501-1-git-send-email-imain@redhat.com> References: <1245962795-32501-1-git-send-email-imain@redhat.com> Message-ID: <1246044646-13084-1-git-send-email-imain@redhat.com> This patch fixes state changes in dbomatic so that there is no intermediate 'stopped' state after being unreachable or on startup of dbomatic etc. Also fixes a number of smaller bugs around host associations, state changes, etc. Signed-off-by: Ian Main --- src/db-omatic/db_omatic.rb | 90 ++++++++++++++++++++++++++++++++----------- 1 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb index b3d5e73..155ff5e 100755 --- a/src/db-omatic/db_omatic.rb +++ b/src/db-omatic/db_omatic.rb @@ -113,6 +113,15 @@ class DbOmatic < Qpid::Qmf::Console end end + def set_vm_stopped(db_vm) + db_vm.host_id = nil + db_vm.memory_used = nil + db_vm.num_vcpus_used = nil + db_vm.needs_restart = nil + db_vm.vnc_port = nil + db_vm.state = Vm::STATE_STOPPED + end + def update_domain_state(domain, state_override = nil) vm = Vm.find(:first, :conditions => [ "uuid = ?", domain['uuid'] ]) if vm == nil @@ -190,12 +199,7 @@ class DbOmatic < Qpid::Qmf::Console result = qmf_vm.undefine if result.status == 0 @logger.info "Delete of VM #{vm.description} successful, syncing DB." - vm.host_id = nil - vm.memory_used = nil - vm.num_vcpus_used = nil - vm.state = Vm::STATE_STOPPED - vm.needs_restart = nil - vm.vnc_port = nil + set_vm_stopped(vm) end end end @@ -223,20 +227,37 @@ class DbOmatic < Qpid::Qmf::Console host_info[:synced] = true if state == Host::STATE_AVAILABLE - # At this point we want to set all domains that are - # unreachable to stopped. If a domain is indeed running - # then dbomatic will see that and set it either before - # or after. If the node was rebooted, the VMs will all - # be gone and dbomatic won't see them so we need to set - # them to stopped. - db_vm = Vm.find(:all, :conditions => ["host_id = ? AND state = ?", db_host.id, Vm::STATE_UNREACHABLE]) - db_vm.each do |vm| - @logger.info "Moving vm #{vm.description} in state #{vm.state} to state stopped." - vm.state = Vm::STATE_STOPPED - vm.save! + Thread.new do + @logger.info "#{host_info['hostname']} has moved to available, sleeping for updates to vms." + sleep(20) + + # At this point we want to set all domains that are + # unreachable to stopped. We're using a thread here to + # sleep for 10 seconds outside of the main dbomatic loop. + # If after 10 seconds with this host up there are still + # domains set to 'unreachable', then we're going to guess + # the node rebooted and so the domains should be set to + # stopped. + @logger.info "Checking for dead VMs on newly available host #{host_info['hostname']}." + + # Double check to make sure this host is still up. + begin + qmf_host = @session.object(:class => 'node', 'hostname' => host_info['hostname']) + if !qmf_host + @logger.info "Host #{host_info['hostname']} is not up after waiting 20 seconds, skipping dead VM check." + else + db_vm = Vm.find(:all, :conditions => ["host_id = ? AND state = ?", db_host.id, Vm::STATE_UNREACHABLE]) + db_vm.each do |vm| + @logger.info "Moving vm #{vm.description} in state #{vm.state} to state stopped." + set_vm_stopped(vm) + vm.save! + end + end + rescue Exception => e # just log any errors here + @logger.info "Exception checking for dead VMs (could be normal): #{e.message}" + end end end - else # FIXME: This would be a newly registered host. We could put it in the database. @logger.info "Unknown host #{host_info['hostname']}, probably not registered yet??" @@ -344,6 +365,7 @@ class DbOmatic < Qpid::Qmf::Console end def heartbeat(agent, timestamp) + puts "heartbeat from agent #{agent}" return if agent == nil synchronize do bank_key = "#{agent.agent_bank}.#{agent.broker.broker_bank}" @@ -376,6 +398,8 @@ class DbOmatic < Qpid::Qmf::Console values[:timed_out] = true end end + bank_key = "#{agent.agent_bank}.#{agent.broker.broker_bank}" + @heartbeats.delete(bank_key) end # The opposite of above, this is called when an agent is alive and well and makes sure @@ -415,11 +439,30 @@ class DbOmatic < Qpid::Qmf::Console @logger.error "Error with closing all VM VNCs operation: #{e.message}" end + # On startup, since we don't know the previous states of anything, we basically + # do a big sync up with teh states of all VMs. We don't worry about hosts since + # they are very simple and are either up or down, but it's possible we left + # VMs in various states that are no longer applicable to this moment. db_vm = Vm.find(:all) db_vm.each do |vm| - @logger.info "Marking vm #{vm.description} as stopped." - vm.state = Vm::STATE_STOPPED - vm.save! + set_stopped = false + # Basically here we are looking for VMs which are not up in some form or another and setting + # them to stopped. VMs that exist as QMF objects will get set appropriately when the objects + # appear on the bus. + begin + qmf_vm = @session.object(:class => 'domain', 'uuid' => db_vm.uuid) + if qmf_vm == nil + set_stopped = true + end + rescue Exception => ex + set_stopped = true + end + + if set_stopped + @logger.info "On startup, VM #{vm.description} is not found, setting to stopped." + set_vm_stopped(vm) + vm.save! + end end end @@ -444,6 +487,7 @@ class DbOmatic < Qpid::Qmf::Console # Get seconds from the epoch t = Time.new.to_i + puts "going through heartbeats.." @heartbeats.keys.each do | key | agent, timestamp = @heartbeats[key] @@ -451,11 +495,11 @@ class DbOmatic < Qpid::Qmf::Console s = timestamp / 1000000000 delta = t - s + puts "Checking time delta for agent #{agent} - #{delta}" + if delta > 30 # No heartbeat for 30 seconds.. deal with dead/disconnected agent. agent_disconnected(agent) - - @heartbeats.delete(key) else agent_connected(agent) end -- 1.6.0.6 From sseago at redhat.com Mon Jun 29 13:18:53 2009 From: sseago at redhat.com (Scott Seago) Date: Mon, 29 Jun 2009 09:18:53 -0400 Subject: [Ovirt-devel] [PATCH server] Vm state change auditing/accounting In-Reply-To: <1245861520-26014-1-git-send-email-slinabery@redhat.com> References: <1245861520-26014-1-git-send-email-slinabery@redhat.com> Message-ID: <4A48BF3D.4040701@redhat.com> Steve Linabery wrote: > Adds VmStateChangeEvent class and uses VmObserver to track/audit state > changes for Vm objects. Callbacks in VmObserver also update the new > total_uptime and total_uptime_timestamp attributes of Vm class, which > allows easy calculation of time spent in running states for user > resource use accounting. > --- > ACK with the addition of those minor fixes we discussed in IRC. My patch will be out shortly -- one more snag to work through. Scott From dpierce at redhat.com Mon Jun 29 13:23:31 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 29 Jun 2009 09:23:31 -0400 Subject: [Ovirt-devel] [PATCH node] Rerunning network config resets all network config. bz#507393 Message-ID: <1246281811-8380-1-git-send-email-dpierce@redhat.com> When the user runs o-c-networking then it ensures that all features of networking that we configure are reset and only those settings touched are applied. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-networking | 46 +++++++++++++++++++++++++------------- 1 files changed, 30 insertions(+), 16 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index d29bd12..81f017c 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -16,8 +16,10 @@ WORKDIR=$(mktemp -d) || exit 1 trap '__st=$?; rm -rf "$WORKDIR"; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 -CONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" +IFCONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg" +NTPCONF_FILE_ROOT="/files/etc/ntp" NTP_CONFIG_FILE="/etc/ntp.conf" +NTPSERVERS="" CONFIGURED_NIC="" # if local storage is not configured, then exit the script @@ -55,10 +57,10 @@ function configure_interface printf "\nConfigure $BRIDGE for use by $NIC..\n\n" - local IF_ROOT="$CONFIG_FILE_ROOT-$NIC" + local IF_ROOT="$IFCONFIG_FILE_ROOT-$NIC" local IF_CONFIG="rm $IF_ROOT\nset $IF_ROOT/DEVICE $NIC" - local BR_ROOT="$CONFIG_FILE_ROOT-$BRIDGE" + local BR_ROOT="$IFCONFIG_FILE_ROOT-$BRIDGE" local BR_CONFIG="rm $BR_ROOT\nset $BR_ROOT/DEVICE $BRIDGE" BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/TYPE Bridge" BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/PEERNTP yes" @@ -202,7 +204,7 @@ function configure_dns fi local IF_FILENAME="$WORKDIR/augtool-br${CONFIGURED_NIC}" - local IF_ROOT="$CONFIG_FILE_ROOT-br${CONFIGURED_NIC}" + local IF_ROOT="$IFCONFIG_FILE_ROOT-br${CONFIGURED_NIC}" local IF_CONFIG= if [ -z "$AUTO" ]; then @@ -241,12 +243,11 @@ function configure_dns function configure_ntp { - local NTP=$1 local AUTO=$2 if [[ "$AUTO" == "AUTO" && -n "$OVIRT_NTP" ]]; then - NTP=$OVIRT_NTP + NTPSERVERS=$OVIRT_NTP else - NTP="" + NTPSERVERS="" fi if [ -z "$AUTO" ]; then @@ -255,18 +256,29 @@ function configure_ntp if [ -z "$REPLY" ]; then break; fi - NTP="$NTP $REPLY" + NTPSERVERS="$NTPSERVERS $REPLY" done fi +} - if [ -n "$NTP" ]; then - # strip out all current servers from /etc/npt.conf and insert our own - BACKUP="${WORKDIR}/ntp.conf-backup" - egrep -v '^server .* # added by ovirt-config-network' < $NTP_CONFIG_FILE > $BACKUP - for server in $NTP; do - echo "server $server # added by ovirt-config-network" >> $BACKUP +function save_ntp_configuration +{ + local ntpconf="$WORKDIR/augtool-ntp" + local ntproot="/files/etc/ntp.conf" + + printf "\ +rm ${ntproot}\n\n +set ${ntproot}/driftfile /var/lib/ntp/drift\n\ +set ${ntproot}/includefile /etc/ntp/crypto/pw\n\ +set ${ntproot}/keys /etc/ntp/keys\n\ +save\n" > $ntpconf + + if [ -n "$NTPSERVERS" ]; then + offset=1 + for server in $NTPSERVERS; do + printf "set /files/etc/ntp.conf/server[${offset}] ${server}\n" >> $ntpconf + offset=$(echo "$offset+1" | bc) done - cp -f $BACKUP $NTP_CONFIG_FILE fi } @@ -317,7 +329,9 @@ else "$DNS") configure_dns "$OVIRT_DNS"; break ;; "$NTP") configure_ntp "$OVIRT_NTP"; break ;; "$Abort") rm -f "${WORKDIR}"/augtool-*; exit 99;; - "$Save") break 2;; + "$Save") + save_ntp_configuration + break 2;; *) if [[ -n "${NIC}" ]] && [[ "${NICS}" =~ "${NIC}" ]]; then configure_interface $NIC $IFACE_NUMBER -- 1.6.0.6 From sseago at redhat.com Mon Jun 29 13:49:29 2009 From: sseago at redhat.com (Scott Seago) Date: Mon, 29 Jun 2009 13:49:29 +0000 Subject: [Ovirt-devel] [PATCH server] UI for accumulated uptime for VMs. Message-ID: <1246283369-13477-1-git-send-email-sseago@redhat.com> There's still a problem with this working on the cloud side, but that can be resolved in a subsequent commit. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 7 ++++++- src/app/controllers/smart_pools_controller.rb | 5 ++--- src/app/helpers/application_helper.rb | 14 ++++++++++++++ src/app/models/vm.rb | 5 +++++ src/app/views/cloud/instance/_list.rhtml | 3 +++ src/app/views/vm/_grid.rhtml | 1 + src/app/views/vm/show.rhtml | 4 +++- 8 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/app/controllers/pool_controller.rb b/src/app/controllers/pool_controller.rb index 74a958c..44cb780 100644 --- a/src/app/controllers/pool_controller.rb +++ b/src/app/controllers/pool_controller.rb @@ -96,7 +96,7 @@ class PoolController < ApplicationController def vms_json(args) attr_list = [:id, :description, :uuid, :num_vcpus_allocated, :memory_allocated_in_mb, - :vnic_mac_addr, :state, :id] + :vnic_mac_addr, :state, :calc_uptime, :id] if (@pool.is_a? VmResourcePool) and @pool.get_hardware_pool.can_view(@user) attr_list.insert(3, [:host, :hostname]) end diff --git a/src/app/controllers/resources_controller.rb b/src/app/controllers/resources_controller.rb index 9d1074a..7188db8 100644 --- a/src/app/controllers/resources_controller.rb +++ b/src/app/controllers/resources_controller.rb @@ -63,7 +63,12 @@ class ResourcesController < PoolController def vms_json svc_show(params[:id]) - super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) + super(:full_items => @pool.vms, :find_opts => {:select => "*, case + when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(total_uptime || ' sec' as interval) + end as calc_uptime"}, :include_pool => :true) end def delete diff --git a/src/app/controllers/smart_pools_controller.rb b/src/app/controllers/smart_pools_controller.rb index 8762ac0..b355f4b 100644 --- a/src/app/controllers/smart_pools_controller.rb +++ b/src/app/controllers/smart_pools_controller.rb @@ -76,11 +76,10 @@ class SmartPoolsController < PoolController end - def items_json_internal(item_class, item_assoc) + def items_json_internal(item_class, item_assoc, find_opts = {}) if params[:id] svc_show(params[:id]) full_items = @pool.send(item_assoc) - find_opts = {} include_pool = false else # FIXME: no permissions or usage checks here yet @@ -93,7 +92,7 @@ class SmartPoolsController < PoolController else conditions = ["#{item_class.table_name}.id not in (?)", pool_items] end - find_opts = {:conditions => conditions} + find_opts[:conditions] = conditions include_pool = true end { :full_items => full_items, :find_opts => find_opts, :include_pool => include_pool} diff --git a/src/app/helpers/application_helper.rb b/src/app/helpers/application_helper.rb index 0178ad0..0c6562e 100644 --- a/src/app/helpers/application_helper.rb +++ b/src/app/helpers/application_helper.rb @@ -171,4 +171,18 @@ module ApplicationHelper def flash_path(source) compute_public_path(source, 'swfs', 'swf') end + + def number_to_duration(input_num) + input_int = input_num.to_i + hours_to_seconds = [input_int/3600 % 24, + input_int/60 % 60, + input_int % 60].map{|t| t.to_s.rjust(2,'0')}.join(':') + days = input_int / 86400 + day_str = "" + if days > 0 + day_label = (days > 1) ? "days" : "day" + day_str = "#{days} #{day_label} " + end + day_str + hours_to_seconds + end end diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index 1a57a14..355ce6d 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -421,6 +421,11 @@ class Vm < ActiveRecord::Base :conditions => ["privileges.name=:priv and permissions.uid=:user", { :user => user, :priv => priv }], + :select => "*, case when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(total_uptime || ' sec' as interval) + end as calc_uptime", :per_page => 5, :page => page, :order => order) diff --git a/src/app/views/cloud/instance/_list.rhtml b/src/app/views/cloud/instance/_list.rhtml index 1fa46de..bed7b3b 100644 --- a/src/app/views/cloud/instance/_list.rhtml +++ b/src/app/views/cloud/instance/_list.rhtml @@ -14,6 +14,9 @@ ">
        <%= sort_link_helper "State", "state" %>
        + "> +
        <%= sort_link_helper "Total Run Time", "calc_uptime" %>
        +
        IP Address
        Load
        diff --git a/src/app/views/vm/_grid.rhtml b/src/app/views/vm/_grid.rhtml index b137de6..a110011 100644 --- a/src/app/views/vm/_grid.rhtml +++ b/src/app/views/vm/_grid.rhtml @@ -36,6 +36,7 @@ {display: 'Memory (MB)', name : 'memory_allocated', width : 60, sortable : true, align: 'right'}, {display: 'vNIC Mac Addr', name : 'vnic_mac_addr', width : 60, sortable : true, align: 'right'}, {display: 'State', name : 'state', width : 50, sortable : true, align: 'right'}, + {display: 'Total Run Time', name : 'calc_uptime', width : 50, align: 'right'}, {display: 'Load', name : 'load', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget } ], sortname: "description", diff --git a/src/app/views/vm/show.rhtml b/src/app/views/vm/show.rhtml index 0f70da8..ffe5055 100644 --- a/src/app/views/vm/show.rhtml +++ b/src/app/views/vm/show.rhtml @@ -111,6 +111,7 @@ Provisioning source:
        State:
        Pending State:
        + Total Run Time:
        <%=h @vm.uuid %>
        @@ -128,7 +129,8 @@ <%unless @vm.needs_restart.nil? or @vm.needs_restart == 0 -%> (needs restart) <% end -%>
        - <%=h @vm.get_pending_state %> + <%=h @vm.get_pending_state %>
        + <%=h number_to_duration(@vm.get_calculated_uptime) %>
        • New Instance
        • Actions -
            - <% @actions.each {|action| %> -
          • <%= image_tag action[2]%><%= action[0] %>
          • - <% } %> -
          + <%=%> +
            + <% @actions.each {|action| %> + +
          • + <%= image_tag action[2]%> + <%= submit_tag action[0], :name => 'submit_for_list', :class => 'button_as_link' %> +
          • + <% } %> +
        -
        <%# This form tag is terminated in _show.rhtml %>
        - <%= render :partial => 'list' %> + <% if !flash.empty? %> + <%= render :partial => '/layouts/cloud/notification' %> + <% end %> + <%= render :partial => 'list' %>
        - <%= render :partial => 'show' %> -
        \ No newline at end of file + <%= render :partial => 'show' %> +
        + \ No newline at end of file diff --git a/src/app/views/layouts/cloud/_notification.rhtml b/src/app/views/layouts/cloud/_notification.rhtml new file mode 100644 index 0000000..96042fc --- /dev/null +++ b/src/app/views/layouts/cloud/_notification.rhtml @@ -0,0 +1,31 @@ +
        class="error-align"<%end%>"> + <%= link_to "", params, :id => "close-notify" %> + <% if flash[:error] %> + <% if !flash[:error][:successes].empty? %> +
        +

        The following items were successful:

        +
          + <% flash[:error][:successes].each {|item| %> +
        • <%= item %>
        • + <% } %> +
        +
        + <% end %> + <% if !flash[:error][:failures].empty? %> +

        <%= flash[:error][:summary]%>

        +
        +
          + <% flash[:error][:failures].each {|key, value| %> +
        • <%= key %>: <%= value %>
        • + <% } %> +
        +
        + <% end %> + <% end %> + <% if flash[:warning] %> +

        <%= flash[:warning] %>

        + <% end %> + <% if flash[:notice] %> +
        • <%= flash[:notice] %>
        + <% end %> +
        \ No newline at end of file diff --git a/src/public/stylesheets/cloud/layout.css b/src/public/stylesheets/cloud/layout.css index 0fd158d..1d1fa07 100644 --- a/src/public/stylesheets/cloud/layout.css +++ b/src/public/stylesheets/cloud/layout.css @@ -28,6 +28,14 @@ html {min-width:640px;} color: #337ACC; } +/* Make buttons look like links */ +.button_as_link { + background: none; + color: #666666; + border: none; + cursor: pointer; +} + #navcontainer { height:40px; } @@ -205,8 +213,10 @@ input#submit_for_list { #toolbar li:hover { background: #337ACC; +} + +#toolbar li:hover > .button_as_link { color: #FFFFFF; - cursor: pointer; } #toolbar li.current { /* This is not really needed right now, but will be useful when we add filters. */ @@ -234,3 +244,64 @@ input#submit_for_list { } #toolbar li:hover ul {display: block;} + +/****** Notification styles ******/ +#notification { + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; + position: absolute; + z-index: 1; + top: 2em; + left: 35%; + margin: 0 auto; + padding: 1.5em; + background: #337ACC; + border: solid 0.2em; +} + +.error-align {left: 25% !important;} + +#notification > div { + margin-bottom: 1em; +} + +#notification h4 { + text-indent: 3em; +} + +#close-notify { + position: absolute; + right: 0.2em; + top: 0.2em; + width:11px; + height:11px; + background: url(/images/closebox-11px.png) no-repeat; +} + +.success { + width: 100%; + background:url(/images/icon_conf_success.png) left center no-repeat #CCFFCC; + border: solid 0.2em green; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} + +.success li, .error li { + margin-left:3em; +} + +.error { + width: 100%; + background:url(/images/icon_conf_error.png) left center no-repeat #EC9999; + border: solid 0.2em red; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} + +.warning { + width: 100%; + background:url(/images/icon_conf_warning.png) left center no-repeat #FFFFCC; + border: solid 0.2em yellow; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb index 213d2e0..71d132b 100644 --- a/src/test/functional/cloud/instance_controller_test.rb +++ b/src/test/functional/cloud/instance_controller_test.rb @@ -1,6 +1,27 @@ -require 'test_helper' +# +# Copyright (C) 2008 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +require File.dirname(__FILE__) + '/../../test_helper' class Cloud::InstanceControllerTest < ActionController::TestCase + + include ServiceModuleHelper fixtures :vms, :tasks def setup @controller = Cloud::InstanceController.new @@ -14,10 +35,48 @@ class Cloud::InstanceControllerTest < ActionController::TestCase assert_template 'index' assert_not_nil assigns(:vms) assert_not_nil assigns(:user) + assert_equal({}, flash, "flash object is not empty!") + assert_equal(true, flash.empty?) + assert_select "#notification", false, "This page must contain no notification block" end - def test_should_redirect_if_request_for_selected + def test_should_redirect_if_form_submitted post(:index,{:submit_for_list => 'Show Selected'}) - assert_response :redirect + assert_redirected_to :action => :index + #TODO: since this is a redirect, it returns a 302 and nil template, + # would be good to figure out how to get the actual result returned to + # browser so we can do an assert_select + end + + def test_add_valid_task + post(:index,{:submit_for_list => 'Shutdown', :ids => [vms(:production_mysqld_vm).id]}) + assert_equal('shutdown_vm successful.', flash[:notice]) + assert_redirected_to :action => :index, :ids => vms(:production_mysqld_vm).id + end + + def test_add_invalid_task + post(:index,{:submit_for_list => 'Shutdown', + :ids => [vms(:production_mysqld_vm).id,vms(:production_httpd_vm).id]}) + expected_failures = {:summary => "Your request to shutdown_vm encountered the following errors: ", + :failures => {vms(:production_httpd_vm).description => "shutdown_vm cannot be performed on this vm."}, + :successes => ["#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued."]} + assert_equal(expected_failures, flash[:error]) + assert_redirected_to :action => :index, :ids => [vms(:production_mysqld_vm).id,vms(:production_httpd_vm).id] + end + + def test_add_task_no_perms_for_some_vms + post(:index,{:submit_for_list => 'Shutdown', + :ids => [vms(:production_mysqld_vm).id,vms(:corp_com_qa_postgres_vm).id]}) + expected_failures = {:summary => "Your request to shutdown_vm encountered the following errors: ", + :failures => {vms(:corp_com_qa_postgres_vm).description => "You have insufficient privileges to perform action."}, + :successes => ["#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued."]} + assert_equal(expected_failures, flash[:error]) + assert_redirected_to :action => :index, :ids => [vms(:production_mysqld_vm).id,vms(:corp_com_qa_postgres_vm).id] + end + + # Make sure we get warning back if no instance was chosen to perform an action on. + def test_no_instance_chosen + post(:index,{:submit_for_list => 'Shutdown'}) + assert_equal("You must select at least one instance to perform an action.", flash[:warning]) end end -- 1.6.0.6 From jguiditt at redhat.com Mon Jun 29 18:24:03 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Mon, 29 Jun 2009 14:24:03 -0400 Subject: [Ovirt-devel] One more fix Message-ID: <1246299845-20697-1-git-send-email-jguiditt@redhat.com> This resend includes the rebase, but fixes a problem I just noticed with nil/empty checks. From jguiditt at redhat.com Mon Jun 29 18:24:04 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Mon, 29 Jun 2009 14:24:04 -0400 Subject: [Ovirt-devel] [PATCH server] Add svc_vm_actions method to VmService. In-Reply-To: <1246299845-20697-1-git-send-email-jguiditt@redhat.com> References: <1246299845-20697-1-git-send-email-jguiditt@redhat.com> Message-ID: <1246299845-20697-2-git-send-email-jguiditt@redhat.com> Also includes a couple minor model changes to support better error reporting. This method was added so that a client could submit multiple vms to the service layer in one call and get back appropriate messages showing any failures without those failures also causing the entire call to fail, or forcing the client to implement handling (begin/rescue blocks) of these errors to continue through the submitted vm list. Signed-off-by: Jason Guiditta --- src/app/models/vm.rb | 7 ++ src/app/models/vm_task.rb | 4 +- src/app/services/service_module_helper.rb | 34 +++++++ src/app/services/vm_service.rb | 33 ++++++- src/test/fixtures/permissions.yml | 6 +- src/test/fixtures/vms.yml | 13 +++ src/test/unit/vm_service_test.rb | 149 +++++++++++++++++++++++++++++ src/test/unit/vm_task_test.rb | 38 ++++++++ src/test/unit/vm_test.rb | 23 ++++- 9 files changed, 300 insertions(+), 7 deletions(-) create mode 100644 src/app/services/service_module_helper.rb create mode 100644 src/test/unit/vm_service_test.rb create mode 100644 src/test/unit/vm_task_test.rb diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index f445219..df18c7e 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -280,6 +280,13 @@ class Vm < ActiveRecord::Base actions end + # Provide method to check if requested action exists, so caller can decide + # if they want to throw an error of some sort before continuing + # (ie in service api) + def valid_action?(action) + return VmTask::ACTIONS.include?(action) ? true : false + end + # these resource checks are made at VM start/restore time # use pending here by default since this is used for queueing VM # creation/start operations diff --git a/src/app/models/vm_task.rb b/src/app/models/vm_task.rb index 762438f..649001d 100644 --- a/src/app/models/vm_task.rb +++ b/src/app/models/vm_task.rb @@ -146,10 +146,10 @@ class VmTask < Task end def self.action_privilege(action) - return ACTIONS[action][:privilege][0] + return ACTIONS[action].nil? ? nil : ACTIONS[action][:privilege][0] end def self.action_privilege_object(action, obj) - return obj.send(ACTIONS[action][:privilege][1]) + return ACTIONS[action].nil? ? nil : obj.send(ACTIONS[action][:privilege][1]) end def self.action_label(action) return ACTIONS[action][:label] diff --git a/src/app/services/service_module_helper.rb b/src/app/services/service_module_helper.rb new file mode 100644 index 0000000..dd04f99 --- /dev/null +++ b/src/app/services/service_module_helper.rb @@ -0,0 +1,34 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + + +# This module is used to bootstrap testing for the service api, +# which depends on certain methods existing in the class which includes it. +# Clearly this is not the case with unit tests on the modules themselves, +# so any dependencies are set up here. +module ServiceModuleHelper + + def get_login_user + return @user + end + + def set_login_user(user=nil) + @user = user + end +end \ No newline at end of file diff --git a/src/app/services/vm_service.rb b/src/app/services/vm_service.rb index 3d9777c..073b819 100644 --- a/src/app/services/vm_service.rb +++ b/src/app/services/vm_service.rb @@ -211,13 +211,42 @@ module VmService # VmTask.action_privilege(@action) def svc_vm_action(id, vm_action, action_args) @vm = Vm.find(id) + unless @vm.valid_action?(vm_action) + raise ActionError.new("#{vm_action} is an invalid action.") + end authorized!(VmTask.action_privilege(vm_action), VmTask.action_privilege_object(vm_action, at vm)) @task = @vm.queue_action(@user, vm_action, action_args) unless @task - raise ActionError.new("#{vm_action} is an invalid action.") + raise ActionError.new("#{vm_action} cannot be performed on this vm.") + end + return "#{@vm.description}: #{vm_action} was successfully queued." + end + + # Perform action +vm_action+ on vms identified by +vm_id+ + # + # === Instance variables + # * @vms VMs identified by +vm_ids+ + # === Required permissions + # permission is action-specific as determined by + # VmTask.action_privilege(@action) + # This method can be called to initiate an action on one or more vms + def svc_vm_actions(vm_ids, vm_action, action_args) + vm_ids = [vm_ids] unless vm_ids.is_a?(Array) + successful_vms = [] + failed_vms = {} + vm_ids.each do |vm_id| + begin + successful_vms << svc_vm_action(vm_id, vm_action, action_args) + rescue Exception => ex + failed_vms[@vm.description] = ex.message + end + end + unless failed_vms.empty? + raise PartialSuccessError.new("Your request to #{vm_action} encountered the following errors: ", + failed_vms, successful_vms) end - return "#{vm_action} was successfully queued." + return "#{vm_action} submitted." end # Cancels queued tasks for for Vm with +id+ diff --git a/src/test/fixtures/permissions.yml b/src/test/fixtures/permissions.yml index 4895f3e..eed95fd 100644 --- a/src/test/fixtures/permissions.yml +++ b/src/test/fixtures/permissions.yml @@ -35,5 +35,9 @@ ovirtadmin_prodops_pool: ovirtadmin_corp_com_qa_pool: role: monitor uid: ovirtadmin - pool: corp_com_qa + pool: corp_qa_vmpool parent_permission: ovirtadmin_root +testuser_corp_com_qa_pool: + role: user + uid: testuser + pool: corp_qa_vmpool diff --git a/src/test/fixtures/vms.yml b/src/test/fixtures/vms.yml index 69b1c2b..b2711b2 100644 --- a/src/test/fixtures/vms.yml +++ b/src/test/fixtures/vms.yml @@ -65,6 +65,19 @@ foobar_prod1_vm: boot_device: cdrom host: fedoraworkstation_foobar_com vm_resource_pool: corp_com_production_vmpool +corp_com_qa_postgres_vm: + uuid: f6059569-a81f-4728-bb61-6f16b1c594e7 + description: corp.com qa postgres vm + num_vcpus_allocated: 2 + num_vcpus_used: 2 + memory_allocated: 262144 + memory_used: 131072 + vnic_mac_addr: 00:16:3e:04:de:c8 + state: running + needs_restart: 0 + boot_device: hd + host: macworkstation_qa_corp_com + vm_resource_pool: corp_qa_vmpool foobar_prod2_vm: uuid: 24b9a994-d415-481d-ace8-1d810b601eb6 description: foobar prod2 diff --git a/src/test/unit/vm_service_test.rb b/src/test/unit/vm_service_test.rb new file mode 100644 index 0000000..7bd00ad --- /dev/null +++ b/src/test/unit/vm_service_test.rb @@ -0,0 +1,149 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + + +require File.dirname(__FILE__) + '/../test_helper' + +class VmServiceTest < ActiveSupport::TestCase + + include ServiceModuleHelper + include VmService + fixtures :vms + + def setup + set_login_user('ovirtadmin') + end + + # Ensure correct message is returned for a valid action requested + # by a user with the proper permissions + def test_svc_vm_action_valid_user + assert_equal("#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued.", + svc_vm_action(vms(:production_mysqld_vm).id, 'shutdown_vm', nil)) + end + + # Ensure that if a non-existant action is passed in, ActionError + # is thrown + def test_svc_vm_action_invalid_action + assert_raise ActionError do + svc_vm_action(vms(:production_httpd_vm).id, 'stop_vm', nil) + end + end + + # Ensure that if a user with the wrong permissions is passed in, + # PermissionError is thrown + def test_svc_vm_action_invalid_user + set_login_user('fred') + assert_raise PermissionError do + svc_vm_action(vms(:production_mysqld_vm).id, 'shutdown_vm', nil) + end + end + + # Ensure that if an invalid state change for a vm is requested, + # ActionError is thrown + def test_svc_vm_action_invalid_state_change + assert_raise ActionError do + svc_vm_action(vms(:production_httpd_vm).id, 'shutdown_vm', nil) + end + end + + # If only one vm was passed into svc_vm_actions, and that action cannot + # be performed, ActionError should be returned + def test_failed_single_vm_returns_partial_success_error + assert_raise PartialSuccessError do + svc_vm_actions(vms(:production_httpd_vm).id, 'shutdown_vm', nil) + end + end + + # If multiple vms were passed into svc_vm_actions, and one or more (but + # not all) actions cannot be performed, PartialSuccessError should be returned + def test_failed_multiple_vms_return_partial_success + assert_raise PartialSuccessError do + svc_vm_actions([vms(:production_httpd_vm).id, + vms(:production_mysqld_vm).id, + vms(:production_ftpd_vm).id], 'shutdown_vm', nil) + end + end + + # Ensure we receive the expected success message if all actions succeed + # (should be the same message if one or more, so we have one test for + # each of those cases) + def test_success_message_from_single_vm + assert_equal("shutdown_vm successful.", + svc_vm_actions(vms(:production_mysqld_vm).id, 'shutdown_vm', nil)) + end + + # Ensure we receive the expected success message if all actions succeed + # (should be the same message if one or more, so we have one test for + # each of those cases) + def test_success_message_for_multiple_vms + assert_equal("shutdown_vm successful.", + svc_vm_actions([vms(:production_postgresql_vm).id, + vms(:production_mysqld_vm).id, + vms(:foobar_prod1_vm).id], 'shutdown_vm', nil)) + end + + # Ensure that if a non-existant action is passed in, PartialSuccessError + # is thrown + def test_svc_vm_actions_invalid_action + assert_raise PartialSuccessError do + svc_vm_actions(vms(:production_httpd_vm).id, 'stop_vm', nil) + end + end + + # Ensure we receive the expected success message if all actions succeed + # (should be the same message if one or more, so we have one test for + # each of those cases) + def test_success_message_from_single_vm_with_less_privileged_user + set_login_user('testuser') + assert_equal("shutdown_vm successful.", + svc_vm_actions(vms(:corp_com_qa_postgres_vm).id, 'shutdown_vm', nil)) + end + + # Ensure that if a user with the wrong permissions is passed in, + # PartialSuccessError is thrown. This allows some vms to still pass + # while others with wrong perms fail. + def test_svc_vm_actions_invalid_user + set_login_user('testuser') + assert_raise PartialSuccessError do + svc_vm_actions([vms(:corp_com_qa_postgres_vm).id, + vms(:production_mysqld_vm).id], 'shutdown_vm', nil) + end + end + + # Ensure that if a user with the wrong permissions is passed in, + # PartialSuccessError contains the message of success and permission error. + def test_error_for_svc_vm_actions_invalid_user + set_login_user('testuser') + actual_error = nil + expected_error = PartialSuccessError.new( + "Your request to shutdown_vm encountered the following errors: ", + {vms(:production_mysqld_vm).description => "You have insufficient privileges to perform action."}, + ["#{vms(:corp_com_qa_postgres_vm).description}: shutdown_vm was successfully queued."]) + + begin + svc_vm_actions([vms(:corp_com_qa_postgres_vm).id, + vms(:production_mysqld_vm).id], 'shutdown_vm', nil) + rescue Exception => ex + actual_error = ex + end + assert_equal expected_error.message, actual_error.message + assert_equal expected_error.failures, actual_error.failures + assert_equal expected_error.successes, actual_error.successes + end +end diff --git a/src/test/unit/vm_task_test.rb b/src/test/unit/vm_task_test.rb new file mode 100644 index 0000000..39be915 --- /dev/null +++ b/src/test/unit/vm_task_test.rb @@ -0,0 +1,38 @@ +# +# Copyright (C) 2009 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + + +require File.dirname(__FILE__) + '/../test_helper' + +class VmTaskTest < ActiveSupport::TestCase + + fixtures :vms + + # Ensure action_privilege method returns nil if it is passed an action + # that does not exist. + def test_action_privilege_with_bad_action + assert_equal(nil, VmTask.action_privilege('stop_vm')) + end + + # Ensure action_privilege_object method returns nil if it is passed an action + # that does not exist. + def test_action_privilege_object_with_bad_action + assert_equal(nil, VmTask.action_privilege_object('stop_vm', vms(:production_httpd_vm).id)) + end +end diff --git a/src/test/unit/vm_test.rb b/src/test/unit/vm_test.rb index 5e03715..a5d6b3d 100644 --- a/src/test/unit/vm_test.rb +++ b/src/test/unit/vm_test.rb @@ -1,6 +1,7 @@ # # Copyright (C) 2008 Red Hat, Inc. -# Written by Scott Seago +# Written by Scott Seago , +# Jason Guiditta # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +20,7 @@ require File.dirname(__FILE__) + '/../test_helper' -class VmTest < Test::Unit::TestCase +class VmTest < ActiveSupport::TestCase fixtures :vms fixtures :pools @@ -173,6 +174,24 @@ class VmTest < Test::Unit::TestCase assert_equal 'stopped', vms(:production_httpd_vm).get_pending_state end + def test_get_action_list_with_no_user + empty_array = [] + assert_equal(empty_array, vms(:production_httpd_vm).get_action_list) + end + + def test_queue_action_returns_false_with_invalid_action + assert_equal(false, vms(:production_httpd_vm).queue_action('ovirtadmin', 'stop_vm')) + end + + def test_valid_action_with_invalid_param + assert_equal(false, vms(:production_httpd_vm).valid_action?('stop_vm')) + end + + # Ensure valid_action? returns true + def test_valid_action_with_valid_param + assert_equal(true, vms(:production_httpd_vm).valid_action?('shutdown_vm')) + end + def test_paginated_results assert_equal 5, Vm.paged_with_perms('ovirtadmin', Privilege::VIEW, 1, 'vms.id').size end -- 1.6.0.6 From jguiditt at redhat.com Mon Jun 29 18:24:05 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Mon, 29 Jun 2009 14:24:05 -0400 Subject: [Ovirt-devel] [PATCH server] Cloud UI layer to initiate actions on vms. In-Reply-To: <1246299845-20697-1-git-send-email-jguiditt@redhat.com> References: <1246299845-20697-1-git-send-email-jguiditt@redhat.com> Message-ID: <1246299845-20697-3-git-send-email-jguiditt@redhat.com> Signed-off-by: Jason Guiditta --- src/app/controllers/cloud/cloud_controller.rb | 20 +++++- src/app/controllers/cloud/instance_controller.rb | 25 +++---- src/app/views/cloud/instance/_show.rhtml | 1 - src/app/views/cloud/instance/index.rhtml | 30 +++++--- src/app/views/layouts/cloud/_notification.rhtml | 31 ++++++++ src/public/stylesheets/cloud/layout.css | 73 +++++++++++++++++++- .../functional/cloud/instance_controller_test.rb | 65 +++++++++++++++++- 7 files changed, 214 insertions(+), 31 deletions(-) create mode 100644 src/app/views/layouts/cloud/_notification.rhtml diff --git a/src/app/controllers/cloud/cloud_controller.rb b/src/app/controllers/cloud/cloud_controller.rb index 154d15d..19c56b6 100644 --- a/src/app/controllers/cloud/cloud_controller.rb +++ b/src/app/controllers/cloud/cloud_controller.rb @@ -26,9 +26,27 @@ class Cloud::CloudController < ApplicationController protected + # Override the default in ApplicationController, cloud has its own + # template for rendering these errors + def html_error_page(title, msg) + flash[:error] = msg + redirect_to params + end + + # Override the default in ApplicationController, cloud has its own + # way of handling these (hooked into VmService::svc_vm_actions + def handle_partial_success_error(error) + handle_error(:error => error, :status => :ok, + :message => {:summary => error.message, + :failures => error.failures, + :successes => error.successes}, + :title => "Some actions failed") + end # NOTE: This probably will/should be moved to use set_perms in - # ApplicationService once that is ready to go. + # ApplicationService once that is ready to go. Only problem with that + # idea is that there is currently no before filter to make sure that + # gets called. def set_vars @user = get_login_user end diff --git a/src/app/controllers/cloud/instance_controller.rb b/src/app/controllers/cloud/instance_controller.rb index a4d0fd8..130f30b 100644 --- a/src/app/controllers/cloud/instance_controller.rb +++ b/src/app/controllers/cloud/instance_controller.rb @@ -44,7 +44,7 @@ class Cloud::InstanceController < Cloud::CloudController task_order = find_in_params_or_default(:task_order, "tasks.id") @vm_details = Vm.find(ids) if ids if @vm_details - @tasks = VmTask.paginate(:conditions => ["task_target_id in (:ids)",{:ids => ids}], + @tasks = VmTask.paginate(:include => :vm, :conditions => ["task_target_id in (:ids)",{:ids => ids}], :per_page => 5, :page => task_page, :order => task_order) end end @@ -76,19 +76,18 @@ class Cloud::InstanceController < Cloud::CloudController return params[key] && params[key] != "" ? params[key] : default end -# This redirects the user to a get url if they are just trying to view details for one or more -# instances. -# TODO: if the user is trying to submit an acton on selected instances, call the service -# layer and display the :flash (might still want to do :get redirect to keep pagination/sorting -# correct. +# This implements the Post/Redirect/Get pattern, and redirects the user to +# a get url so an action is not accidentally posted twice. def handle_form - case params[:submit_for_list] - when "Show Selected" - params.delete(:submit_for_list) - redirect_to :action => "index", :params => params - return -# Do this if we have submitted an action on one or more vms. -# svc_vm_action(params[:ids], params[:vm_action], params[:action_args]) + if params[:submit_for_list] + submit_type = params[:submit_for_list] + params.delete(:submit_for_list) + if params[:ids].nil? + flash[:warning] = "You must select at least one instance to perform an action." + elsif submit_type != "Show Selected" + flash[:notice] = svc_vm_actions(params[:ids], submit_type.downcase << '_vm', params[:action_args]) + end + redirect_to params end end diff --git a/src/app/views/cloud/instance/_show.rhtml b/src/app/views/cloud/instance/_show.rhtml index 001286e..186c4ba 100644 --- a/src/app/views/cloud/instance/_show.rhtml +++ b/src/app/views/cloud/instance/_show.rhtml @@ -1,7 +1,6 @@
        <%= submit_tag 'Show Selected', :id => 'submit_for_list', :name => 'submit_for_list' %> - <% if @vm_details %>

        <% if @vm_details.size == 1 %> diff --git a/src/app/views/cloud/instance/index.rhtml b/src/app/views/cloud/instance/index.rhtml index 757d67c..a787e39 100644 --- a/src/app/views/cloud/instance/index.rhtml +++ b/src/app/views/cloud/instance/index.rhtml @@ -1,23 +1,29 @@ +
        -
        • New Instance
        • Actions -
            - <% @actions.each {|action| %> -
          • <%= image_tag action[2]%><%= action[0] %>
          • - <% } %> -
          + <%=%> +
            + <% @actions.each {|action| %> + +
          • + <%= image_tag action[2]%> + <%= submit_tag action[0], :name => 'submit_for_list', :class => 'button_as_link' %> +
          • + <% } %> +
        - <%# This form tag is terminated in _show.rhtml %>
        - <%= render :partial => 'list' %> + <% if !flash.empty? %> + <%= render :partial => '/layouts/cloud/notification' %> + <% end %> + <%= render :partial => 'list' %>
        - <%= render :partial => 'show' %> -
        \ No newline at end of file + <%= render :partial => 'show' %> +

        + \ No newline at end of file diff --git a/src/app/views/layouts/cloud/_notification.rhtml b/src/app/views/layouts/cloud/_notification.rhtml new file mode 100644 index 0000000..d90d827 --- /dev/null +++ b/src/app/views/layouts/cloud/_notification.rhtml @@ -0,0 +1,31 @@ +
        class="error-align"<%end%>"> + <%= link_to "", params, :id => "close-notify" %> + <% if flash[:error] %> + <% if !nil_or_empty(flash[:error][:successes]) %> +
        +

        The following items were successful:

        +
          + <% flash[:error][:successes].each {|item| %> +
        • <%= item %>
        • + <% } %> +
        +
        + <% end %> + <% if !nil_or_empty(flash[:error][:failures]) %> +

        <%= flash[:error][:summary]%>

        +
        +
          + <% flash[:error][:failures].each {|key, value| %> +
        • <%= key %>: <%= value %>
        • + <% } %> +
        +
        + <% end %> + <% end %> + <% if flash[:warning] %> +

        <%= flash[:warning] %>

        + <% end %> + <% if flash[:notice] %> +
        • <%= flash[:notice] %>
        + <% end %> +
        \ No newline at end of file diff --git a/src/public/stylesheets/cloud/layout.css b/src/public/stylesheets/cloud/layout.css index 0fd158d..1d1fa07 100644 --- a/src/public/stylesheets/cloud/layout.css +++ b/src/public/stylesheets/cloud/layout.css @@ -28,6 +28,14 @@ html {min-width:640px;} color: #337ACC; } +/* Make buttons look like links */ +.button_as_link { + background: none; + color: #666666; + border: none; + cursor: pointer; +} + #navcontainer { height:40px; } @@ -205,8 +213,10 @@ input#submit_for_list { #toolbar li:hover { background: #337ACC; +} + +#toolbar li:hover > .button_as_link { color: #FFFFFF; - cursor: pointer; } #toolbar li.current { /* This is not really needed right now, but will be useful when we add filters. */ @@ -234,3 +244,64 @@ input#submit_for_list { } #toolbar li:hover ul {display: block;} + +/****** Notification styles ******/ +#notification { + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; + position: absolute; + z-index: 1; + top: 2em; + left: 35%; + margin: 0 auto; + padding: 1.5em; + background: #337ACC; + border: solid 0.2em; +} + +.error-align {left: 25% !important;} + +#notification > div { + margin-bottom: 1em; +} + +#notification h4 { + text-indent: 3em; +} + +#close-notify { + position: absolute; + right: 0.2em; + top: 0.2em; + width:11px; + height:11px; + background: url(/images/closebox-11px.png) no-repeat; +} + +.success { + width: 100%; + background:url(/images/icon_conf_success.png) left center no-repeat #CCFFCC; + border: solid 0.2em green; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} + +.success li, .error li { + margin-left:3em; +} + +.error { + width: 100%; + background:url(/images/icon_conf_error.png) left center no-repeat #EC9999; + border: solid 0.2em red; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} + +.warning { + width: 100%; + background:url(/images/icon_conf_warning.png) left center no-repeat #FFFFCC; + border: solid 0.2em yellow; + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; +} diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb index 213d2e0..71d132b 100644 --- a/src/test/functional/cloud/instance_controller_test.rb +++ b/src/test/functional/cloud/instance_controller_test.rb @@ -1,6 +1,27 @@ -require 'test_helper' +# +# Copyright (C) 2008 Red Hat, Inc. +# Written by Jason Guiditta +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +require File.dirname(__FILE__) + '/../../test_helper' class Cloud::InstanceControllerTest < ActionController::TestCase + + include ServiceModuleHelper fixtures :vms, :tasks def setup @controller = Cloud::InstanceController.new @@ -14,10 +35,48 @@ class Cloud::InstanceControllerTest < ActionController::TestCase assert_template 'index' assert_not_nil assigns(:vms) assert_not_nil assigns(:user) + assert_equal({}, flash, "flash object is not empty!") + assert_equal(true, flash.empty?) + assert_select "#notification", false, "This page must contain no notification block" end - def test_should_redirect_if_request_for_selected + def test_should_redirect_if_form_submitted post(:index,{:submit_for_list => 'Show Selected'}) - assert_response :redirect + assert_redirected_to :action => :index + #TODO: since this is a redirect, it returns a 302 and nil template, + # would be good to figure out how to get the actual result returned to + # browser so we can do an assert_select + end + + def test_add_valid_task + post(:index,{:submit_for_list => 'Shutdown', :ids => [vms(:production_mysqld_vm).id]}) + assert_equal('shutdown_vm successful.', flash[:notice]) + assert_redirected_to :action => :index, :ids => vms(:production_mysqld_vm).id + end + + def test_add_invalid_task + post(:index,{:submit_for_list => 'Shutdown', + :ids => [vms(:production_mysqld_vm).id,vms(:production_httpd_vm).id]}) + expected_failures = {:summary => "Your request to shutdown_vm encountered the following errors: ", + :failures => {vms(:production_httpd_vm).description => "shutdown_vm cannot be performed on this vm."}, + :successes => ["#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued."]} + assert_equal(expected_failures, flash[:error]) + assert_redirected_to :action => :index, :ids => [vms(:production_mysqld_vm).id,vms(:production_httpd_vm).id] + end + + def test_add_task_no_perms_for_some_vms + post(:index,{:submit_for_list => 'Shutdown', + :ids => [vms(:production_mysqld_vm).id,vms(:corp_com_qa_postgres_vm).id]}) + expected_failures = {:summary => "Your request to shutdown_vm encountered the following errors: ", + :failures => {vms(:corp_com_qa_postgres_vm).description => "You have insufficient privileges to perform action."}, + :successes => ["#{vms(:production_mysqld_vm).description}: shutdown_vm was successfully queued."]} + assert_equal(expected_failures, flash[:error]) + assert_redirected_to :action => :index, :ids => [vms(:production_mysqld_vm).id,vms(:corp_com_qa_postgres_vm).id] + end + + # Make sure we get warning back if no instance was chosen to perform an action on. + def test_no_instance_chosen + post(:index,{:submit_for_list => 'Shutdown'}) + assert_equal("You must select at least one instance to perform an action.", flash[:warning]) end end -- 1.6.0.6 From dpierce at redhat.com Tue Jun 30 18:32:46 2009 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 30 Jun 2009 14:32:46 -0400 Subject: [Ovirt-devel] [PATCH node] Make all yes/no prompts consistent. rhbz#508778 Message-ID: <1246386766-4854-1-git-send-email-dpierce@redhat.com> Added a new function, "ask_yes_or_no", to ovirt-functions. It contains a default prompt if none is provided. Changed all prompts that ask for yes, no and/or abort to use this new method. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-boot-wrapper | 8 ++--- scripts/ovirt-config-collectd | 39 +++++++++++++++----------- scripts/ovirt-config-logging | 45 ++++++++++++++++-------------- scripts/ovirt-config-networking | 55 +++++++++++++++++++----------------- scripts/ovirt-config-storage | 30 ++++++++------------ scripts/ovirt-config-uninstall | 4 +-- scripts/ovirt-functions | 18 ++++++++++++ 7 files changed, 109 insertions(+), 90 deletions(-) diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper index ff6f6e5..4ce9969 100755 --- a/scripts/ovirt-config-boot-wrapper +++ b/scripts/ovirt-config-boot-wrapper @@ -24,14 +24,12 @@ continuing." else bootparams="${OVIRT_BOOTPARAMS}" fi - read -p "Do you wish to continue (Y/n)? " - r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]') - if [ "$r" == "Y" ]; then + if ask_yes_or_no; then mount_live \ - && /usr/sbin/ovirt-config-boot /live "${bootparams}" + && /usr/sbin/ovirt-config-boot /live "${bootparams}" rc=$? break - elif [ "$r" == "N" ]; then + else printf "\nExiting back to the menu\n" rc=99 break diff --git a/scripts/ovirt-config-collectd b/scripts/ovirt-config-collectd index 236ddaa..11811fd 100755 --- a/scripts/ovirt-config-collectd +++ b/scripts/ovirt-config-collectd @@ -67,23 +67,28 @@ prompt_user() { printf "\n" printf "\n" while true; do - read -p "Is this correct (Y/N/A)? " - r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]') - if [ "$r" == "Y" ]; then - printf "\nSaving configuration.\n" - if [[ -n "$collectd_server_ip" ]] && - [[ -n "$collectd_server_port" ]]; then - ovirt_collectd $collectd_server_ip \ - $collectd_server_port - fi - return - elif [ "$r" == "N" ]; then - printf "\nRestarting collectd configuration.\n" - break - elif [ "$r" == "A" ]; then - printf "\nAborting collectd configuration.\n" - return - fi + ask_yes_or_no "Is this correct (y/n/a)?" + rc=$? + case $rc in + 0) + printf "\nSaving configuration.\n" + if [[ -n "$collectd_server_ip" ]] && + [[ -n "$collectd_server_port" ]]; then + ovirt_collectd $collectd_server_ip \ + $collectd_server_port + fi + return + ;; + + 1) + printf "\nRestarting collectd configuration.\n" + break + ;; + 2) + printf "\nAborting collectd configuration.\n" + return + ;; + esac done done } diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging index ba661c3..bb0f082 100755 --- a/scripts/ovirt-config-logging +++ b/scripts/ovirt-config-logging @@ -146,27 +146,30 @@ function prompt_user { printf "\n" printf "\n" while true; do - read -p "Is this correct (Y/N/A)? " - r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]') - if [ "$r" == "Y" ]; then - printf "\nSaving configuration.\n" - if [[ -n "$syslog_server_ip" ]] && - [[ -n "$syslog_server_port" ]] && - [[ -n "$syslog_server_protocol" ]]; then - ovirt_rsyslog $syslog_server_ip \ - $syslog_server_port \ - $syslog_server_protocol - fi - sed -c -i -e "s/^size=.*/size=${max_log_size}k/" \ - /etc/logrotate.d/ovirt-logrotate.conf - return - elif [ "$r" == "N" ]; then - printf "\nRestarting logging configuration.\n" - break - elif [ "$r" == "A" ]; then - printf "\nAborting logging configuration.\n" - return - fi + ask_yes_or_no "Is this correct (y/n/a)?" + case $? in + 0) + printf "\nSaving configuration.\n" + if [[ -n "$syslog_server_ip" ]] && + [[ -n "$syslog_server_port" ]] && + [[ -n "$syslog_server_protocol" ]]; then + ovirt_rsyslog $syslog_server_ip \ + $syslog_server_port \ + $syslog_server_protocol + fi + sed -c -i -e "s/^size=.*/size=${max_log_size}k/" \ + /etc/logrotate.d/ovirt-logrotate.conf + return + ;; + 1) + printf "\nRestarting logging configuration.\n" + break + ;; + 2) + printf "\nAborting logging configuration.\n" + return + ;; + esac done done } diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index d29bd12..713cabc 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -40,10 +40,12 @@ function configure_interface if [[ -n "${CONFIGURED_NIC}" ]]; then printf "This will delete the current configuration for ${CONFIGURED_NIC}.\n" - read -ep "Continue? (y/N) " - case $REPLY in - N|n) printf "\nAborting...\n"; return;; - esac + if ask_yes_or_no; then + printf "\nDeleting existing network configuration...\n" + else + printf "\nAborting...\n" + return + fi fi rm -rf $WORKDIR/* @@ -79,12 +81,9 @@ function configure_interface fi echo "NIC is: $NICSTATUS" - read -ep "Help identify $NIC by blinking lights for 10 seconds ([Y]es/[N]o)?" - case $REPLY in - Y|y) - ethtool --identify $NIC 10 - ;; - esac + if ask_yes_or_no "Help identify ${NIC} by blinking lights for 10 seconds (y/n)?"; then + ethtool --identify $NIC 10 + fi read -ep "Enable IPv4 support ([S]tatic IP, [D]HCP, [N]o or [A]bort)? " case $REPLY in @@ -129,18 +128,22 @@ function configure_interface esac printf "\n" - read -ep "Is this correct (Y/N/A)? " - case $REPLY in - Y|y) - IF_CONFIG="$IF_CONFIG\nset $IF_ROOT/ONBOOT yes" - BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/ONBOOT yes" - - printf "$IF_CONFIG\n" > $IF_FILENAME - printf "$BR_CONFIG\n" > $BR_FILENAME - break + ask_yes_or_no "Is this correct (y/n/a)?" + case $? in + 0) + IF_CONFIG="$IF_CONFIG\nset $IF_ROOT/ONBOOT yes" + BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/ONBOOT yes" + printf "$IF_CONFIG\n" > $IF_FILENAME + printf "$BR_CONFIG\n" > $BR_FILENAME + break + ;; + 1) + BR_CONFIG=$BR_CONFIG_BASE + ;; + 2) + CONFIGURED_NIC="" + return ;; - N|n) BR_CONFIG=$BR_CONFIG_BASE ;; - A|a) CONFIGURED_NIC=""; return;; esac done else @@ -220,11 +223,11 @@ function configure_dns fi printf "\n" - read -ep "Is this correct (Y/N/A)? " - case $REPLY in - Y|y) break ;; - N|n) ;; - A|a) return ;; + ask_yes_or_no "Is this correct (y/n/a)?" + case $? in + 0) break ;; + 1) ;; + 2) return ;; esac done fi diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 41177a4..2e523df 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -208,11 +208,9 @@ do_configure() printf " partition should use up the remaining space on the disk.\n\n" do_review - read -ep "Use these default values? (Y/n) " - - case $REPLY in - Y|y) return;; - esac + if ask_yes_or_no "Use these default values (y/n)?"; then + return + fi local space_left=$SPACE for part in boot swap root config logging data ; do @@ -474,19 +472,15 @@ do_confirm() "$wb$sp$w" \ "$w8" \ "$w8" - printf "\n\tContinue? (Y/n) " - read -e - case $REPLY in - Y|y) - if check_partition_sizes; then - perform_partitioning - exit 0 - fi - break - ;; - N|n) return ;; - *) ;; - esac + + if ask_yes_or_no; then + if check_partition_sizes; then + perform_partitioning + exit 0 + fi + else + return + fi done } diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 59661de..60ecf71 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -27,9 +27,7 @@ cat < - db, model, service, controller, and view changes - many tests additions - various fixes / cleanup to get things working depends on my last two (still unacked) patches: - add collapsable sections to vm form - provide default vm allocated cpu and memory values ovirt-agent might need to be updated to work with the changes --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/vm_controller.rb | 54 ++++++- src/app/helpers/application_helper.rb | 4 +- src/app/models/network.rb | 2 - src/app/models/nic.rb | 54 +++++-- src/app/models/vlan.rb | 15 ++- src/app/models/vm.rb | 17 ++- src/app/services/network_service.rb | 12 +- src/app/services/nic_service.rb | 2 +- src/app/services/vm_service.rb | 39 +++--- src/app/views/host/show.rhtml | 2 +- src/app/views/network/_select.rhtml | 2 +- src/app/views/network/edit_nic.rhtml | 4 +- src/app/views/nic/show.rhtml | 2 + src/app/views/task/_user_list.rhtml | 2 +- src/app/views/vm/_form.rhtml | 217 ++++++++++++++++++++++++- src/app/views/vm/_grid.rhtml | 1 - src/app/views/vm/_list.rhtml | 2 - src/app/views/vm/show.rhtml | 6 +- src/db/migrate/040_associate_vms_with_nics.rb | 103 ++++++++++++ src/public/stylesheets/components.css | 39 +++++ src/task-omatic/task_vm.rb | 14 +- src/task-omatic/taskomatic.rb | 43 +++--- src/test/fixtures/nics.yml | 16 +- src/test/fixtures/vms.yml | 8 - src/test/unit/network_test.rb | 69 ++++++++- src/test/unit/nic_test.rb | 95 +++++++++++- src/test/unit/vm_test.rb | 14 +- 28 files changed, 710 insertions(+), 130 deletions(-) create mode 100644 src/db/migrate/040_associate_vms_with_nics.rb diff --git a/src/app/controllers/pool_controller.rb b/src/app/controllers/pool_controller.rb index 74a958c..0d2e491 100644 --- a/src/app/controllers/pool_controller.rb +++ b/src/app/controllers/pool_controller.rb @@ -96,7 +96,7 @@ class PoolController < ApplicationController def vms_json(args) attr_list = [:id, :description, :uuid, :num_vcpus_allocated, :memory_allocated_in_mb, - :vnic_mac_addr, :state, :id] + :state, :id] if (@pool.is_a? VmResourcePool) and @pool.get_hardware_pool.can_view(@user) attr_list.insert(3, [:host, :hostname]) end diff --git a/src/app/controllers/vm_controller.rb b/src/app/controllers/vm_controller.rb index 197241d..2c0079c 100644 --- a/src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -55,29 +55,31 @@ class VmController < ApplicationController def new alert = svc_new(params[:vm_resource_pool_id]) _setup_provisioning_options + _setup_network_options @storage_tree = VmResourcePool.find(params[:vm_resource_pool_id]).get_hardware_pool.storage_tree.to_json - @networks = Network.find(:all).collect{ |net| [net.name, net.id] } render :layout => 'popup' end def create params[:vm][:forward_vnc] = params[:forward_vnc] - alert = svc_create(params[:vm], params[:start_now]) + _parse_network_params(params) + alert = svc_create(params[:vm], params[:start_now], params[:nics]) render :json => { :object => "vm", :success => true, :alert => alert } end def edit svc_modify(params[:id]) _setup_provisioning_options - @networks = Network.find(:all).collect{ |net| [net.name, net.id] } + _setup_network_options @storage_tree = @vm.vm_resource_pool.get_hardware_pool.storage_tree(:vm_to_include => @vm).to_json render :layout => 'popup' end def update params[:vm][:forward_vnc] = params[:forward_vnc] + _parse_network_params(params) alert = svc_update(params[:id], params[:vm], params[:start_now], - params[:restart_now]) + params[:restart_now], params[:nics]) render :json => { :object => "vm", :success => true, :alert => alert } end @@ -164,4 +166,48 @@ class VmController < ApplicationController #if cobbler doesn't respond/is misconfigured/etc just don't add profiles end end + + # sets up a list of nics for the vm form + def _setup_network_options + net_conditions = "" + @nics = [] + + unless @vm.nil? + @vm.nics.each { |nic| + nnic = Nic.new(:mac => nic.mac, + :vm_id => @vm.id, + :network => nic.network) + if(nic.network.boot_type.proto == 'static') + nnic.ip_addresses << IpAddress.new(:address => nic.ip_address) + end + @nics.push nnic + + net_conditions += (net_conditions == "" ? "" : " AND ") + + "id != " + nic.network_id.to_s + } + end + + networks = Network.find(:all, :conditions => net_conditions) + + networks.each{ |net| + nnic = Nic.new(:mac => Nic::gen_mac, :network => net) + if(net.boot_type.proto == 'static') + nnic.ip_addresses << IpAddress.new(:address => '127.0.0.1') # FIXME + end + @nics.push nnic + } + + end + + # merges vm / network parameters as submitted on the vm form + def _parse_network_params(params) + params[:nics] = [] + unless params[:networks].nil? + params[:networks].each { |network, id| + params[:nics].push({ :mac => params[("nic_"+network.to_s).intern], + :network_id => network, + :bandwidth => 0}) + } + end + end end diff --git a/src/app/helpers/application_helper.rb b/src/app/helpers/application_helper.rb index d3eecd7..79d835c 100644 --- a/src/app/helpers/application_helper.rb +++ b/src/app/helpers/application_helper.rb @@ -78,9 +78,9 @@ module ApplicationHelper end # same as check_box_tag_with_label but w/ the checkbox appearing first - def rcheck_box_tag_with_label(label, name, value = "1", checked = false) + def rcheck_box_tag_with_label(label, name, value = "1", checked = false, opts={}) %{ -
        #{check_box_tag name, value, checked} +
        #{check_box_tag name, value, checked, opts}
        } end diff --git a/src/app/models/network.rb b/src/app/models/network.rb index 0e2aa8c..a4b1b8b 100644 --- a/src/app/models/network.rb +++ b/src/app/models/network.rb @@ -22,8 +22,6 @@ 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 e8b7768..f03c525 100644 --- a/src/app/models/nic.rb +++ b/src/app/models/nic.rb @@ -19,7 +19,10 @@ class Nic < ActiveRecord::Base belongs_to :host - belongs_to :physical_network + belongs_to :vm + + belongs_to :network + has_many :ip_addresses, :dependent => :destroy # FIXME bondings_nics table should just be replaced with @@ -33,24 +36,31 @@ class Nic < ActiveRecord::Base validates_format_of :mac, :with => %r{^([0-9a-fA-F]{2}([:-]|$)){6}$} - validates_presence_of :host_id, - :message => 'A host must be specified.' + # nic must be assigned to network if associated w/ a vm + validates_presence_of :network_id, + :unless => Proc.new { |nic| nic.vm.nil? } + + # nic must be associated w/ a vm if assigned to a vlan + validates_presence_of :vm_id, + :message => 'A vm must be specified.', + :if => Proc.new { |nic| !nic.network.nil? && nic.network.class == Vlan } + + # a vm / host can't have more than one nic on a network + validates_uniqueness_of :network_id, + :scope => [:host_id, :vm_id], + :unless => Proc.new { |nic| nic.network.nil? } 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? } - # Returns whether the nic has networking defined. def networking? - (physical_network != nil) + (network != nil) end # Returns the boot protocol for the nic if networking is defined. def boot_protocol - return physical_network.boot_type.proto if networking? + return network.boot_type.proto if networking? end # Returns whether the nic is enslaved by a bonded interface. @@ -66,30 +76,44 @@ class Nic < ActiveRecord::Base # Returns the netmask for the nic if networking is defined. def netmask - return physical_network.ip_addresses.first.netmask if networking? && !physical_network.ip_addresses.empty? + return network.ip_addresses.first.netmask if networking? && !network.ip_addresses.empty? return nil end # Returns the broadcast address for the nic if networking is defined. def broadcast - return physical_network.ip_addresses.first.broadcast if networking? && !physical_network.ip_addresses.empty? + return network.ip_addresses.first.broadcast if networking? && !network.ip_addresses.empty? return nil end # Returns the gateway address fo rthe nic if networking is defined. def gateway - return physical_network.ip_addresses.first.gateway if networking? && !physical_network.ip_addresses.empty? + return network.ip_addresses.first.gateway if networking? && !network.ip_addresses.empty? return nil end + def parent + return host if !host.nil? && vm.nil? + return vm if !vm.nil? && host.nil? + return nil + end + + def self.gen_mac + [ 0x00, 0x16, 0x3e, rand(0x7f), rand(0xff), + rand(0xff) ].collect {|x| "%02x" % x}.join(":") + end + # validate 'bridge' or 'usage_type' attribute ? protected def validate - if ! physical_network.nil? and - physical_network.boot_type.proto == 'static' and + # nic must be associated with a host or vm, but not both + errors.add("one host or one vm must be specified") unless host.nil? ^ vm.nil? + + if ! network.nil? and + network.boot_type.proto == 'static' and ip_addresses.size == 0 - errors.add("physical_network_id", + errors.add("network_id", "is static. Must create at least one static ip") end end diff --git a/src/app/models/vlan.rb b/src/app/models/vlan.rb index 2f6acba..cce897d 100644 --- a/src/app/models/vlan.rb +++ b/src/app/models/vlan.rb @@ -19,11 +19,24 @@ class Vlan < Network has_many :bondings + has_many :nics + validates_presence_of :number, :message => 'A number must be specified.' def is_destroyable? - bondings.empty? + bondings.empty? && nics.empty? end + protected + def validate + # ensure that any assigned nics only belong to vms, not hosts + nics.each{ |nic| + if nic.parent.class == Host + errors.add("nics", "must only be assigned to vms") + break + end + } + end + end diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index f445219..a5c95bd 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -29,7 +29,7 @@ class Vm < ActiveRecord::Base end has_and_belongs_to_many :storage_volumes - belongs_to :network + has_many :nics, :dependent => :destroy has_many :smart_pool_tags, :as => :tagged, :dependent => :destroy has_many :smart_pools, :through => :smart_pool_tags @@ -45,8 +45,8 @@ class Vm < ActiveRecord::Base validates_presence_of :uuid, :description, :num_vcpus_allocated, :boot_device, :memory_allocated_in_mb, - :memory_allocated, :vnic_mac_addr, - :vm_resource_pool_id + :memory_allocated, :vm_resource_pool_id + validates_format_of :uuid, :with => %r([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}) @@ -88,7 +88,7 @@ class Vm < ActiveRecord::Base :greater_than_or_equal_to => 0, :unless => Proc.new{ |vm| vm.memory_allocated.nil? } - acts_as_xapian :texts => [ :uuid, :description, :vnic_mac_addr, :state ], + acts_as_xapian :texts => [ :uuid, :description, :state ], :terms => [ [ :search_users, 'U', "search_users" ] ], :eager_load => :smart_pools @@ -111,8 +111,8 @@ class Vm < ActiveRecord::Base NEEDS_RESTART_FIELDS = [:uuid, :num_vcpus_allocated, - :memory_allocated, - :vnic_mac_addr] + :memory_allocated] + STATE_PENDING = "pending" STATE_CREATING = "creating" @@ -379,6 +379,11 @@ class Vm < ActiveRecord::Base return i end + def self.gen_uuid + ["%02x"*4, "%02x"*2, "%02x"*2, "%02x"*2, "%02x"*6].join("-") % + Array.new(16) {|x| rand(0xff) } + end + # Make method for calling paginated vms easier for clients. # TODO: Might want to have an optional param for per_page var def self.paged_with_perms(user, priv, page, order) diff --git a/src/app/services/network_service.rb b/src/app/services/network_service.rb index 3e7c997..221472d 100644 --- a/src/app/services/network_service.rb +++ b/src/app/services/network_service.rb @@ -205,13 +205,13 @@ module NetworkService def svc_modify_nic(id) authorize @nic = Nic.find(id) - @network = @nic.physical_network + @network = @nic.network network_options # 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) + @nic.parent.nics.each { |nic| + unless nic.network.nil? || nic.id == @nic.id + network_conditions.push(" id != " + nic.network.id.to_s) end } network_conditions = network_conditions.join(" AND ") @@ -228,8 +228,8 @@ module NetworkService def svc_update_nic(id, nic_hash, ip_hash) authorize network_options - unless nic_hash[:physical_network_id].to_i == 0 - @network = Network.find(nic_hash[:physical_network_id]) + unless nic_hash[:network_id].to_i == 0 + @network = Network.find(nic_hash[:network_id]) if @network.boot_type.id == @static_boot_type.id if ip_hash[:id] == "New" svc_create_ip_address(ip_hash) diff --git a/src/app/services/nic_service.rb b/src/app/services/nic_service.rb index 12314a4..b8c5ef1 100644 --- a/src/app/services/nic_service.rb +++ b/src/app/services/nic_service.rb @@ -33,7 +33,7 @@ module NicService private def lookup(id, priv) @nic = Nic.find(id) - authorized!(priv, at nic.host.hardware_pool) + authorized!(priv, (@nic.parent.class == Host ? @nic.host.hardware_pool : @nic.vm.vm_resource_pool)) end end diff --git a/src/app/services/vm_service.rb b/src/app/services/vm_service.rb index 3d9777c..24c7908 100644 --- a/src/app/services/vm_service.rb +++ b/src/app/services/vm_service.rb @@ -82,8 +82,8 @@ module VmService def svc_new(vm_resource_pool_id) raise ActionError.new("VM Resource Pool is required.") unless vm_resource_pool_id - new_vm_hash = {:vm_resource_pool_id => vm_resource_pool_id} - default_mac_and_uuid(new_vm_hash) + new_vm_hash = {:vm_resource_pool_id => vm_resource_pool_id, + :uuid => Vm::gen_uuid} @vm = Vm.new(new_vm_hash) authorized!(Privilege::MODIFY, @vm.vm_resource_pool) end @@ -94,8 +94,8 @@ module VmService # [@vm] the newly saved Vm # === Required permissions # [Privilege::MODIFY] for the vm's VmResourcePool - def svc_create(vm_hash, start_now) - default_mac_and_uuid(vm_hash) + def svc_create(vm_hash, start_now, nics) + vm_hash[:uuid] = Vm::gen_uuid unless vm_hash[:uuid] vm_hash[:state] = Vm::STATE_PENDING @vm = Vm.new(vm_hash) authorized!(Privilege::MODIFY, at vm.vm_resource_pool) @@ -103,6 +103,10 @@ module VmService alert = "VM was successfully created." Vm.transaction do @vm.save! + nics.each{ |nic| + nic[:vm_id] = @vm.id + Nic.create(nic) + } vm_provision @task = VmTask.new({ :user => @user, :task_target => @vm, @@ -129,7 +133,7 @@ module VmService # [@vm] stores the Vm with +id+ # === Required permissions # [Privilege::MODIFY] for the Vm's VmResourcePool - def svc_update(id, vm_hash, start_now, restart_now) + def svc_update(id, vm_hash, start_now, restart_now, nics) lookup(id,Privilege::MODIFY) #needs restart if certain fields are changed @@ -153,6 +157,9 @@ module VmService alert = "VM was successfully updated." Vm.transaction do + @vm.nics.clear + nics.each{ |nic| @vm.nics.push Nic.new(nic) } + @vm.update_attributes!(vm_hash) vm_provision if start_now @@ -256,10 +263,15 @@ module VmService unless system system = Cobbler::System.new("name" => name, @vm.cobbler_type => @vm.cobbler_name) - system.interfaces = [Cobbler::NetworkInterface.new( - {'mac_address' => @vm.vnic_mac_addr})] + system.interfaces = [] + # do we need to do anything if vm.nics is empty ? + @vm.nics.each { |nic| + system.interfaces.push Cobbler::NetworkInterface.new( + {'mac_address' => nic.mac}) + } system.save end + # TODO update system if found end end @@ -276,17 +288,4 @@ module VmService @vm = Vm.find(id) authorized!(priv, at vm.vm_resource_pool) end - - def default_mac_and_uuid(vm_hash) - unless vm_hash[:uuid] - vm_hash[:uuid] = ["%02x"*4, "%02x"*2, "%02x"*2, - "%02x"*2, "%02x"*6].join("-") % - Array.new(16) {|x| rand(0xff) } - end - unless vm_hash[:vnic_mac_addr] - vm_hash[:vnic_mac_addr] = [ 0x00, 0x16, 0x3e, rand(0x7f), rand(0xff), - rand(0xff) ].collect {|x| "%02x" % x}.join(":") - end - end - end diff --git a/src/app/views/host/show.rhtml b/src/app/views/host/show.rhtml index f706761..ddc6481 100644 --- a/src/app/views/host/show.rhtml +++ b/src/app/views/host/show.rhtml @@ -64,7 +64,7 @@ <%=h @host.status_str %>
        <%= @host.nics.collect{ |n| n.interface_name.to_s + " " + n.mac + - (n.physical_network.nil? ? "" : " " + n.physical_network.name) + (n.network.nil? ? "" : " " + n.network.name) }.join("
        ") %>
        <%= @host.bondings.collect { |n| n.name }.join("
        ") %>
        diff --git a/src/app/views/network/_select.rhtml b/src/app/views/network/_select.rhtml index 4d056df..47ab319 100644 --- a/src/app/views/network/_select.rhtml +++ b/src/app/views/network/_select.rhtml @@ -1,5 +1,5 @@ <% target = 'nic' unless target - network_id = 'physical_network_id' if target == 'nic' + network_id = 'network_id' if target == 'nic' network_id = 'vlan_id' if target == 'bonding' %> diff --git a/src/app/views/network/edit_nic.rhtml b/src/app/views/network/edit_nic.rhtml index 1b58c20..7f0bc02 100644 --- a/src/app/views/network/edit_nic.rhtml +++ b/src/app/views/network/edit_nic.rhtml @@ -6,10 +6,12 @@ <%= error_messages_for 'nic' %> + <%# TODO doesn't currently break anything due to where this form is displayed + but @nic.host assumption should be removed so this template can be included elsewhere%>
        <%= hidden_field_tag 'id', @nic.id %> <%= hidden_field_tag 'nic_host_id', @nic.host.id %> - <%= hidden_field_tag 'nic_network_id', @nic.physical_network.id if @nic.physical_network %> + <%= hidden_field_tag 'nic_network_id', @nic.network.id if @nic.network %>
        MAC:
        <%= @nic.mac %>
        diff --git a/src/app/views/nic/show.rhtml b/src/app/views/nic/show.rhtml index 0bd3910..46fb2c6 100644 --- a/src/app/views/nic/show.rhtml +++ b/src/app/views/nic/show.rhtml @@ -7,6 +7,8 @@

        <% end %> + <%# TODO doesn't currently break anything due to where this form is displayed + but @nic.host assumption should be removed so thiw template can be included elsewhere%>

        Host: <%= link_to @nic.host.hostname, { :controller => "host", :action => "show", :id => @nic.host }, { :class => "show" } %>

        diff --git a/src/app/views/task/_user_list.rhtml b/src/app/views/task/_user_list.rhtml index e289932..1506359 100644 --- a/src/app/views/task/_user_list.rhtml +++ b/src/app/views/task/_user_list.rhtml @@ -7,7 +7,7 @@ <% for task in tasks %>
      • action: <%= link_to task.action, { :controller => "task", :action => 'show', :id => task }, { :class => "action" } -%>
        - vm: <%= link_to task.vm.description, { :controller => "vm", :action => 'show', :id => task }, { :class => "description", :title => "cpus: %s mem: %s vNIC: %s" % [ task.vm.num_vcpus_used, task.vm.memory_used, task.vm.vnic_mac_addr ] } -%>
        + vm: <%= link_to task.vm.description, { :controller => "vm", :action => 'show', :id => task }, { :class => "description", :title => "cpus: %s mem: %s" % [ task.vm.num_vcpus_used, task.vm.memory_used ] } -%>
        state: <%= task.state -%>
      • <% end %> diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml index 373452d..ead26e1 100644 --- a/src/app/views/vm/_form.rhtml +++ b/src/app/views/vm/_form.rhtml @@ -58,19 +58,36 @@
        -
        -
        - <%= text_field_with_label "VNIC:", "vm", "vnic_mac_addr", {:style=>"width:250;"} %> -
        -
        - <%= select_with_label "Network:", 'vm', 'network_id', @networks.insert(0, ""), :style=>"width:250px;" %> -
        -
        + <% if @nics.size > 0 %> +
        +
        + Network: +
        +
        + MAC Address: +
        +
        + <%# this column is only populated if a static ip network is selected: %> + IP Address: +
        - <%= rcheck_box_tag_with_label "Forward vm's vnc port locally", "forward_vnc", 1, @vm.forward_vnc %> +
        +
        + <%# populated with jquery below: %> +
        +
        +
        + Add Another Network +
        + <% else %> +  No networks available + <% end %> +
        +
        +
        <%= rcheck_box_tag_with_label "Start VM Now? (pending current resource availability)", "start_now", nil if create or @vm.state == Vm::STATE_STOPPED %> <%= rcheck_box_tag_with_label "Restart VM Now? (pending current resource availability)", "restart_now", nil if @vm.state == Vm::STATE_RUNNING %> @@ -135,4 +152,186 @@ ${htmlList(pools, id)} hide_section_with_header('#vm_network_config', '#vm_network_section_link', 'Network'); }); + /////////////////////////////////////////////////// vm networks config + + // number of rows which we are currently displaying in net config + var vm_network_config_rows = 0; + + // last row currently being displayed + var vm_network_config_last_row = 0; + + // value of current selectbox + var current_selectbox_value = 0; + + // create list of nics + var nics = new Array(); + <% @nics.each { |rnic| %> + jnic = new Object; + jnic.network_id = "<%= rnic.network_id.to_s %>"; + jnic.name = "<%= rnic.network.name %>"; + jnic.mac = "<%= rnic.mac %>"; + jnic.ip = "<%= rnic.ip_address %>"; + jnic.static_ip = <%= rnic.network.boot_type.proto == 'static' %>; + jnic.selected = false; + nics.push(jnic); + <% } %> + + // adds unselected network back to selectboxes indicated by selector + function add_unselected_network(selector, network_id){ + for(j = 0; j < nics.length; ++j){ + if(nics[j].network_id == network_id){ + nics[j].selected = false; + $(selector).append(''); + break; + } + } + } + + // show / hide ip address column + function toggle_ip_address_column(){ + for(i = 0; i < nics.length; ++i){ + if(nics[i].selected && nics[i].static_ip){ + $('#vm_network_config_header_ip').show(); + return; + } + } + $('#vm_network_config_header_ip').hide(); + } + + // show a new network config row + function add_network_config_row(no_remove_link){ + + // if the number of rows is equal to the number of + // networks, don't show any more rows + if(vm_network_config_rows == nics.length) + return; + + vm_network_config_rows += 1; + vm_network_config_last_row = vm_network_config_rows; + + // create the content for another row to be added to the vm_network_config_networks div above. + // currently a row has a network select box, a mac text field, and an ip address field if a static network is selected + var content = '
        '; + content += '
        '; + content += ' '; + content += '
        '; + content += '
        '; + content += ' '; + content += '
        '; + content += '
        '; + content += '  '; + content += '
        '; + + if(!no_remove_link){ + content += '
        '; + content += ' Remove'; + content += '
        '; + } + content += '
        '; + content += '
        '; + + $('#vm_network_config_networks').append(content); + + $('#vm_network_config_networks').ready(function(){ + // when vm_network_config_remove link is click remove target row + $('#vm_network_config_remove_'+vm_network_config_rows).bind('click', function(e){ + remove_network_config_row(e.target.id.substr(25)); // remove vm_network_config_remove_ bit to get row num + }); + + // when select box clicked, store current value for use on change + $('#vm_network_config_network_select_'+vm_network_config_rows).bind('click', function(e){ + current_selectbox_value = e.target.value; + }); + + // when value of network select box is switched + $('#vm_network_config_network_select_'+vm_network_config_rows).bind('change', function(e){ + row = e.target.id.substr(33) + + // find nic w/ selected network id + for(i = 0; i < nics.length; ++i){ + if(nics[i].network_id == e.target.value){ + nics[i].selected = true; + + // fill in mac / ip address textfields as necessary + $('#vm_network_config_mac_'+row).html(''); + if(nics[i].static_ip != ""){ + $('#vm_network_config_ip_'+row).html(''); + }else{ + $('#vm_network_config_ip_'+row).html(' '); + } + + // for the other select boxes, removed selected network + $('.vm_network_config_network_select:not(#vm_network_config_network_select_'+row+') option[@value='+nics[i].network_id+']').remove(); + + break; + } + } + + // if we are clearing the row, do so + if(e.target.value == ""){ + $('#vm_network_config_mac_'+row).html(''); + $('#vm_network_config_ip_'+row).html(' '); + } + + // add unselected network back to other selectboxes. + add_unselected_network('.vm_network_config_network_select:not(#vm_network_config_network_select_'+row+')', current_selectbox_value); + + // show / hide ip address column + toggle_ip_address_column(); + + // only add a new blank row if last row's select box was changed + if(e.target.value != "" && row == vm_network_config_last_row){ + // add row + add_network_config_row(); + } + }); + }); + + // show / hide ip address column + toggle_ip_address_column(); + } + + + + // remove a network config row + function remove_network_config_row(row_num){ + // if trying to remove the first row or a nonexistant one, fail to do so + if(row_num < 2 || row_num > vm_network_config_last_row) + return; + + // get selected network, add it to other selectboxes + network_id = $('#vm_network_config_network_select_' + row_num).val(); + add_unselected_network('.vm_network_config_network_select:not(#vm_network_config_network_select_'+row_num+')', network_id); + + // remove the row + $('#vm_network_config_row_' + row_num).remove(); + + // when removed, set global params + $('#vm_network_config_networks').ready(function(){ + vm_network_config_rows -= 1; + rows = $('#vm_network_config_networks').children(); + vm_network_config_last_row = rows[rows.length - 1].id.substr(22); + + // show / hide ip address column + toggle_ip_address_column(); + }); + } + + // intially show only one vm network config row + $(document).ready(function(){ + add_network_config_row(true); + }); + + // when vm_network_config_add link is clicked show new row + $('#vm_network_config_add').bind('click', function(){ + // TODO check if there exists an empty row + // TODO check to see if we've already added as many rows as there are nets + add_network_config_row(); + }); diff --git a/src/app/views/vm/_grid.rhtml b/src/app/views/vm/_grid.rhtml index b137de6..7ac3fdf 100644 --- a/src/app/views/vm/_grid.rhtml +++ b/src/app/views/vm/_grid.rhtml @@ -34,7 +34,6 @@ <% end %> {display: 'CPUs', name : 'num_vcpus_allocated', width : 40, sortable : true, align: 'left'}, {display: 'Memory (MB)', name : 'memory_allocated', width : 60, sortable : true, align: 'right'}, - {display: 'vNIC Mac Addr', name : 'vnic_mac_addr', width : 60, sortable : true, align: 'right'}, {display: 'State', name : 'state', width : 50, sortable : true, align: 'right'}, {display: 'Load', name : 'load', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget } ], diff --git a/src/app/views/vm/_list.rhtml b/src/app/views/vm/_list.rhtml index 42300d6..54ae741 100644 --- a/src/app/views/vm/_list.rhtml +++ b/src/app/views/vm/_list.rhtml @@ -4,7 +4,6 @@ Description & UUID CPUs Memory (mb) - vNIC MAC Addr State @@ -15,7 +14,6 @@ <%= link_to vm.description, { :controller => "vm", :action => 'show', :id => vm }, { :class => "show" } %>
        <%= vm.uuid %>
        <%= vm.num_vcpus_allocated %> <%= vm.memory_allocated_in_mb %> - <%= vm.vnic_mac_addr %> <%= vm.state %> <%unless vm.needs_restart.nil? or vm.needs_restart == 0 -%> diff --git a/src/app/views/vm/show.rhtml b/src/app/views/vm/show.rhtml index 0f70da8..a7a7388 100644 --- a/src/app/views/vm/show.rhtml +++ b/src/app/views/vm/show.rhtml @@ -106,7 +106,7 @@ Num vcpus used:
        Memory allocated:
        Memory used:
        - vNIC MAC address:
        + vNIC MAC addresses:
        Boot device:
        Provisioning source:
        State:
        @@ -121,7 +121,9 @@ <%=h @vm.num_vcpus_used %>
        <%=h @vm.memory_allocated_in_mb %> MB
        <%=h @vm.memory_used_in_mb %> MB
        - <%=h @vm.vnic_mac_addr %>
        + <% nic_macs = "" + @vm.nics.each { |nic| nic_macs += nic.mac + " " } %> + <%=h nic_macs %>
        <%=h @vm.boot_device %>
        <%=h @vm.provisioning_and_boot_settings %>
        <%=h @vm.state %> diff --git a/src/db/migrate/040_associate_vms_with_nics.rb b/src/db/migrate/040_associate_vms_with_nics.rb new file mode 100644 index 0000000..3d4af03 --- /dev/null +++ b/src/db/migrate/040_associate_vms_with_nics.rb @@ -0,0 +1,103 @@ +# Copyright (C) 2009 Red Hat, Inc. +# Written by Mohammed Morsi +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +class AssociateVmsWithNics < ActiveRecord::Migration + + def self.up + # assocate nics w/ vms + add_column :nics, :vm_id, :integer + execute "alter table nics add constraint + fk_nics_vm_id + foreign key (vm_id) references + vms(id)" + execute "alter table nics alter column host_id DROP NOT NULL" + + # change physical_network_id column in nic table to network_id + execute 'alter table nics drop constraint fk_nic_networks' + execute 'alter table nics rename column physical_network_id to network_id' + execute 'alter table nics add constraint fk_nic_networks + foreign key (network_id) references networks(id)' + + + # create a nic for each vm / network + Vm.find(:all, :conditions => "network_id IS NOT NULL").each{ |vm| + nic = Nic.new(:mac => vm.vnic_mac_addr, + :network_id => vm.network_id, + :vm_id => vm.id, + :bandwidth => 0) + nic.vm = vm + vm.nics.push nic + + vm.save! + nic.save! + } + + # removes 1toM networks/vms relationship + # remove network_id column from vms table + # remove vnic_mac_addr column from vms table + execute 'alter table vms drop constraint fk_vm_network_id' + remove_column :vms, :network_id + remove_column :vms, :vnic_mac_addr + + # add to the db some validations + # host_id is set xor vm_id is set + execute 'alter table nics add constraint host_xor_vm + check (host_id IS NOT NULL and vm_id IS NULL or + vm_id IS NOT NULL and host_id IS NULL)' + # network_id is set if vm_id is + execute 'alter table nics add constraint vm_nic_has_network + check (vm_id IS NULL or network_id IS NOT NULL)' + # vm_id is set if network is vlan (TBD) +# + end + + def self.down + # drop constraints added to nics table + execute 'alter table nics drop constraint host_xor_vm' + execute 'alter table nics drop constraint vm_nic_has_network' + + # add network_id, vnic_mac_addr column back to vm table + add_column :vms, :network_id, :integer + add_column :vms, :vnic_mac_addr, :string + execute 'alter table vms add constraint fk_vm_network_id + foreign key (network_id) references networks(id)' + + # copy network id over + # NOTE since we're going from a MtoM relationship to a 1toM + # we're just gonna associate the last network found + # w/ the vm, so this operation is lossy + Nic.find(:all, :conditions => 'vm_id IS NOT NULL').each{ |nic| + vm = Vm.find(nic.vm_id) + vm.vnic_mac_addr = nic.mac + vm.network_id = nic.network_id + vm.save! + nic.destroy + } + + # unassociate nics / vms + remove_column :nics, :vm_id + execute "alter table nics alter column host_id SET NOT NULL" + + # change nic::network_id back to nic::physical_network_id + execute 'alter table nics drop constraint fk_nic_networks' + execute 'alter table nics rename column network_id to physical_network_id' + execute 'alter table nics add constraint fk_nic_networks + foreign key (physical_network_id) references networks(id)' + + end +end diff --git a/src/public/stylesheets/components.css b/src/public/stylesheets/components.css index 1409692..09f7b06 100644 --- a/src/public/stylesheets/components.css +++ b/src/public/stylesheets/components.css @@ -343,6 +343,45 @@ padding-left: 30px; } +#vm_network_config .i { + float: left; +} + +#vm_network_config_header_network { + float: left; + width: 20%; +} +#vm_network_config_header_mac, #vm_network_config_header_ip{ + float: left; + width: 33%; +} + +.vm_network_config_net { + float: left; + width: 20%; +} +.vm_network_config_mac, .vm_network_config_ip{ + float: left; + width: 33%; + min-width: 100px; +} + +.vm_network_config_remove { + float: left; + padding-top: 5px; + color: #0033CC; +} +.vm_network_config_remove:hover { + cursor: pointer; +} + +#vm_network_config_add { + color: #0033CC; +} +#vm_network_config_add:hover { + cursor: pointer; +} + #vm_general_section_link img, #vm_resources_section_link img, #vm_storage_section_link img, #vm_network_section_link img{ float: left; padding-top: 2px; diff --git a/src/task-omatic/task_vm.rb b/src/task-omatic/task_vm.rb index a448d30..dd71747 100644 --- a/src/task-omatic/task_vm.rb +++ b/src/task-omatic/task_vm.rb @@ -35,7 +35,7 @@ end def create_vm_xml(name, uuid, memAllocated, memUsed, vcpus, bootDevice, - macAddr, bridge, diskDevices) + net_interfaces, diskDevices) doc = Document.new doc.add_element("domain", {"type" => "kvm"}) @@ -87,11 +87,13 @@ def create_vm_xml(name, uuid, memAllocated, memUsed, vcpus, bootDevice, which_device += 1 end - unless macAddr.nil? || bridge.nil? || macAddr == "" || bridge == "" - doc.root.elements["devices"].add_element("interface", {"type" => "bridge"}) - doc.root.elements["devices"].elements["interface"].add_element("mac", {"address" => macAddr}) - doc.root.elements["devices"].elements["interface"].add_element("source", {"bridge" => bridge}) - end + net_interfaces.each { |nic| + interface = Element.new("interface") + interface.add_attribute("type", "bridge") + interface.add_element("mac", {"address" => nic[:mac]}) + interface.add_element("source", {"bridge" => nic[:interface]}) + doc.root.elements["devices"] << interface + } doc.root.elements["devices"].add_element("input", {"type" => "mouse", "bus" => "ps2"}) doc.root.elements["devices"].add_element("graphics", {"type" => "vnc", "port" => "-1", "listen" => "0.0.0.0"}) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index b3c0592..7eb8a6c 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -168,6 +168,8 @@ class TaskOmatic and node.memory >= db_vm.memory_allocated \ and not curr.is_disabled.nil? and curr.is_disabled == 0 \ and ((!vm or vm.active == 'false') or vm.node != node.object_id) + # FIXME ensure host is on all networks a vm's assigned to + # db_vm.nics.each { |nic| ignore if nic.network ! in host } possible_hosts.push(curr) end end @@ -360,31 +362,34 @@ class TaskOmatic @logger.debug("Connecting volumes: #{volumes}") storagedevs = connect_storage_pools(node, volumes) - # determine if vm has been assigned to physical or - # virtual network and assign nic / bonding accordingly - # FIXME instead of trying to find a nic or bonding here, given - # a specified host and network, we should try earlier on to find a host - # that has a nic / bonding on the specified network + # loop through each nic/network assigned to vm, + # finding necessary host devices to bridge - net_device = "breth0" # FIXME remove this default value at some point, tho net_device can't be nil - unless db_vm.network.nil? - if db_vm.network.class == PhysicalNetwork - device = Nic.find(:first, - :conditions => ["host_id = ? AND physical_network_id = ?", - db_host.id, db_vm.network_id ]) - net_device = "br" + device.interface_name unless device.nil? + net_interfaces = [] + db_vm.nics.each { |nic| + device = net_device = nil - else + if nic.network.class == PhysicalNetwork + device = Nic.find(:first, + :conditions => ["host_id = ? AND network_id = ?", + db_host.id, nic.network_id ]) + else device = Bonding.find(:first, - :conditions => ["host_id = ? AND vlan_id = ?", - db_host.id, db_vm.network_id]) - net_device = "br" + device.interface_name unless device.nil? - end - end + :conditions => ["host_id = ? AND vlan_id = ?", + db_host.id, nic.network_id ]) + end + + unless device.nil? + net_device = "br" + device.interface_name + else + net_device = "breth0" # FIXME remove this default at some point + end + net_interfaces.push({ :mac => nic.mac, :interface => net_device }) + } xml = create_vm_xml(db_vm.description, db_vm.uuid, db_vm.memory_allocated, db_vm.memory_used, db_vm.num_vcpus_allocated, db_vm.boot_device, - db_vm.vnic_mac_addr, net_device, storagedevs) + net_interfaces, storagedevs, @logger) @logger.debug("XML Domain definition: #{xml}") diff --git a/src/test/fixtures/nics.yml b/src/test/fixtures/nics.yml index 97397cd..aff7e9b 100644 --- a/src/test/fixtures/nics.yml +++ b/src/test/fixtures/nics.yml @@ -3,21 +3,21 @@ mailserver_nic_one: usage_type: 1 bandwidth: 100 host: mailservers_managed_node - physical_network: mail_network_one + network: mail_network_one mailserver_nic_two: mac: 22:11:33:66:44:55 usage_type: 1 bandwidth: 100 host: mailservers_managed_node - physical_network: mail_network_two + network: mail_network_two fileserver_nic_one: mac: 00:99:00:99:13:07 usage_type: 1 bandwidth: 100 host: fileserver_managed_node - physical_network: fileserver_network + network: fileserver_network ldapserver_nic_one: mac: 00:03:02:00:09:06 @@ -25,32 +25,32 @@ ldapserver_nic_one: bandwidth: 100 bridge: host: ldapserver_managed_node - physical_network: static_physical_network_one + network: static_physical_network_one buildserver_nic_one: mac: 07:17:19:65:03:38 usage_type: 1 bandwidth: 100 host: buildserver_managed_node - physical_network: dhcp_physical_network_one + network: dhcp_physical_network_one buildserver_nic_two: mac: 07:17:19:65:03:39 usage_type: 1 bandwidth: 100 host: buildserver_managed_node - physical_network: static_physical_network_one + network: static_physical_network_one mediaserver_nic_one: mac: 07:17:19:65:03:32 usage_type: 1 bandwidth: 100 host: mediaserver_managed_node - physical_network: mediaserver_network_one + network: mediaserver_network_one mediaserver_nic_two: mac: 07:17:19:65:03:31 usage_type: 1 bandwidth: 100 host: mediaserver_managed_node - physical_network: mediaserver_network_two + network: mediaserver_network_two diff --git a/src/test/fixtures/vms.yml b/src/test/fixtures/vms.yml index 69b1c2b..c47eb68 100644 --- a/src/test/fixtures/vms.yml +++ b/src/test/fixtures/vms.yml @@ -5,7 +5,6 @@ production_httpd_vm: num_vcpus_used: 2 memory_allocated: 262144 memory_used: 131072 - vnic_mac_addr: 23:51:90:A1:13:37 state: stopped needs_restart: 0 boot_device: hd @@ -20,7 +19,6 @@ production_mysqld_vm: num_vcpus_used: 1 memory_allocated: 2048 memory_used: 512 - vnic_mac_addr: 15:99:FE:ED:11:EE state: running needs_restart: 0 boot_device: network @@ -33,7 +31,6 @@ production_ftpd_vm: num_vcpus_used: 1 memory_allocated: 1024 memory_used: 512 - vnic_mac_addr: FF:AA:BB:00:11:55 state: stopped needs_restart: 1 boot_device: cdrom @@ -46,7 +43,6 @@ production_postgresql_vm: num_vcpus_used: 2 memory_allocated: 2048 memory_used: 1536 - vnic_mac_addr: 48:24:12:93:42:11 state: running needs_restart: 0 boot_device: hd @@ -59,7 +55,6 @@ foobar_prod1_vm: num_vcpus_used: 2 memory_allocated: 4096 memory_used: 4096 - vnic_mac_addr: FF:FF:FF:EE:EE:EE state: running needs_restart: 0 boot_device: cdrom @@ -72,7 +67,6 @@ foobar_prod2_vm: num_vcpus_used: 2 memory_allocated: 4096 memory_used: 4096 - vnic_mac_addr: EE:EE:EE:FF:FF:FF state: running needs_restart: 0 boot_device: cdrom @@ -85,7 +79,6 @@ corp_com_errata_vm: num_vcpus_used: 2 memory_allocated: 2048 memory_used: 2048 - vnic_mac_addr: 77:77:77:77:77:77 state: running needs_restart: 0 boot_device: network @@ -98,7 +91,6 @@ corp_com_bugzilla_vm: num_vcpus_used: 2 memory_allocated: 2048 memory_used: 2048 - vnic_mac_addr: 77:77:77:77:77:77 state: running needs_restart: 0 boot_device: network diff --git a/src/test/unit/network_test.rb b/src/test/unit/network_test.rb index 64c5df4..9b75e8b 100644 --- a/src/test/unit/network_test.rb +++ b/src/test/unit/network_test.rb @@ -1,8 +1,69 @@ -require 'test_helper' +# Copyright (C) 2008 Red Hat, Inc. +# Written by Mohammed Morsi +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. + +require File.dirname(__FILE__) + '/../test_helper' class NetworkTest < ActiveSupport::TestCase - # Replace this with your real tests. - def test_truth - assert true + fixtures :networks + fixtures :vms + fixtures :hosts + fixtures :nics + fixtures :boot_types + + def setup + end + + def test_vlan_invalid_without_number + vl = Vlan.new({:name => 'testvlan', :boot_type_id => 2}) + flunk "Vlan without number should not be valid" if vl.valid? + vl.number = 1 + flunk "Vlan with number should be valid" unless vl.valid? + end + + def test_vlan_nics_only_associated_with_vm + vl = Vlan.create({:name => 'testvlan', + :boot_type => boot_types(:boot_type_dhcp), + :number => 1}) # need to create for id + nic = Nic.new({:mac => '11:22:33:44:55:66', + :bandwidth => 100, + :network => vl, + :host => hosts(:prod_corp_com)}) + vl.nics.push nic + flunk "Nic assigned to vlan must only be associated with vm" if vl.valid? + nic.host = nil + nic.vm = vms(:production_httpd_vm) + flunk "Vlan consisting of only vm nics should be valid" unless vl.valid? + end + + def test_physical_network_is_destroyable + pn = PhysicalNetwork.new + flunk "PhysicalNetwork with no nics should be destroyable" unless pn.is_destroyable? + pn.nics.push Nic.new + flunk "PhysicalNetwork with nics should not be destroyable" if pn.is_destroyable? + end + + def test_vlan_is_destroyable + vl = Vlan.new + flunk "Vlan with no nics and bondings should be destroyable" unless vl.is_destroyable? + vl.nics.push Nic.new + flunk "Vlan with nics should not be destroyable" if vl.is_destroyable? + vl.nics.clear + vl.bondings.push Bonding.new + flunk "Vlan with bondings should not be destroyable" if vl.is_destroyable? end end diff --git a/src/test/unit/nic_test.rb b/src/test/unit/nic_test.rb index 07f54c6..b6bdb07 100644 --- a/src/test/unit/nic_test.rb +++ b/src/test/unit/nic_test.rb @@ -24,6 +24,7 @@ class NicTest < Test::Unit::TestCase fixtures :nics fixtures :hosts fixtures :networks + fixtures :vms def setup @nic = Nic.new( @@ -31,7 +32,7 @@ class NicTest < Test::Unit::TestCase :usage_type => 1, :bandwidth => 100 ) @nic.host = hosts(:prod_corp_com) - @nic.physical_network = networks(:static_physical_network_one) + @nic.network = networks(:static_physical_network_one) @ip_address = IpV4Address.new( :address => '1.2.3.4', @@ -74,10 +75,100 @@ class NicTest < Test::Unit::TestCase end def test_static_network_nic_must_have_ip - @nic.physical_network = networks(:static_physical_network_one) + @nic.network = networks(:static_physical_network_one) @nic.ip_addresses.delete_if { true } flunk 'Nics assigned to static networks must have at least one ip' if @nic.valid? end + def test_vm_nic_must_have_network + @nic.host = nil + @nic.vm = vms(:production_httpd_vm) + flunk 'vm nic that is assigned to network is valid' unless @nic.valid? + + @nic.network = nil + flunk 'vm nic without a network is not valid' if @nic.valid? + end + + def test_host_nic_cant_be_assigned_to_vlan + @nic.network = networks(:dhcp_vlan_one) + flunk 'host nic cant be assgined to vlan' if @nic.valid? + end + + def test_nic_networking + flunk 'nic.networking? should return true if assigned to network' unless @nic.networking? + @nic.network = nil + flunk 'nic.networking? should return false if not assigned to network' if @nic.networking? + end + + def test_nic_boot_protocol + nic = Nic.new + nic.ip_addresses << @ip_address + nic.network = networks(:static_physical_network_one) + flunk 'incorrect nic boot protocol' unless nic.boot_protocol == 'static' + end + + def test_nic_ip_addresses + nic = Nic.new + nic.ip_addresses << @ip_address + nic.network = networks(:static_physical_network_one) + flunk 'incorrect nic ip address' unless nic.ip_address == @ip_address.address + end + + def test_nic_netmask + nic = Nic.new + network = Network.new + network.ip_addresses << @ip_address + nic.network = network + + flunk 'incorrect nic netmask' unless nic.netmask == @ip_address.netmask + end + + + def test_nic_broadcast + nic = Nic.new + network = Network.new + network.ip_addresses << @ip_address + nic.network = network + + flunk 'incorrect nic broadcast' unless nic.broadcast == @ip_address.broadcast + end + + def test_nic_gateway + nic = Nic.new + network = Network.new + network.ip_addresses << @ip_address + nic.network = network + + flunk 'incorrect nic gateway' unless nic.gateway == @ip_address.gateway + end + + def test_nic_parent + flunk 'incorrect host nic parent' unless @nic.parent == hosts(:prod_corp_com) + + @nic.host = nil + flunk 'incorrect nic parent' unless @nic.parent == nil + + @nic.vm = vms(:production_httpd_vm) + flunk 'incorrect vm nic parent' unless @nic.parent == vms(:production_httpd_vm) + end + + def test_nic_gen_mac + mac = Nic::gen_mac + flunk 'invalid generated mac' unless mac =~ /^([0-9a-fA-F]{2}([:-]|$)){6}$/ + end + + def test_nic_vm_xor_nic_host + flunk 'host nic without vm is valid' unless @nic.valid? + + @nic.vm = vms(:production_httpd_vm) + flunk 'nic cannot specify both host and vm' if @nic.valid? + + @nic.host = nil + flunk 'vm nic without host is valid' unless @nic.valid? + + @nic.vm = nil + flunk 'nic must specify either host or vm' if @nic.valid? + end + end diff --git a/src/test/unit/vm_test.rb b/src/test/unit/vm_test.rb index 5e03715..0592b57 100644 --- a/src/test/unit/vm_test.rb +++ b/src/test/unit/vm_test.rb @@ -37,8 +37,8 @@ class VmTest < Test::Unit::TestCase :num_vcpus_allocated => 1, :boot_device => 'hd', :memory_allocated_in_mb => 1, - :memory_allocated => 1024, - :vnic_mac_addr => '11:22:33:44:55:66') + :memory_allocated => 1024) + @vm.vm_resource_pool = pools(:corp_com_production_vmpool) end @@ -75,11 +75,6 @@ class VmTest < Test::Unit::TestCase flunk 'Vm must specify memory_allocated_in_mb' if @vm.valid? end - def test_valid_fails_without_vnic_mac_addr - @vm.vnic_mac_addr = '' - flunk 'Vm must specify vnic_mac_addr' if @vm.valid? - end - def test_valid_fails_without_vm_resources_pool_id @vm.vm_resource_pool_id = '' flunk 'Vm must specify vm_resources_pool_id' if @vm.valid? @@ -176,4 +171,9 @@ class VmTest < Test::Unit::TestCase def test_paginated_results assert_equal 5, Vm.paged_with_perms('ovirtadmin', Privilege::VIEW, 1, 'vms.id').size end + + def test_vm_gen_uuid + uuid = Vm::gen_uuid + flunk 'invalid generated uuid' unless uuid =~ /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/ + end end -- 1.6.0.6 From jguiditt at redhat.com Tue Jun 30 20:35:57 2009 From: jguiditt at redhat.com (Jason Guiditta) Date: Tue, 30 Jun 2009 16:35:57 -0400 Subject: [Ovirt-devel] [PATCH server] UI for accumulated uptime for VMs. In-Reply-To: <1246283369-13477-1-git-send-email-sseago@redhat.com> References: <1246283369-13477-1-git-send-email-sseago@redhat.com> Message-ID: <1246394157.3800.3.camel@localhost.localdomain> On Mon, 2009-06-29 at 13:49 +0000, Scott Seago wrote: > There's still a problem with this working on the cloud side, but that can be resolved in a subsequent commit. > --- > src/app/controllers/pool_controller.rb | 2 +- > src/app/controllers/resources_controller.rb | 7 ++++++- > src/app/controllers/smart_pools_controller.rb | 5 ++--- > src/app/helpers/application_helper.rb | 14 ++++++++++++++ > src/app/models/vm.rb | 5 +++++ > src/app/views/cloud/instance/_list.rhtml | 3 +++ > src/app/views/vm/_grid.rhtml | 1 + > src/app/views/vm/show.rhtml | 4 +++- > 8 files changed, 35 insertions(+), 6 deletions(-) Mostly ACK, conditional one 2 things: 1. Since sorting isnt working yet for cloud query, just disable sort link till we get that right. 2. Value in grids for uptime seems to be blank, not sure where the issue is there.