corrected readme
authorPaul Tonelli <paul.tonelli@logilab.fr>
Mon, 11 Mar 2013 15:46:28 +0100
changeset 58 987740c53034
parent 57 28cbe9dbaf1f
child 59 c062ff185a14
corrected readme
readme.txt
--- a/readme.txt	Mon Mar 11 15:27:04 2013 +0100
+++ b/readme.txt	Mon Mar 11 15:46:28 2013 +0100
@@ -11,52 +11,91 @@
 -----
 
 top.sls : top file for the ami_creator
+
 ami_creator.sls : state file to have a correct ami-builder environment
+
 ami_creator_pre.sls : state file applied before the creation of variation
-ami_creator_post.sls : state file applied after the creation of variation for cleanup
+
+ami_creator_post.sls : state file applied after the creation of variation for
+cleanup
+
 variation.sls : variation file (should be modified depending on requirements)
+
 variation.top.sls : top file for the chroot
 
 
 Present state
 -------------
 
-The first step is to launch an instance of "ami-creation" on openstack. However the machine is not completely automatic. for now as the user data is not passed. Use at least 20Gb of disk
+The first step is to launch an instance of "ami-creation" on openstack. Use at
+least 20Gb of disk
+
+In the userdata, copy something like (if you do not put anything, what will be
+used will be the latest version from repo):
+
+====== START =======
+
+rev: 1b995dc39507
+address: http://hg.logilab.fr/users/ptonelli/srv_salt
+
+====== END ========
+
+you can add an ip to your instance, ssh to the machine and wait until
+everything in /mnt is unmounted. you can then upload what you want to glance
+with something like (don't forget to change the ids in the last tim):
+
+glance add is_public=false disk_format=aki container_format=aki\
+name=ami-creator-kernel < vmlinuz-3.2.0-4-amd64
 
-if there is no file, the state.highstate has not been run:
+glance add is_public=false disk_format=ari container_format=ari\
+name=ami-creator-ramdisk < initrd.img-3.2.0-4-amd64
+
+glance add disk_format=ami container_format=ami name="ami-creator-amd64"\
+kernel_id=278de93c-5276-410f-a221-667cc1443cf8\
+ramdisk_id=b953e40a-2605-402b-8663-c8556a5899f2 < /mnt/ami-creator.img
+
+Additionnal Documentation
+========================
 
-  salt-call state.highstate
-  salt-call state.highstate
+what is being done and where :
+
+in /etc/init.d/ec2-run-ami
+--------------------------
+
+Add the content of userdata as salt-grains (version and address from repo)
+
+in /etc/rc.local
+----------------
+
+salt-call state.highstate
+salt-call state.highstate
 
 (doing it twice is necessary to load new states)
 
-to put in what you want on your ami image (if you already defined it in the hg repo, it is not useful). Then run:
-
-  salt-call state.sls ami_creator_pre
+salt-call state.sls ami_creator_pre
 
 which mounts a debian image and creates all the necessary files inside. Then
 update the chroot:
 
-  salt-call vm_create.update_image /mnt/variation
+salt-call vm_create.update_image /mnt/variation
 
-and run your state file (if necessary, modify /etc/salt/srv/variation.sls
-which will be executed inside):
+and run your state file (if necessary, modify /etc/salt/srv/variation.sls which
+will be executed inside):
 
-  salt-call vm_create.variate_image /mnt/variation
+salt-call vm_create.variate_image /mnt/variation
 
 which runs your variation inside the chroot. Finally run
 
-  salt-call state.sls ami_creator_post
+salt-call state.sls ami_creator_post
 
 which will extract your image kernel and ramdisk and unmount and resize as necessary
 
-Additionnal Documentation
-=========================
-
 glance
 ------
 
-The salt module from glance does not work in debian as ``glanceclient`` package is only available in experimental and I did not manage to connect to openstack essex with it.
+The salt module from glance does not work in debian as ``glanceclient`` package
+is only available in experimental and I did not manage to connect to openstack
+essex with it.
 
 nova
 ----