Re: [ovirt-users] cloud-init and sealing of template

2015-12-04 Thread Michal Skrivanek

> On 02 Dec 2015, at 08:43, Gianluca Cecchi  wrote:
> 
> On Wed, Dec 2, 2015 at 8:18 AM, Shahar Havivi  > wrote:
> On 01.12.15 17 :26, Gianluca Cecchi wrote:
> >
> > OK, I'm trying using classic network instead of NetworkManager.
> > But right before running the "make template" action, do I have to run any
> > of "sys-unconfig" and/or "virt-sysprep" tools?
> No you don't need to run this tools.
> 
>  OK. Understood.

you don’t have to, but you’ll get a better, cleaner, template if you’ve been 
using the original image before (added accounts, installed stuff…things people 
usually do when preparing a template:)
we’re looking into integrating it into UI, as it is quite easy to omit a thing 
or two when sealing it manually

It may make sense to use it for initialization during deployment as well as a 
replacement of cloud-init not requiring you to initialize it by running it. You 
would have to do it yourself, making sure the image is not in use while the 
operation is ongoing.
I think it would also be nice to completely integrate it into “create VM from 
Template” flow. You would have a ready-to-go VMs customized at the time of 
creation already, instead of relying on runtime cloud-init

Thanks,
michal

> 
>  
> >
> > It remains open the question about how to properly seal a RHEL 7 / CentOS 7
> What do you mean by sealing?
> 
> 
> I mean what are the correct modifications t apply to the OS, before makeing 
> it a template and then create a VM from that template using cloud-init.
> For example:
> a NetworkManager enabled configuration for ifcfg-eth0 file is somethng like 
> that on RH EL 7:
> 
> TYPE=Ethernet
> BOOTPROTO=none
> DEFROUTE=yes
> IPV4_FAILURE_FATAL=no
> IPV6INIT=no
> IPV6_AUTOCONF=yes
> IPV6_DEFROUTE=yes
> IPV6_PEERDNS=yes
> IPV6_PEERROUTES=yes
> IPV6_FAILURE_FATAL=no
> NAME=eth0
> UUID=5a656c34-e4ba-44a1-8079-d2c797e6a8f4
> DEVICE=eth0
> ONBOOT=yes
> IPADDR=10.4.4.29
> PREFIX=24
> GATEWAY=10.4.4.250
> DNS1=10.4.1.11
> DNS2=10.4.1.12
> DOMAIN="mysearchdomain1.com  mysearchdomain2.com 
> "
> 
> While an old style (managed by classic "network" service) entry sholud be 
> something like:
> 
> DEVICE=eth0
> TYPE=Ethernet
> BOOTPROTO=static
> ONBOOT=yes
> IPADDR=10.4.4.29
> PREFIX=24
> GATEWAY=10.4.4.250
> 
> Do I have to make any modification in both case to ifcfg-eth0 just before 
> making template or should I leave the original VM values inside?
> Does cloud-init provided by oVirt with the values I put inside the GUI during 
> VM creation replace files using something like "sed" command or does it run 
> any network-config operating system commands?
> Gianluca
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-04 Thread Gianluca Cecchi
On Fri, Dec 4, 2015 at 8:59 AM, Michal Skrivanek <
michal.skriva...@redhat.com> wrote:

>
> On 02 Dec 2015, at 08:43, Gianluca Cecchi 
> wrote:
>
> On Wed, Dec 2, 2015 at 8:18 AM, Shahar Havivi  wrote:
>
>> On 01.12.15 17:26, Gianluca Cecchi wrote:
>> >
>> > OK, I'm trying using classic network instead of NetworkManager.
>> > But right before running the "make template" action, do I have to run
>> any
>> > of "sys-unconfig" and/or "virt-sysprep" tools?
>> No you don't need to run this tools.
>>
>
>  OK. Understood.
>
>
> you don’t have to, but you’ll get a better, cleaner, template if you’ve
> been using the original image before (added accounts, installed
> stuff…things people usually do when preparing a template:)
> we’re looking into integrating it into UI, as it is quite easy to omit a
> thing or two when sealing it manually
>
> It may make sense to use it for initialization during deployment as well
> as a replacement of cloud-init not requiring you to initialize it by
> running it. You would have to do it yourself, making sure the image is not
> in use while the operation is ongoing.
> I think it would also be nice to completely integrate it into “create VM
> from Template” flow. You would have a ready-to-go VMs customized at the
> time of creation already, instead of relying on runtime cloud-init
>
> Thanks,
> michal
>
>
Any improvement inside the gui is welcome.
Yes, in my template I already created personal users that are then able to
authenticate themself with public key in the deployed VM without any
problem and I have also Oracle client installed with a specific HammerDB
configuration file.
So the path is the one you suggested.
Thanks,
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-03 Thread Michal Skrivanek

> On 02 Dec 2015, at 21:56, Ekin Meroğlu  wrote:
> 
> Hi,
> 
> You can always use REST-API to attach a cloud-init payload to the the 
> machines you create - see the API example in:
> 
> http://www.ovirt.org/Features/Cloud-Init_Integration 
>  
> 
> But the feature was somewhat broken in 3.5.5, recently fixed in 3.5.6: 
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1269534 
> 
> 
> Please see that you should use the new true 
> tag for 3.5.6
> 
> I have no experience with it in previous versions tough...
> 
> For the template sealing, I only set hostname to localhost, remove the 
> infamous /etc/udev/rules.d/70-* files, delete HW lines form ifcfg-* files, 
> unregister the machine from satellite etc. and poweroff. I do not use 
> sys-unconfig (as it suggests), and did not need to run virt-sysprep - plain 
> old sealing with deleting the necessary info seemed enough for me…

well, that’s what virt-sysprep does, there are quite a few details it can take 
care of to make the template really pristine

> 
> Regards,
> --
> Ekin.
> 
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-02 Thread Gianluca Cecchi
On Wed, Dec 2, 2015 at 9:01 AM, Shahar Havivi  wrote:

>
> You are using a static IP which can be a problem on creating multiple VMs.
> In this case you will need to run cloud-init on each created VM with a new
> static IP or DHCP.
>
>
>
yes, I understand your point.
But my contingent need is to temporary setup a bunch of "fat" (8Gb of ram
and 2 cores) clients that have to stress a RAC DB in several ways
(concurrent HammerDB, load balancing and failover tests, ecc...)
They have to stay on a test network not under my control and where there is
not a dhcp server and I'm not allowed to set up one.
So I have only a pool of Ip addresses on this network. I will start with
2-3 clients, but then it could be that I need to instantiate also tenths of
them.
I have not so many resources and time to setup a more engineered
provisioning system (Foreman, Puppet, ManageIQ, ecc...) at least at this
time.
Coming back to CentOS 7 template, I made some combinations and finally I
found that the best result is obtained with NetworkManager enabled on the
source template from which I create the VM with cloud-init.
It would be nice to have a sort of translation to a user-data (or
similar...) file when I compose my cloud-init settings for a new vm inside
the gui, so that I can duplicate further similar instantiations from oVirt
CLI or other scripted commands, bypassing the web gui.
I'm not so acquainted with cloud-init in general and with its
implementation in oVirt. If there is any useful link for this kind of task
or a suggestion to pass a file for VM creation is welcome.

Thanks again anyway,
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-02 Thread Ekin Meroğlu
Hi,

You can always use REST-API to attach a cloud-init payload to the the
machines you create - see the API example in:

http://www.ovirt.org/Features/Cloud-Init_Integration

But the feature was somewhat broken in 3.5.5, recently fixed in 3.5.6:

https://bugzilla.redhat.com/show_bug.cgi?id=1269534

Please see that you should use the new true
tag for 3.5.6

I have no experience with it in previous versions tough...

For the template sealing, I only set hostname to localhost, remove the
infamous /etc/udev/rules.d/70-* files, delete HW lines form ifcfg-* files,
unregister the machine from satellite etc. and poweroff. I do not use
sys-unconfig (as it suggests), and did not need to run virt-sysprep - plain
old sealing with deleting the necessary info seemed enough for me...

Regards,
--
Ekin.
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-01 Thread Shahar Havivi
On 01.12.15 17:26, Gianluca Cecchi wrote:
> On Tue, Dec 1, 2015 at 9:42 AM, Shahar Havivi  wrote:
> 
> > On 01.12.15 09:03, Gianluca Cecchi wrote:
> > > Hello,
> > > is it correct that even if I use cloud-init I have to seal my candidate
> > VM
> > > before making it a template?
> > Well it depend,
> > If you have a common initialization you can run cloud-init before sealing
> > the
> > template, its more reasonable to create a template and run cloud-init on
> > each
> > VM that created from this template.
> > > In that case what is the correct approach to pre-seal a CentOS 7 VM?
> > > Also, for operating system like Fedora >=20 and/or RHEL/CentOS 7 should I
> > > unconfigure NetworkManager before sealing them, using classic network
> > > service, or what?
> > Yes the NetworkManager can override cloud-init network settings.
> > >
> >
> >
> OK, I'm trying using classic network instead of NetworkManager.
> But right before running the "make template" action, do I have to run any
> of "sys-unconfig" and/or "virt-sysprep" tools?
No you don't need to run this tools.
> 
> - sys-unconfig
> I see in its man page:
> "This utility should not be used for creating cloud or virtual machine
> images.  For  that  use  please see virt-sysprep"
> Does this note apply also in my scenario where I want to seal a VM in oVirt
> before making a template from it?
> 
> - virt-sysprep
> It should be run "out of band" against a disk of a powered off VM if I
> understood correctly.
> Is it applicable in my case with oVirt and a disk that actually is on a
> storage domain?
> It seems more applicable in a plain Qemu?KVM environment...
> 
> It remains open the question about how to properly seal a RHEL 7 / CentOS 7
What do you mean by sealing?
> VM/OS.
> Thanks,
> Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-01 Thread Gianluca Cecchi
On Wed, Dec 2, 2015 at 8:18 AM, Shahar Havivi  wrote:

> On 01.12.15 17:26, Gianluca Cecchi wrote:
> >
> > OK, I'm trying using classic network instead of NetworkManager.
> > But right before running the "make template" action, do I have to run any
> > of "sys-unconfig" and/or "virt-sysprep" tools?
> No you don't need to run this tools.
>

 OK. Understood.



> >
> > It remains open the question about how to properly seal a RHEL 7 /
> CentOS 7
> What do you mean by sealing?
>
>
I mean what are the correct modifications t apply to the OS, before makeing
it a template and then create a VM from that template using cloud-init.
For example:
a NetworkManager enabled configuration for ifcfg-eth0 file is somethng like
that on RH EL 7:

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=5a656c34-e4ba-44a1-8079-d2c797e6a8f4
DEVICE=eth0
ONBOOT=yes
IPADDR=10.4.4.29
PREFIX=24
GATEWAY=10.4.4.250
DNS1=10.4.1.11
DNS2=10.4.1.12
DOMAIN="mysearchdomain1.com mysearchdomain2.com"

While an old style (managed by classic "network" service) entry sholud be
something like:

DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.4.4.29
PREFIX=24
GATEWAY=10.4.4.250

Do I have to make any modification in both case to ifcfg-eth0 just before
making template or should I leave the original VM values inside?
Does cloud-init provided by oVirt with the values I put inside the GUI
during VM creation replace files using something like "sed" command or does
it run any network-config operating system commands?
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-01 Thread Shahar Havivi
On 01.12.15 09:03, Gianluca Cecchi wrote:
> Hello,
> is it correct that even if I use cloud-init I have to seal my candidate VM
> before making it a template?
Well it depend,
If you have a common initialization you can run cloud-init before sealing the
template, its more reasonable to create a template and run cloud-init on each
VM that created from this template.
> In that case what is the correct approach to pre-seal a CentOS 7 VM?
> Also, for operating system like Fedora >=20 and/or RHEL/CentOS 7 should I
> unconfigure NetworkManager before sealing them, using classic network
> service, or what?
Yes the NetworkManager can override cloud-init network settings.
> 
> Thanks in advance,
> Gianluca

> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] cloud-init and sealing of template

2015-12-01 Thread Gianluca Cecchi
Hello,
is it correct that even if I use cloud-init I have to seal my candidate VM
before making it a template?
In that case what is the correct approach to pre-seal a CentOS 7 VM?
Also, for operating system like Fedora >=20 and/or RHEL/CentOS 7 should I
unconfigure NetworkManager before sealing them, using classic network
service, or what?

Thanks in advance,
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] cloud-init and sealing of template

2015-12-01 Thread Gianluca Cecchi
On Tue, Dec 1, 2015 at 9:42 AM, Shahar Havivi  wrote:

> On 01.12.15 09:03, Gianluca Cecchi wrote:
> > Hello,
> > is it correct that even if I use cloud-init I have to seal my candidate
> VM
> > before making it a template?
> Well it depend,
> If you have a common initialization you can run cloud-init before sealing
> the
> template, its more reasonable to create a template and run cloud-init on
> each
> VM that created from this template.
> > In that case what is the correct approach to pre-seal a CentOS 7 VM?
> > Also, for operating system like Fedora >=20 and/or RHEL/CentOS 7 should I
> > unconfigure NetworkManager before sealing them, using classic network
> > service, or what?
> Yes the NetworkManager can override cloud-init network settings.
> >
>
>
OK, I'm trying using classic network instead of NetworkManager.
But right before running the "make template" action, do I have to run any
of "sys-unconfig" and/or "virt-sysprep" tools?

- sys-unconfig
I see in its man page:
"This utility should not be used for creating cloud or virtual machine
images.  For  that  use  please see virt-sysprep"
Does this note apply also in my scenario where I want to seal a VM in oVirt
before making a template from it?

- virt-sysprep
It should be run "out of band" against a disk of a powered off VM if I
understood correctly.
Is it applicable in my case with oVirt and a disk that actually is on a
storage domain?
It seems more applicable in a plain Qemu?KVM environment...

It remains open the question about how to properly seal a RHEL 7 / CentOS 7
VM/OS.
Thanks,
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users