[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at v0.0.3-109-g4f08f06
Michael DeHaan
mdehaan at redhat.com
Wed Aug 1 22:27:15 UTC 2007
Hello,
This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.
Updating branch, master,
via 4f08f06cd74c5acb1c358f36dc85e031e31b56b4 (commit)
via a3559c838670edb5c1c5ac82ba5a93a6239a5518 (commit)
via bd514cc1fee6932335cbdac77f083ab94c54ce47 (commit)
via 293ea4687a5bb156edc4b6c327a4f25bf5b96680 (commit)
via aafbd7c4daa184129587de553437d967376bee98 (commit)
via 30eb883de6d48b625bb31a366d3b1c6a704720bd (commit)
via a7193899b88d1aa4865a90d804f7a0c77350e838 (commit)
via f16cc8263518a2af19ddc9cd7d6e39b0b7a523d8 (commit)
via f3615fb9c7b400ccfcedeed54d424c01d65f7d3f (commit)
via be579a59d7ff3e8dc1d2b2b24ded1a0627f78df5 (commit)
via 3afe34cc3aaa153485d9c797670965831b35c76f (commit)
via e1ecc79b6be7040dce6f2ecf854949d9bc3ef433 (commit)
via 4396bb4972494e97be9e5283b8cb16ad02dcc2fe (commit)
via b82478d98a55f0e0b0c217127b0f5263d7c542d6 (commit)
via 8a30a9127397283c0a88c458785aedbf9ab3ffa4 (commit)
via d60ec068652fed4a9dd3862136b7b6ef877d2fd7 (commit)
via df684aea22de74e57691b69407a575342dc1c685 (commit)
via 452f2ac90f65c897700227d2680c5681a6e9ad78 (commit)
via 6d4eb7cdd08ef6e280f6f08fd6442399f06dcb33 (commit)
via bb0898a35ef08d0e16f08ff032b89b5930c3ce28 (commit)
via c184b539f0581393a03e72752c9c8d051318b07f (commit)
from 013ddcf1e6381a92ba475f3626f02c42364c1400 (commit)
- Log -----------------------------------------------------------------
commit 4f08f06cd74c5acb1c358f36dc85e031e31b56b4
Merge: a3559c8... 013ddcf...
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 1 18:23:41 2007 -0400
Merge branch 'master' of git+ssh://g-mdehaan@et.redhat.com/git/virt-factory
commit a3559c838670edb5c1c5ac82ba5a93a6239a5518
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 1 18:23:12 2007 -0400
Finishing bits on multi-distro import from one profile. Still shows long names
in WUI, no backend filtering yet, but that will come later.
commit bd514cc1fee6932335cbdac77f083ab94c54ce47
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Wed Aug 1 18:07:10 2007 -0400
Misc fixes
commit 293ea4687a5bb156edc4b6c327a4f25bf5b96680
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 15:44:08 2007 -0400
Fix missing colon
commit aafbd7c4daa184129587de553437d967376bee98
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 15:43:47 2007 -0400
Fix shebang line
commit 30eb883de6d48b625bb31a366d3b1c6a704720bd
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 15:04:24 2007 -0400
Force install profiles such that the test scripts will still work if they are not
cleanly removed.
commit a7193899b88d1aa4865a90d804f7a0c77350e838
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 14:52:16 2007 -0400
Added FIXME todo. (We could really use a grep/fixme report in the makefile)
commit f16cc8263518a2af19ddc9cd7d6e39b0b7a523d8
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 14:50:22 2007 -0400
Fix naming and add comments about how all of this works as it is rather complicated.
commit f3615fb9c7b400ccfcedeed54d424c01d65f7d3f
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 14:40:19 2007 -0400
Keep from having to update version number.
commit be579a59d7ff3e8dc1d2b2b24ded1a0627f78df5
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 14:35:50 2007 -0400
Added quick "Make install" hack to makefile for convience during development.
commit 3afe34cc3aaa153485d9c797670965831b35c76f
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Tue Jul 31 14:27:10 2007 -0400
Fix typo.
commit e1ecc79b6be7040dce6f2ecf854949d9bc3ef433
Merge: 4396bb4... c184b53...
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:59:31 2007 -0400
Merge ssh://mdehaan.rdu.redhat.com/cg/virt-factory
commit 4396bb4972494e97be9e5283b8cb16ad02dcc2fe
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:54:52 2007 -0400
Name profiles intelligently
commit b82478d98a55f0e0b0c217127b0f5263d7c542d6
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:51:48 2007 -0400
Make vf_import create multiple profiles from a single profile that contains a list of
potential distros.
commit 8a30a9127397283c0a88c458785aedbf9ab3ffa4
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:28:39 2007 -0400
Make profiles just say what they mean, lower layers will assemble
arch info automagically. This will be some complex black magic, folks.
commit d60ec068652fed4a9dd3862136b7b6ef877d2fd7
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:11:12 2007 -0400
Add virt_ram to profile template
commit df684aea22de74e57691b69407a575342dc1c685
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:10:39 2007 -0400
Add virt_type to profile model, and also remove some comments which
are likely to be unmaintained.
commit 452f2ac90f65c897700227d2680c5681a6e9ad78
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:08:40 2007 -0400
Add virt_type field to database mapper
commit 6d4eb7cdd08ef6e280f6f08fd6442399f06dcb33
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:02:05 2007 -0400
Add virt_type field during upgrade
commit bb0898a35ef08d0e16f08ff032b89b5930c3ce28
Author: Michael DeHaan <mdehaan at redhat.com>
Date: Mon Jul 30 17:00:12 2007 -0400
Remove obsolete files
commit c184b539f0581393a03e72752c9c8d051318b07f
Author: Michael DeHaan <mdehaan at mdehaan.rdu.redhat.com>
Date: Mon Jul 30 16:22:31 2007 -0400
Add VIRT_TYPE parameter to vf_import
-----------------------------------------------------------------------
Diffstat:
build/test-it-all.sh | 4 +-
profiles/Container/profile.xml | 3 +-
profiles/Test1/profile.xml | 3 +-
profiles/Test1_x86_64/Makefile | 49 -------
profiles/Test1_x86_64/files/hello-world1 | 1 -
profiles/Test1_x86_64/files/hello-world2 | 1 -
profiles/Test1_x86_64/manifests/init.pp | 13 --
profiles/Test1_x86_64/profile.xml | 13 --
profiles/Test1_x86_64/version | 1 -
profiles/Test1_x86_64/vf-profile-Test1_x86_64.spec | 53 -------
service/db/schema/obsolete/populate.sql | 16 --
service/db/schema/obsolete/schema.sql | 125 -----------------
service/db/schema/upgrade/0002.py | 5 +-
service/db/schema/upgrade/upgrades.conf | 2 +-
service/modules/profile.py | 62 +--------
service/profile-template/profile.xml.in | 1 +
service/scripts/vf_import | 147 ++++++++++++++++----
service/server/db.py | 3 +-
wui/Makefile | 5 +
wui/src/app/models/profile.rb | 3 +-
20 files changed, 142 insertions(+), 368 deletions(-)
diff --git a/build/test-it-all.sh b/build/test-it-all.sh
index 31c274a..a9f6b11 100755
--- a/build/test-it-all.sh
+++ b/build/test-it-all.sh
@@ -343,7 +343,7 @@ deploy_a_system()
web_login
echo curl -s -w "%{http_code}\n" -L -b $COOKIES_FILE -c $COOKIES_FILE -d "form[machine_id]='1'&form[profile_id]=2&form[puppet_node_diff]=&submit='Add'" http://$DEPLOY_HOST/vf/deployment/edit_submit
RET_CODE=`curl -s -w "%{http_code}\n" -L -b $COOKIES_FILE -c $COOKIES_FILE -d "form[machine_id]=1&form[profile_id]=2&form[puppet_node_diff]=&submit='Add'" http://$DEPLOY_HOST/vf/deployment/edit_submit`
- echo "Provisioming a system returned $RET_CODE"
+ echo "Provisioning a system returned $RET_CODE"
}
@@ -553,7 +553,7 @@ if [ "$VF_IMPORT" == "Y" ] ; then
for profile in `ls`
do
msg "importing $profile"
- rpm -Uvh $profile
+ rpm -Uvh $profile --force
done
/usr/bin/vf_import
popd
diff --git a/profiles/Container/profile.xml b/profiles/Container/profile.xml
index 446f69a..f972d2c 100644
--- a/profiles/Container/profile.xml
+++ b/profiles/Container/profile.xml
@@ -2,9 +2,10 @@
<appliance-container>
<name>Container</name>
<version>1</version>
- <distribution>FC-6-i386</distribution>
+ <distribution>FC-6, F-7, RHEL5, Centos5</distribution>
<virt_storage_size>0</virt_storage_size>
<virt_ram>0</virt_ram>
+ <virt_type>qemu, xenpv</virt_type>
<kickstart_metadata></kickstart_metadata>
<kernel_options></kernel_options>
<valid_targets>is_baremetal</valid_targets>
diff --git a/profiles/Test1/profile.xml b/profiles/Test1/profile.xml
index c46cc2d..b0f1252 100644
--- a/profiles/Test1/profile.xml
+++ b/profiles/Test1/profile.xml
@@ -2,9 +2,10 @@
<appliance-container>
<name>Test1</name>
<version>1.234</version>
- <distribution>FC-6-xen-i386</distribution>
+ <distribution>FC-6, F-7, RHEL5, Centos5</distribution>
<virt_storage_size>5</virt_storage_size>
<virt_ram>512</virt_ram>
+ <virt_type>qemu, xenpv</virt_type>
<kickstart_metadata></kickstart_metadata>
<kernel_options></kernel_options>
<valid_targets>is_virt</valid_targets>
diff --git a/profiles/Test1_x86_64/Makefile b/profiles/Test1_x86_64/Makefile
deleted file mode 100755
index de99ed8..0000000
--- a/profiles/Test1_x86_64/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-VERSION = $(shell echo `awk '{ print $$2 }' version`)
-RELEASE = $(shell echo `awk '{ print $$3 }' version`)
-NEWRELEASE = $(shell echo $$(($(RELEASE) + 1)))
-PROFILE = $(shell echo `awk '{ print $$1 }' version`)
-
-SPEC_FILE = vf-profile-$(PROFILE).spec
-NAME = vf-profile-$(PROFILE)
-
-NV = $(NAME)-$(VERSION)
-RPM_FLAGS = --define "_topdir %(pwd)/rpm-build" \
- --define "_builddir %{_topdir}" \
- --define "_rpmdir %{_topdir}" \
- --define "_srcrpmdir %{_topdir}" \
- --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
- --define "_specdir %{_topdir}" \
- --define "_sourcedir %{_topdir}"
-
-DATADIR = $(shell rpm --eval "%{_datadir}")
-
-all: rpms
-
-bumprelease:
- -echo "$(PROFILE) $(VERSION) $(NEWRELEASE)" > version
-
-setversion:
- -echo "$(PROFILE) $(VERSION) $(RELEASE)" > version
-
-
-clean:
- -rm -f vf-profile*.gz vf-profile*.rpm
- -rm -rf vf-profile-${NAME}-* dist build
-
-
-tar: clean
- mkdir -p $(NV)
- mkdir -p manifests
- mkdir -p files
- mkdir -p templates
- cp -a profile.xml manifests files templates $(NV)
- find $(NV) \( -name '*~' -o -name '#*#' \) -print0 | xargs --no-run-if-empty --null rm -vf
- mkdir -p rpm-build
- tar zcvf rpm-build/$(NV).tar.gz $(NV)
- cp version rpm-build/
- rm -rf $(NV)
-
-new-rpms: bumprelease rpms
-
-rpms: tar
- rpmbuild $(RPM_FLAGS) -ba $(SPEC_FILE)
diff --git a/profiles/Test1_x86_64/files/hello-world1 b/profiles/Test1_x86_64/files/hello-world1
deleted file mode 100755
index d0f37f5..0000000
--- a/profiles/Test1_x86_64/files/hello-world1
+++ /dev/null
@@ -1 +0,0 @@
-First Hello World file
diff --git a/profiles/Test1_x86_64/files/hello-world2 b/profiles/Test1_x86_64/files/hello-world2
deleted file mode 100755
index 5370917..0000000
--- a/profiles/Test1_x86_64/files/hello-world2
+++ /dev/null
@@ -1 +0,0 @@
-Second Hello World file
diff --git a/profiles/Test1_x86_64/manifests/init.pp b/profiles/Test1_x86_64/manifests/init.pp
deleted file mode 100644
index e89a505..0000000
--- a/profiles/Test1_x86_64/manifests/init.pp
+++ /dev/null
@@ -1,13 +0,0 @@
-# hello-world.pp
-
-class test1164 {
- file { "/tmp/hello-world1":
- source => "puppet://$servername/Test1_x86_64/hello-world1"
- }
-}
-
-class test1164 {
- file { "/tmp/hello-world2":
- source => "puppet://$servername/Test1_x86_64/hello-world2"
- }
-}
diff --git a/profiles/Test1_x86_64/profile.xml b/profiles/Test1_x86_64/profile.xml
deleted file mode 100644
index f8acb77..0000000
--- a/profiles/Test1_x86_64/profile.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<appliance-container>
- <name>Test1_x86_64</name>
- <version>1.234</version>
- <distribution>FC-6-xen-x86_64</distribution>
- <virt_storage_size>5</virt_storage_size>
- <virt_ram>512</virt_ram>
- <kickstart_metadata></kickstart_metadata>
- <kernel_options></kernel_options>
- <valid_targets>is_virt</valid_targets>
- <is_container>0</is_container>
- <puppet_classes>test1164 test1264</puppet_classes>
-</appliance-container>
diff --git a/profiles/Test1_x86_64/version b/profiles/Test1_x86_64/version
deleted file mode 100644
index 5ccb1cd..0000000
--- a/profiles/Test1_x86_64/version
+++ /dev/null
@@ -1 +0,0 @@
-Test1_x86_64 1.234 1
diff --git a/profiles/Test1_x86_64/vf-profile-Test1_x86_64.spec b/profiles/Test1_x86_64/vf-profile-Test1_x86_64.spec
deleted file mode 100644
index 313977e..0000000
--- a/profiles/Test1_x86_64/vf-profile-Test1_x86_64.spec
+++ /dev/null
@@ -1,53 +0,0 @@
-%define pbuild %{_builddir}/%{name}-%{version}
-%define profile_name %(echo `awk '{ print $1 }' %{SOURCE1}`)
-%define app_root %{_localstatedir}/lib/virt-factory/profiles/%{profile_name}
-
-Summary: sample container (host) appliance
-Source1: version
-Name: vf-profile-%{profile_name}
-Version: %(echo `awk '{ print $2 }' %{SOURCE1}`)
-Release: %(echo `awk '{ print $3 }' %{SOURCE1}`)%{?dist}
-License: GPL
-Group: Applications/System
-Requires: virt-factory-server >= 0.0.3
-URL: http://virt-factory.et.redhat.com
-Source0: %{name}-%{version}.tar.gz
-BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-
-%description
-sample container (host) appliance
-
-
-%prep
-%setup -q
-
-%build
-
-%install
-rm -rf $RPM_BUILD_ROOT
-%{__install} -d -m0755 %{buildroot}%{app_root}
-%{__cp} -a %{pbuild}/manifests %{buildroot}%{app_root}
-%{__cp} -a %{pbuild}/files %{buildroot}%{app_root}
-%{__cp} -a %{pbuild}/templates %{buildroot}%{app_root}
-%{__cp} -a %{pbuild}/profile.xml %{buildroot}%{app_root}
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root,-)
-%doc
-%attr(-, virtfact, virtfact) %{app_root}/profile.xml
-%attr(-, virtfact, virtfact) %{app_root}/manifests
-%attr(-, virtfact, virtfact) %{app_root}/files
-%attr(-, virtfact, virtfact) %{app_root}/templates
-
-%post
-touch %{_localstatedir}/lib/virt-factory/profiles/queued/%{profile_name}
-
-%changelog
-* Fri May 11 2007 <sseago at redhat.com> - profile-Container
-- Initial build.
-
diff --git a/service/db/schema/obsolete/populate.sql b/service/db/schema/obsolete/populate.sql
deleted file mode 100755
index 48a261c..0000000
--- a/service/db/schema/obsolete/populate.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-INSERT INTO users VALUES (-1, "system", "locked", "?", "?", "?", "?", "?");
-
-INSERT INTO users VALUES (1, "admin", "fedora", "?", "?", "?", "?", "?");
-
-INSERT INTO distributions VALUES (-1, "*Unassigned*", "", "", "", "", 0, "", "");
-
-INSERT INTO profiles VALUES(-1, "*Unassigned*", "0.00", 1, 0, 0, "", "", -1, -1, "");
-
-INSERT INTO machines VALUES(-1, "*Unassigned*", "", "*NoSuchToken*", 0, 0, 0, 0, "", "", "", "", 0, -1, "", 0, 0);
-
-INSERT INTO regtokens VALUES(-1, "*Unassigned*", -1, NULL);
-
-INSERT INTO deployments VALUES(-1, "*Unassigned*", "", "*NoSuchToken*", "", -1, -1, -1, "__NULL__", "", 0, 0);
-
-
-
diff --git a/service/db/schema/obsolete/schema.sql b/service/db/schema/obsolete/schema.sql
deleted file mode 100755
index 821b226..0000000
--- a/service/db/schema/obsolete/schema.sql
+++ /dev/null
@@ -1,125 +0,0 @@
-CREATE TABLE tasks (
- id INTEGER PRIMARY KEY,
- user_id INTEGER NOT NULL,
- action_type INTEGER NOT NULL,
- machine_id INTEGER NOT NULL,
- deployment_id INTEGER NOT NULL,
- state INTEGER NOT NULL,
- time REAL NOT NULL
-);
-
-CREATE TABLE users (
- id INTEGER PRIMARY KEY,
- username VARCHAR (255) UNIQUE NOT NULL,
- password VARCHAR (255) NOT NULL,
- first VARCHAR (255) NOT NULL,
- middle VARCHAR (255),
- last VARCHAR (255) NOT NULL,
- description VARCHAR (255),
- email VARCHAR (255) NOT NULL
-);
-
-CREATE TABLE events (
- id INTEGER PRIMARY KEY,
- time INTEGER NOT NULL,
- user_id INTEGER NOT NULL,
- machine_id INTEGER,
- deployment_id INTEGER,
- profile_id INTEGER,
- severity INTEGER NOT NULL,
- category VARCHAR (255) NOT NULL,
- action VARCHAR (255) NOT NULL,
- user_comment VARCHAR (255)
-);
-
-CREATE TABLE distributions (
- id INTEGER PRIMARY KEY,
- kernel VARCHAR(255) NOT NULL,
- initrd VARCHAR(255) NOT NULL,
- options VARCHAR(255),
- kickstart VARCHAR(255),
- name VARCHAR(255) UNIQUE,
- architecture INTEGER NOT NULL,
- kernel_options VARCHAR(255),
- kickstart_metadata VARCHAR(255)
-);
-
-CREATE TABLE profiles (
- id INTEGER PRIMARY KEY,
- name VARCHAR (255) UNIQUE,
- version VARCHAR (255) NOT NULL,
- distribution_id INTEGER NOT NULL,
- virt_storage_size INTEGER,
- virt_ram INTEGER,
- kickstart_metadata VARCHAR(255),
- kernel_options VARCHAR(255),
- valid_targets INTEGER NOT NULL,
- is_container INTEGER NOT NULL,
- puppet_classes TEXT
-);
-
-CREATE TABLE deployments (
- id INTEGER PRIMARY KEY,
- hostname VARCHAR(255),
- ip_address VARCHAR(255),
- registration_token VARCHAR(255),
- mac_address VARCHAR(255),
- machine_id INTEGER NOT NULL,
- profile_id INTEGER NOT NULL,
- state INTEGER NOT NULL,
- display_name VARCHAR(255) NOT NULL,
- puppet_node_diff TEXT,
- netboot_enabled INTEGER,
- is_locked INTEGER
-);
-
-CREATE TABLE machines (
- id INTEGER PRIMARY KEY,
- hostname VARCHAR(255),
- ip_address VARCHAR(255),
- registration_token VARCHAR(255),
- architecture INTEGER,
- processor_speed INTEGER,
- processor_count INTEGER,
- memory INTEGER,
- kernel_options VARCHAR(255),
- kickstart_metadata VARCHAR(255),
- list_group VARCHAR(255),
- mac_address VARCHAR(255),
- is_container INTEGER,
- profile_id INTEGER NOT NULL,
- puppet_node_diff TEXT,
- netboot_enabled INTEGER,
- is_locked INTEGER
-);
-
-CREATE TABLE regtokens (
- id INTEGER PRIMARY KEY,
- token VARCHAR(255),
- profile_id INTEGER,
- uses_remaining INTEGER
-);
-
-CREATE TABLE sessions (
- session_token VARCHAR(255) UNIQUE NOT NULL,
- user_id INTEGER NOT NULL,
- session_timestamp REAL NOT NULL
-);
-
-CREATE TABLE schema_versions (
- id INTEGER PRIMARY KEY,
- version INTEGER,
- git_tag VARCHAR(100),
- install_timestamp REAL NOT NULL,
- status VARCHAR(20) NOT NULL,
- notes VARCHAR(4000)
-);
-
-create table upgrade_log_messages (
- id INTEGER PRIMARY KEY,
- action VARCHAR(50),
- message_type VARCHAR(50), --info, warning, error
- message_timestamp REAL NOT NULL,
- message VARCHAR(4000)
-);
-
diff --git a/service/db/schema/upgrade/0002.py b/service/db/schema/upgrade/0002.py
index c6bc547..5d8934c 100644
--- a/service/db/schema/upgrade/0002.py
+++ b/service/db/schema/upgrade/0002.py
@@ -13,6 +13,7 @@ table = dict([(t.name, t) for t in tables])
def get_columns():
+ profiles_table = sqlalchemy.Table('profiles',meta)
machines_table = sqlalchemy.Table('machines',meta)
deployments_table = sqlalchemy.Table('deployments',meta)
@@ -20,12 +21,14 @@ def get_columns():
hb_column = Column('last_heartbeat',Integer,nullable=True)
auto_start_column = Column('auto_start',Integer,nullable=True)
hb_column2 = Column('last_heartbeat',Integer,nullable=True)
+ vt_column = Column('virt_type',Integer,nullable=True)
return {
state_column: machines_table,
auto_start_column: deployments_table,
hb_column: machines_table,
- hb_column2: deployments_table
+ hb_column2: deployments_table,
+ vt_column: profiles_table
}
columns = get_columns()
diff --git a/service/db/schema/upgrade/upgrades.conf b/service/db/schema/upgrade/upgrades.conf
index fbfbc3b..e3e0c52 100644
--- a/service/db/schema/upgrade/upgrades.conf
+++ b/service/db/schema/upgrade/upgrades.conf
@@ -3,6 +3,6 @@ notes=Initial schema creation
files=0001.py
[upgrade.0002]
-notes=Improved host and guest status tracking (for VF 0.0.4)
+notes=Features for VF 0.0.4
files=0002.py
diff --git a/service/modules/profile.py b/service/modules/profile.py
index 797983c..c18df39 100755
--- a/service/modules/profile.py
+++ b/service/modules/profile.py
@@ -45,21 +45,11 @@ class Profile(web_svc.AuthWebSvc):
@type token: string
@param args: Profile attributes.
@type args: dict
- - id,
- - name
- - version
- - distribution_id
- - virt_storage_size
- - virt_ram
- - kickstart_metadata
- - kernel_options
- - valid_targets
- - is_container
- - puppet_classes
@raise SQLException: On database error
"""
optional =\
- ('distribution_id', 'virt_storage_size', 'virt_ram', 'kickstart_metadata',
+ ('distribution_id', 'virt_storage_size', 'virt_ram', 'virt_type',
+ 'kickstart_metadata',
'kernel_options', 'puppet_classes')
required = ('name', 'version', 'valid_targets', 'is_container')
self.validate(args, required)
@@ -88,24 +78,13 @@ class Profile(web_svc.AuthWebSvc):
@type token: string
@param args: profile attributes.
@type args: dict
- - id,
- - name (optional)
- - version (optional)
- - distribution_id (optional)
- - virt_storage_size (optional)
- - virt_ram (optional)
- - kickstart_metadata (optional)
- - kernel_options (optional)
- - valid_targets (optional)
- - is_container (optional)
- - puppet_classes (optional)
@raise SQLException: On database error
@raise NoSuchObjectException: On object not found.
"""
required = ('id',)
optional =\
('name', 'version', 'valid_targets', 'is_container', 'distribution_id', 'virt_storage_size',
- 'virt_ram', 'kickstart_metadata', 'kernel_options', 'puppet_classes')
+ 'virt_ram', 'virt_type', 'kickstart_metadata', 'kernel_options', 'puppet_classes')
self.validate(args, required)
session = db.open_session()
try:
@@ -150,17 +129,6 @@ class Profile(web_svc.AuthWebSvc):
- limit (optional)
@return: A list of profiles.
@rtype: [dict,]
- - id,
- - name (optional)
- - version (optional)
- - distribution_id (optional)
- - virt_storage_size (optional)
- - virt_ram (optional)
- - kickstart_metadata (optional)
- - kernel_options (optional)
- - valid_targets (optional)
- - is_container (optional)
- - puppet_classes (optional)
@raise SQLException: On database error
"""
session = db.open_session()
@@ -184,17 +152,6 @@ class Profile(web_svc.AuthWebSvc):
- id
@return: A profile.
@rtype: dict
- - id,
- - name (optional)
- - version (optional)
- - distribution_id (optional)
- - virt_storage_size (optional)
- - virt_ram (optional)
- - kickstart_metadata (optional)
- - kernel_options (optional)
- - valid_targets (optional)
- - is_container (optional)
- - puppet_classes (optional)
@raise SQLException: On database error
@raise NoSuchObjectException: On object not found.
"""
@@ -219,17 +176,6 @@ class Profile(web_svc.AuthWebSvc):
- name
@return: A profile.
@rtype: dict
- - id,
- - name (optional)
- - version (optional)
- - distribution_id (optional)
- - virt_storage_size (optional)
- - virt_ram (optional)
- - kickstart_metadata (optional)
- - kernel_options (optional)
- - valid_targets (optional)
- - is_container (optional)
- - puppet_classes (optional)
@raise SQLException: On database error
"""
required = ('name',)
@@ -248,7 +194,7 @@ class Profile(web_svc.AuthWebSvc):
def validate(self, args, required):
vdr = FieldValidator(args)
vdr.verify_required(required)
- vdr.verify_printable('name', 'version', 'kernel_options', 'puppet_classes')
+ vdr.verify_printable('name', 'version', 'kernel_options', 'puppet_classes', 'virt_type')
vdr.verify_int(['virt_storage_size', 'virt_ram'])
vdr.verify_enum('valid_targets', VALID_TARGETS)
vdr.verify_enum('is_container', VALID_CONTAINERS)
diff --git a/service/profile-template/profile.xml.in b/service/profile-template/profile.xml.in
index 20e1a8a..a25e223 100755
--- a/service/profile-template/profile.xml.in
+++ b/service/profile-template/profile.xml.in
@@ -5,6 +5,7 @@
<distribution>$distribution</distribution>
<virt_storage_size>$storage</virt_storage_size>
<virt_ram>$ram</virt_ram>
+ <virt_type>$ram</virt_type>
<kickstart_metadata>$ksmetadata</kickstart_metadata>
<kernel_options>$koptions</kernel_options>
<valid_targets>$targets</valid_targets>
diff --git a/service/scripts/vf_import b/service/scripts/vf_import
index e1e1b78..444a3ed 100755
--- a/service/scripts/vf_import
+++ b/service/scripts/vf_import
@@ -1,4 +1,5 @@
#!/usr/bin/python
+
"""
sm_import is a utility script which imports an profile profile from an
appliance definition file.
@@ -70,6 +71,7 @@ VERSION_TAG = "version"
DISTRIBUTION_TAG = "distribution"
VIRT_STORAGE_SIZE_TAG = "virt_storage_size"
VIRT_RAM_TAG = "virt_ram"
+VIRT_TYPE_TAG = "virt_type"
KICKSTART_METADATA_TAG = "kickstart_metadata"
KERNEL_OPTIONS_TAG = "kernel_options"
VALID_TARGETS_TAG = "valid_targets"
@@ -78,6 +80,8 @@ PUPPET_CLASSES_TAG = "puppet_classes"
DISTRIBUTION_ID_TAG = "distribution_id"
+# FIXME: this class needs more comments
+
class VirtFactoryImporter:
"""
Main class for sm_import tool
@@ -124,46 +128,129 @@ class VirtFactoryImporter:
file.close()
return found
- def populate_sm_profile(self):
- profile_dict = {}
-
+ def load_profile_dict(self,profile_dict):
self.set_node_text(profile_dict, NAME_TAG)
self.set_node_text(profile_dict, VERSION_TAG)
self.set_node_text(profile_dict, VIRT_STORAGE_SIZE_TAG, "int")
self.set_node_text(profile_dict, VIRT_RAM_TAG, "int")
+ self.set_node_text(profile_dict, VIRT_TYPE_TAG)
self.set_node_text(profile_dict, KICKSTART_METADATA_TAG)
self.set_node_text(profile_dict, KERNEL_OPTIONS_TAG)
self.set_node_text(profile_dict, VALID_TARGETS_TAG)
self.set_node_text(profile_dict, IS_CONTAINER_TAG, "int")
self.set_node_text(profile_dict, PUPPET_CLASSES_TAG)
self.set_node_text(profile_dict, DISTRIBUTION_TAG)
- distribution_name = profile_dict[DISTRIBUTION_TAG]
- print "distro name = ", distribution_name
- if (distribution_name is not None):
- distribution_obj = distribution.Distribution()
- distribution_result = distribution_obj.get_by_name(None, {"name": distribution_name})
- print "distro result = ", distribution_result.error_code
- if (distribution_result.error_code != 0):
- print distribution_result
- raise InvalidArgumentsException(comment="bad distribution name")
- profile_dict[DISTRIBUTION_ID_TAG] = distribution_result.data["id"]
- profile_obj = profile.Profile()
- try:
- existing_profile = profile_obj.get_by_name(None, profile_dict)
- if existing_profile.data:
- print "modifying existing profile ", profile_dict["name"]
- profile_dict["id"] = existing_profile.data["id"]
- result = profile_obj.edit(None, profile_dict)
- else:
- print "creating new profile ", profile_dict["name"]
- result = profile_obj.add(None, profile_dict)
- except Exception, e:
- print "error adding profile: "
- (t, v, tb) = sys.exc_info()
- self.logger.error("Exception occured: %s" % t )
- self.logger.error("Exception value: %s" % v)
- self.logger.error("Exception Info:\n%s" % string.join(traceback.format_list(traceback.extract_tb(tb))))
- raise
+ self.distribution_list_names = profile_dict[DISTRIBUTION_TAG]
+
+ def populate_sm_profile(self):
+
+ """
+ Creates the profile record(s) for the given profile object and inserts
+ them into the DB.
+ """
+
+ # we want to create multiple profile objects for all of the variant distros
+ # so we split the input like "FC-6, F-7" into a list [FC-6, F-7] and then
+ # for each distro (ex: F-7) we create things like:
+ # FC-6-i386, FC-6-xen-i386, FC-6-xen-x86_64, FC-6-xen which are all the combinations
+ # possible of Cobbler (and VF) distros that might have already been imported.
+ # for ones that are NOT THERE, we don't bother creating any profile objects at
+ # all... this is totally ok. In actuality, if we don't find ANY perspective
+ # matches we will raise an error -- but just one match is ok.
+
+ profile_dict = {}
+ self.load_profile_dict(profile_dict)
+ distribution_list = self.distribution_list_names.split(",")
+
+ # the XML file contains a comma delimited list of distributions that the given
+ # lightweight appliance descriptor can run on. We're going to create multiple
+ # profile records for each distro that is supported.
+
+ print "scanning through: %s" % ",".join(distribution_list)
+
+ matches = 0
+ for distribution_name in distribution_list:
+
+ # remove spaces to be tolerant of format
+ print "- looking for: %s" % distribution_name
+ distribution_name = distribution_name.lstrip().rstrip()
+
+ # add all of the arches we might support if we have them imported.
+ # FIXME: right now this only supports common arches, so if someone wants
+ # to add ppc/ppc64 that won't fit in nicely. However this covers nearly
+ # everyone that will want to use virt-factory at this point. IA64 may also
+ # be relevant. Should possibly include.
+ combinations = [
+ "%s-xen-i386" % distribution_name,
+ "%s-i386" % distribution_name,
+ "%s-x86_64" % distribution_name,
+ "%s-xen-x86_64" % distribution_name
+ ]
+
+ # keep track of whether we have any supported distros so we can raise
+ # an error if there aren't any.
+
+ for distribution_name in combinations:
+
+
+ # create a new profile object on a distro/arch specific basis
+ # or modify one if it already exists
+
+ profile_dict = {}
+ self.load_profile_dict(profile_dict)
+
+ # is this distro even in the cobbler DB? If not, skip.
+
+ if (distribution_name is not None):
+ distribution_obj = distribution.Distribution()
+ try:
+ distribution_result = distribution_obj.get_by_name(None, {"name": distribution_name})
+ except:
+ print "- no such distribution: %s" % distribution_name
+ continue
+
+ if (distribution_result.error_code != 0):
+ print "- no distribution found, skipping: %s" % distribution_name
+ continue
+
+ print "- found: %s" % distribution_name
+ matches = matches + 1
+
+ # we're going to append some data onto the profile name so it can
+ # be easily parsed out by things that care. This ideally should be done
+ # by adding some additional fields (also) and populating those. We
+ # may have some of those fields already (FIXME).
+
+ profile_dict[DISTRIBUTION_ID_TAG] = distribution_result.data["id"]
+ profile_dict["name"] = profile_dict["name"] + "::" + distribution_name
+ profile_obj = profile.Profile()
+
+ # create or modify existing
+
+ self.logger.info("constructing profile record: %s" % profile_dict)
+
+ try:
+ existing_profile = profile_obj.get_by_name(None, profile_dict)
+ if existing_profile.data:
+ print "modifying existing profile ", profile_dict["name"]
+ profile_dict["id"] = existing_profile.data["id"]
+ result = profile_obj.edit(None, profile_dict)
+ else:
+ print "creating new profile ", profile_dict["name"]
+ result = profile_obj.add(None, profile_dict)
+ except Exception, e:
+ print "error adding profile: "
+ (t, v, tb) = sys.exc_info()
+ self.logger.error("Exception occured: %s" % t )
+ self.logger.error("Exception value: %s" % v)
+ self.logger.error("Exception Info:\n%s" % string.join(traceback.format_list(traceback.extract_tb(tb))))
+ raise
+
+ # die if we couldn't find any distro for the given profile.
+
+ if matches == 0:
+ print "- no compatible distributions have been imported for this profile: %s" % profile_dict
+ sys.exit(1)
def get_node_text(self, name):
diff --git a/service/server/db.py b/service/server/db.py
index 2ae6f47..02023ff 100644
--- a/service/server/db.py
+++ b/service/server/db.py
@@ -187,7 +187,8 @@ class Database:
Column('kernel_options', String(255)),
Column('valid_targets', String(255)),
Column('is_container', Integer),
- Column('puppet_classes', TEXT)
+ Column('puppet_classes', TEXT),
+ Column('virt_type', String(255))
))
Database.tables.append(Table('machines', Database.meta,
diff --git a/wui/Makefile b/wui/Makefile
index 04be2f6..c8923dc 100644
--- a/wui/Makefile
+++ b/wui/Makefile
@@ -46,3 +46,8 @@ new-rpms: bumprelease rpms
rpms: tar
rpmbuild $(RPM_FLAGS) -ba $(SPEC_FILE)
+
+# convience method to simulate make install, not for production use
+install: rpms
+ rpm -Uvh rpm-build/virt-factory-wui-$(VERSION)-$(RELEASE).fc7.noarch.rpm --force
+ /sbin/service virt-factory-wui restart
diff --git a/wui/src/app/models/profile.rb b/wui/src/app/models/profile.rb
index 43fb905..0ab68d2 100755
--- a/wui/src/app/models/profile.rb
+++ b/wui/src/app/models/profile.rb
@@ -10,7 +10,8 @@ class Profile < ManagedObject
:distribution_id => {:type => Integer},
:distribution => { :type => Distribution, :id_attr => :distribution_id},
:virt_storage_size => {:type => Integer},
- :virt_ram => {:type => Integer},
+ :virt_ram => {:type => Integer},
+ :virt_type => {:type => String},
:kickstart_metadata => {:type => String},
:kernel_options => {:type => String},
:valid_targets => {:type => String},
hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
013ddcf1e6381a92ba475f3626f02c42364c1400 \
4f08f06cd74c5acb1c358f36dc85e031e31b56b4
More information about the Et-mgmt-commits-list
mailing list