Return-Path: X-Original-To: apmail-cloudstack-users-archive@www.apache.org Delivered-To: apmail-cloudstack-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E26591065A for ; Mon, 19 Aug 2013 12:55:27 +0000 (UTC) Received: (qmail 33718 invoked by uid 500); 19 Aug 2013 12:55:26 -0000 Delivered-To: apmail-cloudstack-users-archive@cloudstack.apache.org Received: (qmail 33608 invoked by uid 500); 19 Aug 2013 12:55:26 -0000 Mailing-List: contact users-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cloudstack.apache.org Delivered-To: mailing list users@cloudstack.apache.org Received: (qmail 33225 invoked by uid 99); 19 Aug 2013 12:55:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2013 12:55:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shanker.balan@shapeblue.com designates 213.199.154.12 as permitted sender) Received: from [213.199.154.12] (HELO emea01-am1-obe.outbound.protection.outlook.com) (213.199.154.12) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2013 12:55:20 +0000 Received: from AMSPR07MB068.eurprd07.prod.outlook.com (10.242.90.22) by AMSPR07MB065.eurprd07.prod.outlook.com (10.242.90.15) with Microsoft SMTP Server (TLS) id 15.0.731.12; Mon, 19 Aug 2013 12:54:55 +0000 Received: from AMSPR07MB068.eurprd07.prod.outlook.com ([169.254.9.5]) by AMSPR07MB068.eurprd07.prod.outlook.com ([169.254.9.5]) with mapi id 15.00.0731.000; Mon, 19 Aug 2013 12:54:55 +0000 From: Shanker Balan To: "" Subject: Re: Debian 7 does not get hostname from dhcp. Thread-Topic: Debian 7 does not get hostname from dhcp. Thread-Index: AQHOk4xMjK/2YE5y+ECxZAKXaI0X8JmKT+wAgACVegCAAPaOgIAAalMAgBAkUwCAABYugIAADreA Date: Mon, 19 Aug 2013 12:54:54 +0000 Message-ID: <62CC6E3E-4CE2-4D8B-A893-A8CB61BEA4B4@shapeblue.com> References: <52027777.5030901@netsons.com> <52034434.2070805@netsons.com> <20130809041240.GA1879@cloud-2.local> <52120945.5050503@netsons.com> In-Reply-To: <52120945.5050503@netsons.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [122.166.147.215] x-forefront-prvs: 09435FCA72 x-forefront-antispam-report: SFV:NSPM;SFS:(26234003)(13734003)(51874003)(189002)(199002)(51704005)(20264003)(479174003)(377454003)(24454002)(551544002)(51856001)(82746001)(50986001)(77982001)(54356001)(15974865002)(47976001)(47736001)(81686001)(56816003)(49866001)(33656001)(53806001)(74876001)(66066001)(65816001)(4396001)(83072001)(19580385001)(80022001)(77096001)(69226001)(74706001)(15202345003)(19580395003)(19580405001)(83322001)(74366001)(79102001)(76796001)(76482001)(54316002)(59766001)(76786001)(74502001)(74662001)(63696002)(81542001)(47446002)(46102001)(81342001)(36756003)(81816001)(80976001)(31966008)(56776001)(491001);DIR:OUT;SFP:;SCL:1;SRVR:AMSPR07MB065;H:AMSPR07MB068.eurprd07.prod.outlook.com;CLIP:122.166.147.215;RD:InfoNoRecords;MX:3;A:1;LANG:en; Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: shapeblue.com X-Virus-Checked: Checked by ClamAV on apache.org On 19-Aug-2013, at 5:32 PM, Gaspare A Silvestri w= rote: > Hi Shanker, > > thank you for your answer. > > Which way have we to use the indicated hook? Within the same password sc= ript, or as external script to execute at the machine startup? On a fresh default Debian Guest VM, "vi /etc/dhcp/dhclient-exit-hooks.d/hos= tname" with the following contents: vi /etc/dhcp/dhclient-exit-hooks.d/hostname #!/bin/sh # # Update hostname from DHCP # if [ "$reason" !=3D BOUND ] && [ "$reason" !=3D RENEW ] && [ "$reason" !=3D= REBIND ] && [ "$reason" !=3D REBOOT ]; then return fi hostname $new_host_name echo $new_host_name > /etc/hostname These changes are unrelated to any other scripts you might have. Hth. @shankerbalan > > Thanks in advance, > > Gaspare > > On 19/08/2013 12:42, Shanker Balan wrote: >> On 09-Aug-2013, at 9:42 AM, Prasanna Santhanam wrote: >> >>> FWIW, the debian image of our system VM is Debian 7 and uses the dhcp >>> client from: >>> >>> deb http://http.us.debian.org/debian wheezy-backports main >>> apt-get install dhcp3-client >>> >>> Can you try that and see if it works? >> >> Another FWIW: I just looked back at my scripts and I seem to creating a = DHCP exit hook as below on Debian templates. >> >> $ cat /etc/dhcp/dhclient-exit-hooks.d/hostname >> #!/bin/sh >> # >> # Update hostname from DHCP >> # >> if [ "$reason" !=3D BOUND ] && [ "$reason" !=3D RENEW ] && [ "$reason" != =3D REBIND ] && [ "$reason" !=3D REBOOT ]; then >> return >> fi >> >> hostname $new_host_name >> echo $new_host_name > /etc/hostname >> >> >>> On Thu, Aug 08, 2013 at 09:52:07PM +0000, Musayev, Ilya wrote: >>>> Perhaps, make sure you don't set the hostname in your template anywher= e in the config and use dhcp provided hostname instead? >>>> >>>> From: Netsons > Roberto Iervolino [mailto:r.iervolino@netsons.com] >>>> Sent: Thursday, August 08, 2013 3:10 AM >>>> To: users@cloudstack.apache.org >>>> Subject: Re: Debian 7 does not get hostname from dhcp. >>>> >>>> There is a way to solve this known issue? >>>> >>>> Thanks. >>>> >>>> [cid:image001.png@01CE945F.FFAC77E0] >>>> >>>> Supernova s.r.l. >>>> Via G. Misiticoni, 3 >>>> 65126 - Pescara >>>> ITALY >>>> >>>> >>>> www.netsons.com >>>> >>>> Roberto Iervolino >>>> IT System Administrator - L2 Support >>>> >>>> >>>> t. (+39) 085 45 100 52 >>>> m. (+39) 393 85 677 48 >>>> e. r.iervolino@netsons.com >>>> >>>> >>>> [View Roberto Iervolino's profile on LinkedIn] >>>> >>>> >>>> >>>> Netsons? ? un marchio registrato dalla Supernova s.r.l. >>>> Le informazioni trasmesse sono riservate alla persona o alla societ? i= ndicata come destinatario, e possono includere contenuti considerati confid= enziali. Ogni elaborazione, comunicazione, trasmissione o altro utilizzo, a= nche azioni conseguenti alla conoscenza di queste informazioni da parte di = chiunque non sia espressamente indicato come destinatario ? proibita. Nel c= aso abbiate ricevuto per errore questa comunicazione, siete pregati di darn= e avviso a info [at] netsons.com ed eliminare ogni stampa ed ogni traccia i= nformatica. Il ricevente dovr? inoltre accertarsi che gli eventuali allegat= i non contengano virus prima di aprirli. Qualunque opinione o affermazione = presentata in questo messaggio ? da ritenersi propria dell'autore e non rap= presenta necessariamente la posizione della Societ?. >>>> >>>> The information transmitted is intended only for the person or entity = to which it is addressed and may contain confidential material. Any review,= retransmission, dissemination or other use of, or taking of any action in = reliance upon this information by persons or entities other than the intend= ed recipient is prohibited. If you received this in error, please contact: = info [at] netsons.com and delete the material from any computer. If this em= ail contains attachments you should ensure they are checked for viruses bef= ore opening them. Any views or opinions presented are solely those of the a= uthor and do not necessarily represent those of the company. >>>> Il 08/08/2013 00:14, David Nalley ha scritto: >>>> >>>> On Wed, Aug 7, 2013 at 12:36 PM, Netsons > Roberto Iervolino < >>>> >>>> r.iervolino@netsons.com> wrote: >>>> >>>> >>>> >>>> Hi, >>>> >>>> >>>> >>>> I've done a template using debian 7.0.0, when i deploy an istance from >>>> >>>> this template the VM at the first boot get correctly the hostname from= the >>>> >>>> DHCP server, then when I reboot the VM does not get the hostname from = the >>>> >>>> DHCP server, and the setted hostname is "localhost". >>>> >>>> >>>> >>>> I've also created other template using CentOS 6.4 and it works fine. >>>> >>>> >>>> >>>> >>>> >>>> There is a known issue with debian 7.0.0? How can i solve it? >>>> >>>> >>>> >>>> >>>> >>>> IIRC this is a known issue with Debian and the version of dhclient the= y >>>> >>>> ship. >>>> >>>> >>>> >>>> --David >>>> >>>> >>>> >>> >>> -- >>> Prasanna., >>> >>> ------------------------ >>> Powered by BigRock.com >>> >> -- >> @shankerbalan >> >> M: +91 98860 60539 | O: +91 (80) 67935867 >> shanker.balan@shapeblue.com | www.shapeblue.com | Twitter:@shapeblue >> ShapeBlue Services India LLP, 22nd floor, Unit 2201A, World Trade Centre= , Bangalore - 560 055 >> >> This email and any attachments to it may be confidential and are intende= d solely for the use of the individual to whom it is addressed. Any views o= r opinions expressed are solely those of the author and do not necessarily = represent those of Shape Blue Ltd or related companies. If you are not the = intended recipient of this email, you must neither take any action based up= on its contents, nor copy or show it to anyone. Please contact the sender i= f you believe you have received this email in error. Shape Blue Ltd is a co= mpany incorporated in England & Wales. ShapeBlue Services India LLP is oper= ated under license from Shape Blue Ltd. ShapeBlue is a registered trademark= . > > > -- @shankerbalan M: +91 98860 60539 | O: +91 (80) 67935867 shanker.balan@shapeblue.com | www.shapeblue.com | Twitter:@shapeblue ShapeBlue Services India LLP, 22nd floor, Unit 2201A, World Trade Centre, B= angalore - 560 055 This email and any attachments to it may be confidential and are intended s= olely for the use of the individual to whom it is addressed. Any views or o= pinions expressed are solely those of the author and do not necessarily rep= resent those of Shape Blue Ltd or related companies. If you are not the int= ended recipient of this email, you must neither take any action based upon = its contents, nor copy or show it to anyone. Please contact the sender if y= ou believe you have received this email in error. Shape Blue Ltd is a compa= ny incorporated in England & Wales. ShapeBlue Services India LLP is operate= d under license from Shape Blue Ltd. ShapeBlue is a registered trademark.