osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Windows Server 2016 Templates for CloudStack


Many moons ago a wrote a little powershell that ran only on first startup which grabbed the data and updated the windows box and rebooted it. You have to set the security to allow it to run, the script sets it back to default... 
(please don’t judge me).

$DHCP= (ipconfig /all | findstr /C:"DHCP Server").split()[-1]
$DNSSUFFDATA=Get-WmiObject -class "Win32_NetworkAdapterConfiguration" | Where {$_.DNSDomain -notlike ""} | Select-Object DNSDomain
$DNSSUFF=$DNSSUFFDATA.DNSDomain
$NEWHOSTNAME = Invoke-WebRequest -URI http://$DHCP/latest/meta-data/local-hostname -UseBasicParsing
Rename-Computer -NewName $NEWHOSTNAME -Force
netdom computername $NEWHOSTNAME /Add:$NEWHOSTNAME.$DNSSUFF
netdom computername $NEWHOSTNAME /MakePrimary:$NEWHOSTNAME.$DNSSUFF
set-ExecutionPolicy -ExecutionPolicy Restricted -scope CurrentUser
Restart-Computer




paul.angus@xxxxxxxxxxxxx 
www.shapeblue.com
53 Chandos Place, Covent Garden, London  WC2N 4HSUK
@shapeblue
  
 


-----Original Message-----
From: Andrija Panic <andrija.panic@xxxxxxxxx> 
Sent: 27 July 2018 20:22
To: users <users@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Windows Server 2016 Templates for Cloudstack

We are using original one (cloud instance manager) sucessfully - at least on older template (from say 8 months ago...) - not sure if versions have been changing or not - here is what we use (version check) https://snag.gy/prZTPB.jpg so you can try ti compare... Unless some new mega security by MS to ban setting pass....(I guess you confirmed the service is running, after install ?)

Though, hostname is not set indeed - it's random windows style...

On Fri, 27 Jul 2018 at 16:48, <simon.voelker@xxxxxxxxxxxxxxxx> wrote:

> Thank you, I’ll look into it.
>
>
> Simon Völker
> Fraunhofer-Gesellschaft e.V.
> Abteilung C7 Kommunikationsmanagement
> Schloss Birlinghoven IZB, 53754 Sankt Augustin
> Telefon: (02241) 14-2311
> E-mail: simon.voelker@xxxxxxxxxxxxxxxx<mailto:
> simon.voelker@xxxxxxxxxxxxxxxx>
>
>
>
> Am 27.07.2018 um 11:09 schrieb Dag Sonstebo 
> <Dag.Sonstebo@xxxxxxxxxxxxx
> <mailto:Dag.Sonstebo@xxxxxxxxxxxxx>>:
>
> Hi Simon,
>
> With regards to hostname this should just be a question of setting 
> your Windows template to pick up hostname from DHCP.
>
> Admin passwords – if the existing install doesn’t work you could look 
> at a cloud-init derivative for Windows, looks like 
> https://cloudbase.it/cloudbase-init/ may do the trick?
>
> Regards,
> Dag Sonstebo
> Cloud Architect
> ShapeBlue
>
> On 27/07/2018, 09:53, "simon.voelker@xxxxxxxxxxxxxxxx<mailto:
> simon.voelker@xxxxxxxxxxxxxxxx>" <simon.voelker@xxxxxxxxxxxxxxxx<mailto:
> simon.voelker@xxxxxxxxxxxxxxxx>> wrote:
>
>    Hi,
>
>    we are currently updating templates we provide to our customers.
> However, we are running into problems with Windows Server 2016 and the 
> cloudstack functionality of setting an administrator password and a 
> hostname. The CloudInstanceManager we used for older versions does not 
> seem to work anymore. Does anybody know a successor to the Cloud 
> Instance Manager or a workaround to make the functions work in Server 2016?
>
>    Regards
>
>    Simon Völker
>    Fraunhofer-Gesellschaft e.V.
>    Abteilung C7 Kommunikationsmanagement
>    Schloss Birlinghoven IZB, 53754 Sankt Augustin
>    Telefon: (02241) 14-2311
>    E-mail: simon.voelker@xxxxxxxxxxxxxxxx<mailto:
> simon.voelker@xxxxxxxxxxxxxxxx><mailto:simon.voelker@xxxxxxxxxxxxxxxx>
>
>
>
>
>
>
> Dag.Sonstebo@xxxxxxxxxxxxx<mailto:Dag.Sonstebo@xxxxxxxxxxxxx>
> www.shapeblue.com<http://www.shapeblue.com>
> 53 Chandos Place, Covent Garden, London  WC2N 4HSUK @shapeblue
>
>
>
>
>

-- 

Andrija Panić