Jump to content

proximagr

Moderators
  • Posts

    2468
  • Joined

  • Last visited

  • Days Won

    12

Blog Entries posted by proximagr

  1. proximagr
    Protect your Web App using Azure Application Gateway Web Application Firewall
    Web Application Firewall was always a big investment for a small or growing company as most of the top branded companies are charging a lot of money A Web Application Firewall protects your application from common web vulnerabilities and exploits like SQL Injection or Cross site scripting. Azure provides enterprise grade Web Application Firewall through the Application Gateway. It comes in two pricing models, Medium and Large. More about sizes and instances you can find here, and more about pricing here
    We can add the Application Gateway Web Application Firewall to protect our Azure Web App (PaaS) and our Web Application inside a VMs web server (IaaS). At this post we will see how to protect them both.

    One difference in order to fully protect the Azure Web App (PaaS) is to create an App Service Environment with internal VIP to host the Web App in order to hide it inside a VNET. First things first, create a VNET with one subnet for the Application Gateway WAF. App Service Environment
    After the VNET create the App Service Environment, from the Azure Portal, New –> App Service Environment and select VIP Type “Internal”. Add it to the VNET created before and create a subnet for the ASE. You need to be patient here because the deploy will take more than an hour, almost two.
    Web App
    As soon as the App Service Environment is ready we can create our Web App. Create a Web App from Azure Portal with one difference, on the App Service Plan location instead of selecting a Region select he App Service Environment.

    As you realize, the Web App resides at the internal VNET with no access from the internet. So, in order to access the application at this point we need a VM ( a small one just to test and deploy our application ). Create a small VM and add it to this VNET. One small detail, in order to be able to browse to the site’s URL we need to enter the FQDN, in our case papwaf3app.funniest.gr. In order to do this we need an entry at the VM’s host file. This way we can access the new born Web App.
    Web Application Firewall
    Lets create the Secure public entry point for our Web App. Create an application gateway, select WAF Tier, select the required SKU, add it to the WAF subnet we created before, select Public IP configuration and WAF enabled.


    When the Application gateway is ready we need to do some configuration. First at the Backend pools, open the default created backend pool add the Internal Load Balancer IP address of the ASE as target.

    Then add a health probe. For host add the FQDN of the Web App.

    at the HTTP settings check the “Use custom probe” and select the previously created probe.

    And that’s all. Now we can try our Web App from the Internet. In order to do so we need to browse to the Web App’s URL, that is now published by the Application Gateway, from the Internet. So, we need to create a Public DNS record to point the FQDN to the Application Gateway’s FQDN. In this case we need to crate a CNAME papwaf3app.funniest.gr to point to the 8b0510c1-47e9-4b94-a0ff-af92e4455840.cloudapp.net. In order to test the app right now we can just add a host file to our computer pointing to the Public IP Address of the application gateway and we can access the Web App behind the WAF.

    Logging
    In order to be able to see the Application Gateway and Web Application Firewall logs we need to turn on diagnostics. The easiest way to see the logs is by sending them to Log Analytics (OMS).



    With the Firewall at “Detection” mode, if we try an SQL Injection (?id=10||UTL_INADDR.GET_HOST_NAME( (SELECT user FROM DUAL) )–), the Web App still servers the landing page.

    By switching the Firewall to “Prevention” mode, the same SQL injection attach stops by the WAF before accessing our Web App.
    Protect an IaaS Web Application
    To add a Web Application that runs inside a VM behind the Application Gateway Web Application Firewall, first add the VM as a Back End Pool. Create a new Backend Pool and select “Virtual Machine”. Select the Virtual Machine that runs the Web Application.

    Then create a new probe adding the URL of the Web Application
    next add HTTP settings and add custom probe the new created probe “vmsite”

    Next step is to create two multi-site listeners, one for each host name

    After the listener, add a Basic rule using the Listener, Backend Pool and HTTP settings we created for the VM Web Application,

    Finally one extra step is to change the default rule1 to listen to the WeB App listener

    Finally the Application Gateway Web Application Firewall provides secure access to both the Web App (PaaS) and the VM Web Application (IaaS)

  2. proximagr
    First of all, the VM must be within a virtual network to be able to add a static Private IP address
     
    There are two ways to set a static private IP. One is using the new Azure Portal "portal.azure.com" and one via PowerShell.
     
    Using the new Portal, browse a VM, select settings and then IP addresses. There at the Private IP address you can select "Static" and add the IP address.
     
    Using PowerShell, first connect to the Azure (details on this post), and use the following commands:
     
    #Test IP availability:
    Test-AzureStaticVNetIP -VNetName XXXXXXX -IPAddress
     
    #Set the VM that will take the static IP
    $static = Get-AzureVM -ServiceName xxxxx -Name xxxxxx
     
    #Set the static IP
    Set-AzureStaticVNetIP -VM $static -IPAddress xx.xx.xx.xx | Update-AzureVM
     
    #Check the static IP
    Get-AzureStaticVNetIP -VM $staticVM
     
    source: http://www.e-apostolidis.gr/microsoft/set-static-ip-to-azure-vm/
  3. proximagr
    Azure Virtual Network Gateway provides the ability to connect to your Azure Virtual Network with Azure Client VPN (SSL) connections using your Azure AD or hybrid identity, with Multi Factor Authentication (MFA) and your Conditional Access policies.
    We can have an Enterprise grade SSL VPN, with Active Directory authentication and Single Sign on (SSO) from your corporate laptops and apply all your conditional access policies, like MFA, Compliance devices, trused locations, etc.
    How to create the VPN Gateway
    Go to your Virtual Network’s subnets and create a Gateway subnet by clicking the “+ Gateway subnet”
    Create a Virtual network gateway, by searching for the “Virtual network gateways” service and press Add.

    Select “VPN”, “Route-based” and at the SKU select any size except the Basic. Basic SKU does not support Azure AD authentication.

    Create a Public IP and leave all other settings default and create the Gateway.

    After about 20 minutes the VPN Gateway is ready. In the meantime we will prepare the Azure AD and give concern to use the Azure AD with the Azure client VPN. Using a Global Admin account, go to the “Azure Active Directory” and copy the “Tenant ID” from the Overview blade, and keep it on a notepad.

    Then copy the url and paste the below url to your browser’s address bar. You need to log in with a Global Admin non guest non Microsoft account.
    https://login.microsoftonline.com/common/oauth2/authorize?client_id=41b23e61-6c1e-4545-b367-cd054e0ed4b4&response_type=code&redirect_uri=https://portal.azure.com&nonce=1234&prompt=admin_consent
    With a guest or Microsoft account, even if it is Global Admin, you will be propted to login with an admin account, meaning a member work account.

    Once you login with a member work Global Admin account, you can accept the permissions to create the Azure VPN application

    You can navigate to the Azure Active Directory / Enterprise Application and view / manage the Azure AD application.

    Open the Azure VPN enterprise application and copy the “Application ID” to a notepad.

    Go to the VPN Gateway, select the “Point to site configuration” and click the “Configure now”

    Add the Address Pool that you want the VPN clients to have, for Tunnel type select “OpenVPN (SSL) as it is the only type that supports Azure AD authentication.
    Then use the details that you have copied to the notepad, the Tenant ID and the Application ID, and add them to the required fields and press save.
    Tenant: https://login.microsoftonline.com/paste-your-tenant-id-here Audience: paste-the-azure-vpn-application-id-here Issuer: https://sts.windows.net/paste-your-tenant-id-here/
    How to Download the VPN Client and Connect to the Gateway
    Download the VPN client, using the button.

    Extrack the downloadded zip file

    And at the AzureVPN folder you will find the configuration xml.

    Open the Microsoft Store and get the Azure VPN Client

    Open the Azure VPN Client and at the lower left corner, press the + and Import the xml configuration file

    accept all the settings and press save

    The Azure VPN connection will appear at the Azure VPN client and also at the Windows 10 network connections, like any other VPN
    Azure VPN Client:

    Windows 10 Network Connections:

    Once you press connect, it will prompt you to connect using the account(s) that you are already using at your Windows 10 machine, or use a different account

    You will be prompted for MFA or any other conditional access policy you have applied, and the you will be connected.

    Conditional Access & Multi-Factor Authentication (MFA)
    You can add Conditional Access to the Azure client VPN connection. Go to Azure Active Directory / Security / Conditional Access and create a new Policy.
    Select the “Azure VPN” at the “Cloud apps or actions” section


    At the Access Controls / Grand section, you can require multi-factor authentication, or AD Joined device, or compliant device, or all of that

    At the “Conditions” section you can controll the location that the policy will apply. Lets say, you can apply the MFA requirement at “Any location” and exclude the “Trusted locations”, in order to not require MFA when the device is at a trusted location, like your company’s network.



    https://www.e-apostolidis.gr/microsoft/azure/azure-client-vpn-with-azure-ad-auth-mfa-step-by-step-guide/
  4. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
     
    Πάμε τώρα για το τελευταίο κομμάτι του lab, να προσθέσουμε AlwaysOn Availability Group στο υπάρχον SQL WSFC.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Add AlwaysOn AG to SQL Failover Cluster Instance (Page 3)
     

    Στην καρτέλα validation αγνοούμε το warning για τον Listener, θα τον δημιουργήσουμε μετά

    Και πατάμε Finish για να δημιουργήσει το Group

    Σε αυτό το σημείο μπορούμε να δημιουργήσουμε Listener. Σε μια εγκατάσταση που όλα τα SQL Instances είναι single ένας Listener χρησιμεύει για common name, ώστε να οδηγεί κάθε φορά τις εφαρμογές στο σωστό server. Στην περίπτωση όμως που το ένα ή περισσότερα instances είναι clustered δεν λειτουργεί ο Listener. Μπορούμε και πάλι να δημιουργήσουμε τον Listener αλλά σε περίπτωση που χαθούν τα δύο πρώτα και βασικά Nodes του Cluster τότε ο μόνος τρόπος για να γίνει access η SQL είναι με το instance name του τρίτου Node, στην περίπτωση του lab είναι Win2012R203\MSSQLAG.
    Εδώ πρέπει να τονίσουμε ότι εφόσον δεν υπάρχει Listener και Automatic Failover για να γίνει access η SQL σε περίπτωση που χάσουμε το SQL Failover Cluster Instance πρέπει να γίνει Manual Failover στο Availability Group μέσο του SQL Management Studio, όπως είπαμε και κατά τη δημιουργία.
    Τέλος να πούμε ότι η διαχείριση του Failover Cluster SQL Instance γίνετε μέσω του Windows Server Failover Cluster Manager, όπως π.χ. το manual failover, όπως είδαμε και στο προηγούμενο post. Ενώ η διαχείριση του AlwaysOn High Availability γίνετε από το SQL Management Studio.
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/add-alwayson-ag-to-sql-failover-cluster-instance/
  5. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
     
    Πάμε τώρα για το τελευταίο κομμάτι του lab, να προσθέσουμε AlwaysOn Availability Group στο υπάρχον SQL WSFC.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Add AlwaysOn AG to SQL Failover Cluster Instance (Page 2)
     

    Επίσης σε αυτό το σημείο να αναφέρω ότι επειδή χρησιμοποιούμε ένα Named instance, κάθε φορά που ξεκινάει το SQL Server service καταχωρεί ένα SPN record το οποίο χρειάζεται για να μπορέσουν οι εφαρμογές να κάνουν authenticate με τον SQL Server. Για να μπορέσει να γίνει αυτό πρέπει το account που τρέχει το SQL Server service να έχει δικαίωμα να διαβάζει και να γράφει serviceprinipalnames στο Active Directory. Στο lab χρησιμοποίησα Domain Admin account οπότε το SPN καταχωρείται σωστά.

    Μπορούμε πλέον να ξεκινήσουμε την διαδικασία να βάλουμε την βάση μας σε AlwaysOn Availability Group.
    Από το active node του WSFC ανοίγουμε το SQL Management Studio και συνδεόμαστε στο SCL Cluster Instance, στο LAB “SQLFCI”. Πρώτα κάνουμε ένα backup την βάση μας, μιας που είναι προαπαιτούμενο για να προχωρήσουμε. Παίρνουμε το backup και το κάνουμε restore στο τρίτο Node, Win2012R203 στο lab αλλά προσοχή, επιλέγουμε στο restore Options / Recovery state / RESTORE WITH NORECOVERY

    Αφού ολοκληρωθεί το restore η βάση θα πρέπει να έχει δημιουργηθεί και να είναι σε (Restoring…)

    Μετά πηγαίνουμε στο πρώτο Node, Win2012R201 στο lab, SQL Management Studio, στο “AlwaysOn High Availability” και με δεξί click στο Availability Groups πατάμε “New Availability Group Wizard…”

    Ανοίγει ο Wizard και μετά το πρώτο next δίνουμε Availability group name

    Στο επόμενο βήμα επιλέγουμε την βάση που θέλουμε να βάλουμε σε Availability Group

    Στο επόμενο βήμα πρέπει να ορίσουμε replicas. Έχει ήδη το SQFCI, και μάλιστα μας ενημερώνει ότι επειδή είναι Failover Cluster Instance δεν υποστηρίζει automatic failover. Αυτό σημαίνει ότι όταν χάσουμε όλο το Cluster (SQL Cluster Instance) θα πρέπει να πάμε στο τρίτο Node (Win2012R203 στο lab) στο SQL management studio / AlwaysON High Availability / Availability Groups / και με δεξί click πάνω στο “AG Aname” κάνουμε manual failover.

    Κάνουμε connect στο τρίτο Node, Win2012R203\MSSQLAG

    Αφού προστεθεί και ο Win2012R203, επιλέγουμε Readable Secondary και ανάλογα την χρήση επιλέγουμε Synchronous ή όχι Commit. Όπως είπα και στην αρχή του πρώτου Post, “Η ιδέα είναι να έχουμε ένα SQL Flailover Cluster στο Primary Site και στο υπάρχον Cluster να προσθέσουμε ένα AlwaysOn Availability group για το DR” η χρήση του Availability Group είναι για DR Site για να αποφύγουμε latency στο Commit το αφήνουμε unchecked. Έτσι θα έχουμε asynchronous commit και θα αποφύγουμε το latency με ένα “φόβο” για Data Loss τη στιγμή που θα χρειαστεί Failover.
    Τέλος πατάμε Next.

    Στην επόμενη καρτέλα επιλέγουμε το «Join only” αφού έχουμε κάνει ήδη restore την βάση, και πατάμε Next

     
    Συνέχεια στην επόμενη σελίδα
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/add-alwayson-ag-to-sql-failover-cluster-instance/
  6. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
    Αυτό είναι το δεύτερο Post της τριλογίας SQL Failover Cluster with AlwaysOn Availability Groups. Είναι η ώρα της SQL.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Microsoft SQL 2012 on Failover Cluster (Page 1)
    Για το lab θα χρησιμοποιήσω τον Domain Administrator, αλλά δεν ενδείκνυται για παραγωγικό περιβάλλον!!!
    Βάζουμε το ISO της SQL 2012 SP2 και ξεκινάμε με “new SQL server failover cluster installation”

    Αφού περάσει τα checks δίνουμε key, για το lab φυσικά επέλεξα evaluation, και φτιάχνουμε στο install για να ξεκινήσουμε την εγκατάσταση.
    Αγνοούμε επιδεικτικά το MSDTC error (ήδη από τον 2008) και αν δεν έχουμε errors προχωράμε. Επιλέγουμε το SQL Feature installation και μετά επιλέγουμε μόνο Database Engine Services με τις υποκατηγορίες και το management tools

    Δίνουμε network name για το SQL Cluster και προχωράμε

    Δίνουμε όνομα για το cluster resource group ή αφήνουμε το default (όπως έκανα κι εγώ για το lab)

    Στο επόμενο βήμα μας ενημερώνει ότι δεν υπάρχει διαθέσιμος δίσκος για το SQL Cluster Disk, μιας και ο υπάρχον έγινε Cluster Quorum, οπότε πάμε να δώσουμε έναν ακόμη δίσκο στα Cluster Resources.
    Προσθέτουμε έναν ακόμα δίσκο στο FreeNAS μιας και ένας θα χρειαστεί για το Cluster Quorum και ο άλλος για SQL Cluster Disk. Αφού το δώσουμε στο VM πηγαίνουμε στο web interface του FreeNAS και πάμε στο Storage/Volume manager, διαλέγουμε τον δίσκο δίνουμε όνομα, έδωσα sql, και πατάμε add volume

    Μετά πάμε στο view volumes, επιλέγουμε το sql και πατάμε το create zvol κουμπί, όπως φαίνεται και στην εικόνα

    Δίνουμε όνομα και size και πατάμε Add zvol

    Μετά πάμε στο Sharing/ISCSI/extents και πατάμε add extent, δίνουμε όνομα, επιλέγουμε device το zvol που φτιάξαμε, διαλέγουμε Logical Block Size, για SQL DBs ενδείκνυται το 512, και πατάμε ok

    Τέλος πάμε στο associated targets, πατάμε add target/extent και προσθέτουμε τον extent που φτιάξαμε.
    Τώρα αν πάμε στους servers στο disk management και κάνουμε refresh τους δίσκους βλέπουμε τον νέο δίσκο και τον κάνουμε online, initiate και format, μόνο προσοχή να δώσετε allocation unit 512 για να συμβαδίζει με του FreeNAS αλλιώς η SQL θα γκρινιάξει.

    Ανοίγουμε το Failover Cluster Manager/Storage/Disks και πατάμε add Disk και προσθέτουμε τον νέο δίσκο.

     

    Συνέχεια στην επόμενη σελίδα
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/microsoft-sql-2012-on-failover-cluster/
  7. proximagr
    Puppet On Azure
     
    Εγκατάσταση Open Source Puppet
     
    Βήμα 1 Σύνδεση στο Ubuntu
     
    ανοίγουμε έναν SSH client, στην προκειμένη περίπτωση PuTTY και δίνουμε για Host Name το Public όνομα του Cloud Service, στην προκειμένη περίπτωση openpuppetlab.cloudapp.net, δίνουμε την πόρτα 30021 που έχουμε ορίσει για το puppetmaster και πατάμε Open

    Κάνουμε login με το username & password που ορίσαμε στην δημιουργία του VΜ. Για να μην βάζουμε “sudo” σε κάθε εντολή, τρέχουμε “sudo su –“ και ενεργοποιούμε το root mode μέχρι να κάνουμε “exit”
     
    Βήμα 2 Προαπαιτούμενα
     
    Στατική IP
    Το Puppet χρειάζεται στατική IP & σταθερό hostname. Τη στατική IP την έχουμε ήδη ορίσει στο Azure, οπότε τρέχουμε ένα “ifconfig” για να δούμε ότι όντος το Ubuntu έχει αυτήν την IP

     
    Hostname
    Μετά ανοίγουμε το hosts file για να δώσουμε hostnames. Για τις ανάγκες του Lab θα χρησιμοποιήσω για domain name το puppet.lab. Η ίδια διαδικασία πρέπει να γίνει στο Master & στα Slaves με τις ίδιες εγγραφές.

    Αφού τελειώσουμε με τις εγγραφές πατάμε Ctrl-X, απαντάμε Y για να σώσει τις αλλαγές και Enter για έξοδο.
     
    Time Sync
    Το Puppet Master & τα Slaves πρέπει να έχουν συγχρονισμένη ώρα. Για να γίνει αυτό τρέχουμε την παρακάτω εντολή σε όλα τα μηχανήματα.
    ntpdate pool.ntp.org ; apt-get update && sudo apt-get -y install ntp ; service ntp restart

     
    Βήμα 3 Εγκατάσταση Puppet Master
    Ενεργοποιούμε το Puppet Laps repository και κάνουμε την εγκατάσταση με τις παρακάτω εντολές
    wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
    dpkg -i puppetlabs-release-trusty.deb
    apt-get update
    apt-get install puppetmaster

    Τέλος τρέχουμε “puppet –V” για να σιγουρευτούμε ότι το Puppet τρέχει και τι version έχει εγκατασταθεί

    Είναι καλό σε αυτό το σημείο να κλειδώσουμε το Puppet Auto Update γιατί σε περίπτωση automatic update θα χαλάσει το configuration. Για να γίνει αυτό δημιουργούμε ένα αρχείο μέσα στο apt/preferences.d με όνομα 00-puppet.pref και βάζουμε τα παρακάτω δεδομένα:
    Δημιουργία αρχείου:
    # /etc/apt/preferences.d/00-puppet.pref
    nano /etc/apt/preferences.d/00-puppet.pref
    Δεδομένα:
    Package: puppet puppet-common puppetmaster-passenger
    Pin: version 3.8*
    Pin-Priority: 501
    Αφού τελειώσουμε με τις εγγραφές πατάμε Ctrl-X, απαντάμε Y για να σώσει τις αλλαγές και Enter για έξοδο.
    Ανοίγουμε με nano το αρχείο /etc/puppet/puppet.conf
    nano /etc/puppet/puppet.conf
    Και βάζουμε comment στο templatedir

    Αν δεν το κάνουμε αυτό θα πάρουμε αργότερα μήνυμα ότι το templatedir is deprecated

    Κάνουμε restart το pupetmaster service και είναι έτοιμο
    service puppetmaster restart
     
    Βήμα 4 Εγκατάσταση Puppet Slave
    ανοίγουμε έναν SSH client, στην προκειμένη περίπτωση PuTTY και δίνουμε για Host Name το Public όνομα του Cloud Service, στην προκειμένη περίπτωση openpuppetlab.cloudapp.net, δίνουμε την πόρτα 30022 που έχουμε ορίσει για το puppetslave01 και πατάμε Open

    Κάνουμε login με το username & password που ορίσαμε στην δημιουργία του VΜ
    Τρέχουμε τα προαπαιτούμενα από το Βήμα2
    Ενεργοποιούμε το Puppet Laps repository και κάνουμε την εγκατάσταση με τις παρακάτω εντολές
    cd /tmp
    wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
    dpkg -i puppetlabs-release-trusty.deb
    apt-get update
    apt-get install puppet
    Τέλος τρέχουμε “puppet –V” για να σιγουρευτούμε ότι το Puppet τρέχει και τι version έχει εγκατασταθεί και ότι είναι ίδια με το version του Puppet Master

    κλειδώνουμε το Puppet Auto Update γιατί σε περίπτωση automatic update θα χαλάσει το configuration. Για να γίνει αυτό δημιουργούμε ένα αρχείο μέσα στο apt/preferences.d με όνομα 00-puppet.pref και βάζουμε τα παρακάτω δεδομένα:
    Δημιουργία αρχείου:
    nano /etc/apt/preferences.d/00-puppet.pref
    Δεδομένα:
    Package: puppet puppet-common puppetmaster-passenger
    Pin: version 3.8*
    Pin-Priority: 501
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb11.jpg
    Αφού τελειώσουμε με τις εγγραφές πατάμε Ctrl-X, απαντάμε Y για να σώσει τις αλλαγές και Enter για έξοδο
    Το επόμενο βήμα για τους Slaves είναι να αλλάξουμε το configuration
    Ανοίγουμε με nano το αρχείο /etc/puppet/puppet.conf
    nano /etc/puppet/puppet.conf
    Και αλλάζουμε ως εξής:
    Βάζουμε comment στο templatedir & σε όλο το [master] section και δημιουργούμε ένα [agent] section όπου ορίζουμε τον Puppet Master server
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb12.jpg
    Τέλος ενεργοποιούμε το Puppet Agent να ξεκινάει σαν service
    nano /etc/default/puppet
    και αλλάζουμε το START=no σε yes
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb13.jpg
    Και ξεκινάμε το service με
    service puppet start
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb14.jpg
     
    Βήμα 5 Certificates
    Σε αυτό το βήμα ήδη οι agents έχουν αρχίσει να ψάχνουν τον Puppet Master και του ζητάνε certificate exchange για να ξεκινήσουν να δέχονται οδηγίες. Οπότε το επόμενο βήμα είναι να κάνουμε sign τα certificates που έχουν έρθει από τους agents.
    Τρέχουμε στον Puppet Master το command “puppet cert list” για να δούμε τα certificates που έχουν έρθει για να γίνουν sign.
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb15.jpg?w=625
    Βλέπουμε ότι οι δύο Puppet Slaves έχουν εμφανιστεί και ζητάνε για certificate sign. Για να κάνει ο Puppet Master sign τα certificates τρέχουμε:
    puppet cert sign puppetslave01.puppet.lab & puppet cert sign puppetslave02.puppet.lab
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb16.jpg?w=625
    Τώρα αν ξανατρέξουμε το “puppet cert list” πρέπει να μην φέρνει κανένα request
    Και τρέχοντας το “puppet cert list -all” θα πρέπει να φέρει το certificate του Master και τα 2 certificates των slaves και το + μπροστά από την κάθε εγγραφή υποδεικνύει ότι έχει γίνει sign επιτυχώς και είναι ενεργό.
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb17.jpg?w=625
    Εδώ τελειώνει η βασική εγκατάσταση & παραμετροποίηση Puppet Master & 2 Slaves
     
    source: http://www.e-apostolidis.gr/%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC/puppet-on-azure-step2-open-source-puppet-setup/
  8. proximagr
    AzureRm | Create Internal Load Balancer with two VMs
    This post is part of a general idea, to create an end-to-end high available application infrastructure solution in Azure using internal load balancer with the new AzureRm commands and Azure PowerShell v.1.0 preview. For this solution I will use:
    2x Centos 11 sp4 Web/Application Servers 2x Centos 11 sp4 MySQL Servers 1x Gateway

    The first part is to create an Internal Load Balancer in Azure to use it for two VMs. This setup is ideal for Web server farms and also for SQL clusters. We will create the VNET with the Front End subnet, the internal load balancer and finally two VMs behind the load balancer. The result will be something like the below image.

    In order to run the new AzureRm commands we need to have the Windows Management Framework 5.0 Production Preview. If you have Windows 10 then no action is needed since it is embeded. For Windows 7-8.1 we can download it here: https://www.microsoft.com/en-us/download/details.aspx?id=48729
    The AzureRm commands are installed directly from the PowerShell using the Install-Module AzureRM & Install-AzureRM commands.
    Read more: http://www.e-apostolidis.gr/microsoft/azurerm-create-internal-load-balancer-with-two-vms/
  9. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
     
    Αυτό είναι το δεύτερο Post της τριλογίας SQL Failover Cluster with AlwaysOn Availability Groups. Είναι η ώρα της SQL.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Microsoft SQL 2012 on Failover Cluster (Page 3)
     

    Στο Cluster Network Configuration ελέγχουμε ότι έχει βρει την IP του SQL Cluster και πατάμε next

    Στο Service Accounts δίνουμε το password του Account Που έχουμε ήδη δηλώσει για SQL Engine & Agent

    Περνάμε τους ελέγχους και πατάμε install για να προσθέσει το Node στο Cluster και περιμένουμε μέχρι να να δούμε το Completed successful μήνυμα.

    Πάμε τώρα να δοκιμάσουμε ότι το SQL Role Μπορεί να κάνει failover και στα δύο Nodes.
    Ανοίγουμε το Failover Cluster Manager πηγαίνουμε στο Roles, επιλέγουμε το “SQL Server …”, δεξί click / Move και πατάμε “Select Node…”

    Διαλέγουμε το δεύτερο Node και πατάμε OK

    Περιμένουμε στο Status να γίνει Pending και μετά Running. Πλέον στο “Owner Node” πρέπει να αναφέρει στο δεύτερο Node, στο Lab, Win2012R202

     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/microsoft-sql-2012-on-failover-cluster/
  10. proximagr
    Azure Storage | Static Web Site
    Το Microsoft Azure ανακοίνωσε την δυνατότητα να φιλοξενεί στατικές ιστοσελίδες απευθείας στο Blob Storage, με το κόστος του Blob Storage! Τι σημαίνει αυτό? Για 1 GB χώρο και 100000 views το κόστος είναι περίπου 0,05 ευρώ το μήνα!
    Στις στατικές ιστοσελίδες μπορούμε επίσης εκτός από στατικό περιεχόμενο να έχουμε και CLient Side Scripting οπως JavaScript αλλά όχι Server Side Scripting. Επίσης μπορούμε να δώσουμε και μια Custom σελίδα που θα γυρίζει αντί για 404.
    Μπορείτε να υπολογίσετε το κόστος με το Azure Prising Calculator Στο link https://azure.microsoft.com/en-us/pricing/calculator/

    Τι χρειαζόμαστε? απλά ένα Storage Account V2.

    Μόλις δημιουργηθεί το Storage Account, πρώτα ενεργοποιούμε το Static website από τα Settings του Storage Account. Μόλις πατήσουμε Save θα δημιουργηθεί ένα Virtual Directory με το όνομα $web. Το πατάμε για να μπούμε μέσα στο Blob για να ανεβάσουμε το περιεχόμενο μας. Επίσης σημειώνουμε το Primary endpoint γιατί είναι και το URL του Site μας.

    Για να ανεβάσουμε content στο $web Blob μπορούμε να χρησιμοποιήσουμε τον Storage Explorer

    και είμαστε έτοιμοι. Κάνουμε Browse στο URL του Static website, στο παρδειγμά μου είναι το https://proximagr.z6.web.core.windows.net/

    Φυσικά μπορούμε να βάλουμε το δικό μας Domain. Πρώτα φτιάχνουμε ένα CNAME που θα κάνει Point στο Endpoint και μετά πηγαίνουμε στο Custom Domain όπου δίνουμε το CNAME μας.

    και το αποτέλεσμα:

  11. proximagr
    Puppet On Azure
    Puppet Automation – Δημιουργία αρχείου στους Servers που κάνουμε Manage
    Έχουμε εγκαταστήσει το Puppet και τους Agents, τώρα είναι η ώρα να δούμε ένα test automation.
    Παράδειγμα «Δημιουργία αρχείου»
    Στον Puppet Master τρέχουμε:
    nano /etc/puppet/manifests/site.pp
    και δίνουμε όνομα του αρχείου και το path
    το security “mode”
    και το περιεχόμενο του αρχείου ”content”

    Και το σώζουμε
    Τώρα πάμε στον Slave να δούμε το αρχείο. Μπορούμε να περιμένουμε μισή ώρα μέχρι να κάνει request ο agent στο master ή να τρέξουμε “puppet agent –test” για να το επισπεύσουμε

    Και με “nano /tmp/puppet-test” βλέπουμε το περιεχόμενο

    Τώρα για να δημιουργήσουμε το αρχείο και στα Linux αλλά και σε Windows παραμετροποιούμε το site.pp το παρακάτω:
    if $osfamily == 'windows' {file { 'c:/temp/pupet-test.txt': ensure => file, mode=>'0644',content => "this is the first puppet test file.n" }}else {file{'/tmp/puppet-test':ensure => "present",mode => 0644,content => "this is the first puppet test file.n",}}

    source: http://www.e-apostolidis.gr/%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC/puppet-on-azure-%CE%B2%CE%AE%CE%BC%CE%B1-4-puppet-automation/
  12. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
     
    Αυτό είναι το δεύτερο Post της τριλογίας SQL Failover Cluster with AlwaysOn Availability Groups. Είναι η ώρα της SQL.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Microsoft SQL 2012 on Failover Cluster (Page 2)
     

    Και έχουμε έναν διαθέσιμο δίσκο στο Cluster μας

    Πίσω τώρα στο SQL Setup, κάνουμε refresh και αυτόματα επιλέγει τον νέο δίσκο

    Στη συνέχεια δίνουμε στατική IP στο SQL Cluster Network, φυσικά από το Domain subnet

    Δίνουμε service accounts, για το Lab όπως είπα χρησιμοποιώ τον Domain Admin, αλλά ποτέ σε production.

    Στο Server Configuration δίνουμε ποιοι θα έχουν admin rights στην SQL

    Και στο Data Directories tab βλέπουμε ότι ήδη έχει επιλέξει το SQL Cluster Disk. Σε παραγωγικό περιβάλλον φυσικά θα έχουμε περισσότερους δίσκους για κάθε βάση/log.

    Μετά φτάνομε στο ready to install και πατάμε install. Περιμένουμε να γίνει η εγκατάσταση αργά και βασανιστικά μέχρι να δούμε το υπέροχο Completed successful.

    Και αν πάμε στο Failover Cluster Manager στους ρόλους θα δούμε το SQL Server

    Εδώ τελειώνει η εγκατάσταση του πρώτου Node. Κάνουμε Mount το ISO της SQL στο δεύτερο node και ξεκινάμε το Setup. Επιλέγουμε Add node to a SQL Server failover cluster

    Για το lab επιλέγω πάλι Evaluation, κάνω accept policies κλπ και πάμε για το installation.
    Στο Cluster Node Configuration ελέγχουμε ότι έχει βρει το SQL cluster που δημιουργήσαμε και πατάμε Next

     
    Συνέχεια στην επόμενη σελίδα
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/microsoft-sql-2012-on-failover-cluster/
  13. proximagr
    To connect PowerShell to Exchange Online, open the PowerShell and run:

    $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/-Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session

    source: http://www.e-apostolidis.gr/microsoft/connect-to-exchange-online/
  14. proximagr
    <p>I was looking for a way to have a list with many details about VMs of Azure Classic deployment. Some of the details are VM Name, HostName, Service Name, IP address, Instance Size, Availability Set, Operating System, Disk Name (OS), SourceImageName (OS), MediaLink (OS), HostCaching (OS), Subnet, DataDisk Name, DataDisk HostCaching, DataDisk MediaLink, DataDisk Size.</p>
    <p>I started with PowerShell ISE and some technet search and after a lot of test I created this script:</p><pre class="crayon-plain-tag">Add-AzureAccount
    Select-AzureSubscription -SubscriptionId xxxxxxx-xxxxxxxx-xxxxxx-xxxxxx
    $VMlist = ForEach ($VM in (Get-AzureVM))
    { Get-AzureOSDisk -VM $VM | Select @{Label="VM";Expression={$VM.Name}},`
    @{Label="HostName";Expression={$VM.HostName}},`
    @{Label="Service";Expression={$VM.ServiceName}},`
    @{Label="IP";Expression={$VM.IpAddress}},`
    @{Label="InstanceSize";Expression={$VM.InstanceSize}},`
    @{Label="AvailabilitySet";Expression={$VM.AvailabilitySetName}},`
    OS,DiskName,SourceImageName,MediaLink,HostCaching, `
    @{Label="Subnet";Expression={(Get-AzureSubnet -VM $VM)}},`
    @{Label="DataDiskName";Expression={(Get-AzureDataDisk -VM $VM).DiskName}},`
    @{Label="DDHostCaching";Expression={(Get-AzureDataDisk -VM $VM).HostCaching}},`
    @{Label="DDMediaLink";Expression={(Get-AzureDataDisk -VM $VM).MediaLink}},`
    @{Label="DDSize";Expression={(Get-AzureDataDisk -VM $VM).LogicalDiskSizeInGB}}
    }
    $VMlist | Sort VM,SourceImageName | Export-CSV C:vms_alldata.csv -NoTypeInformation</pre><p>Just open the vms_alldata.csv with Excel, convert test to columns and insert table and voila:</p>
    <p><a href="http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms.jpg"><imgclass="alignnone wp-image-990 size-full" src="http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms.jpg" alt="allvms" width="1017" height="58" srcset="http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms.jpg 1017w, http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms-300x17.jpg 300w, http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms-768x44.jpg 768w, http://www.e-apostolidis.gr/wp-content/uploads/2016/05/allvms-660x38.jpg 660w" sizes="(max-width: 1017px) 100vw, 1017px" /></a></p>
    <p><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fclassic-azure-vm-details%2F&linkname=Classic%20Azure%20VM%20Details"title="Email" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_button_print" href="http://www.addtoany.com/add_to/print?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fclassic-azure-vm-details%2F&linkname=Classic%20Azure%20VM%20Details" title="Print" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/print.png" width="16" height="16" alt="Print"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fclassic-azure-vm-details%2F&title=Classic%20Azure%20VM%20Details" id="wpa2a_2"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a rel="nofollow" href="http://www.e-apostolidis.gr/microsoft/azure/classic-azure-vm-details/">Classic Azure VM Details</a> appeared first on <a rel="nofollow" href="http://www.e-apostolidis.gr">Proxima's IT Corner</a>.</p>


    <a href="http://www.e-apostolidis.gr/microsoft/azure/classic-azure-vm-details/"class='bbc_url' rel='nofollow external'>Source</a>
  15. proximagr
    <p>Azure blob storage is billed based to how much data you use. So you can have an 1023 GB disk but if you use only 20 GB you will be billed for 20 GB. But, <img src="https://s.w.org/images/core/emoji/72x72/1f642.png"alt="?" class="wp-smiley" style="height: 1em; max-height: 1em;" /> , if you write more data, lets say 50 GB and then you erase them, the free space will not automatically be released.</p>
    <p>sandrinodimattia, https://github.com/sandrinodimattia, released an app that allows to check the actual size of a VHD on Azure. It works on both ASM and ARM.</p>
    <p>You can download the executable at: https://github.com/sandrinodimattia/WindowsAzure-VhdSize/releases</p>
    <p>The command is:</p>
    <p>wazvhdsize.exe “storageaccountname” “storageaccountaccesskey==” containername</p>
    <p> </p>
    <p>Source: https://github.com/sandrinodimattia/WindowsAzure-VhdSize</p>
    <p><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fcalculate-azure-vhd-actualbilling-size%2F&linkname=Calculate%20Azure%20VHD%20actual%2Fbilling%20size"title="Email" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_button_print" href="http://www.addtoany.com/add_to/print?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fcalculate-azure-vhd-actualbilling-size%2F&linkname=Calculate%20Azure%20VHD%20actual%2Fbilling%20size" title="Print" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/print.png" width="16" height="16" alt="Print"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazure%2Fcalculate-azure-vhd-actualbilling-size%2F&title=Calculate%20Azure%20VHD%20actual%2Fbilling%20size" id="wpa2a_4"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a rel="nofollow" href="http://www.e-apostolidis.gr/microsoft/azure/calculate-azure-vhd-actualbilling-size/">Calculate Azure VHD actual/billing size</a> appeared first on <a rel="nofollow" href="http://www.e-apostolidis.gr">Proxima's IT Corner</a>.</p>


    <a href="http://www.e-apostolidis.gr/microsoft/azure/calculate-azure-vhd-actualbilling-size/"class='bbc_url' rel='nofollow external'>Source</a>
  16. proximagr
    Auto Start/Stop an Azure VM (ARM)
    For Azure VMs that are not needed to be running 24/7, we can use Azure Automation to schedule automatic Stop (Deallocate) and Start. First ensure to reserve resources if needed, such as the Private and the Public IP.
    Now lets see how we will Auto Start/Stop an Azure VM (ARM). First create an Automation Account, go to the Azure Portal, expand more services and search for automation. Then click the “Automation Accounts”

    At the Automation Accounts press “Add”

    At the Automation Account creation blade provide a Name, the Subscription, the Resource Group, trhe location and if it is the first Automation Account select Yes to create automatically a Run As account

    After the creation it will open the new Automation Account’s blade. Here click the “Runbooks”

    We don’t need to write any scripting since there are available Runbooks at the gallery, so select Browse gallery

    At the Gallery search for the “Start Azure V2 VMs” and “Stop Azure V2 VMs” Graphical Runbooks.


    Click the Runbook and a the new blade press Import. Type a unique name and press OK

    After the import, we will be navigated to the Runbook and we need to Publish it in order to be able to use it. At the Runbook’s blade, press “Edit”

    And then press Publish

    After the Publishing the Runbook is ready to Start and add Schedules. Now lets add Schedules to specify the VM and the schedule that will Start. Press “Schedule”

    Press Link a schedule to your runbook and then Create a new schedule

    Give a name to the schedule, and then select the Start date and time and the recurrency, at my example it will start the VM everyday at 7:00 am

    then go to the Parameters and provide the Resourcegroup name and the VM name and press OK.

    The Runbook is ready. Create more Schedules for all needed VMs. And then repeat the process for the “Stop Azure VM V2” runbook and you will have two Runbooks with many Schedules. To test a Runbook press “Start”.

     

    The post Auto Start/Stop an Azure VM (ARM) appeared first on Proxima's IT Corner.


    Source
  17. proximagr
    Copy AZURE VHD to other storage account
     
    #Source storage account
    $context1 = new-azurestoragecontext -storageaccountname "name_source_account" -storageaccountkey "key_source_account"
     
    #Destination storage account
    $context2 = new-azurestoragecontext -storageaccountname "name_destination_account" -storageaccountkey "key_destination_account"
     
    #Initiate copy this might take a while
    Start-AzureStorageBlobCopy -SrcContainer "vhds" -SrcBlob "name_as_found_in_step_one.vhd" -SrcContext $context1 -DestContainer "vhds" -DestBlob "my_destination_name.vhd" -DestContext $context2
     
    Track Azure VHD copy process
     

    $context = new-azurestoragecontext -storageaccountname "name_destination_account" -storageaccountkey "key_destination_account"
     
    Get-AzureStorageBlobCopyState -Blob "file_name.vhd" -Container "vhds" -Context $context
     
    source: http://www.e-apostolidis.gr/microsoft/copy-azure-vhd-to-other-storage-account/
  18. proximagr
    Καλησπέρα στην κοινότητα. Θέλω να μοιραστώ μαζί σας τα προβλήματα που αντιμετώπισα σήμερα σε ένα Hybrid Configuration με Exchange 2010 SP3 UR6. Δεν είναι κάτι τραγικό, ούτε κάτι που δεν έχουμε αντιμετωπίσει στο παρελθόν αλλά πιστεύω ότι όσο μοιραζόμαστε τόσο μαθαίνουμε.
     
    Παραλείπω τα αρχικά, Domain verification, DirSync, Certificate request, το Outlook Anywhere ενεργό, όλα τα virtual directories φαίνονται μια χαρά, telnet 443 μια χαρά, OWA μια χαρά, γενικώς καλά και φτάνω στο Hybrid Wizard. Δημιουργία και πρώτο τρέξιμο για να φτιαχτεί το private certificate όλα καλά. Πάμε τώρα στο update για να βάλουμε credentials, IP, FQDN κλπ. Ξεκίνησα και εγώ όλο χαρά να τελειώσω το Hybrid Wizard. Αμ δε.
     
    Έχουμε και λέμε, φυσικά έσκασε, και ο πρώτος λόγος ήταν «Execution of the Get-FederationInformation cmdlet had thrown an exception” ή αλλιώς «βγάλε άκρη».
     
    Πολλά άρθρα, πολύ ωραία και όμορφα, κυρίως κατέληγαν στο εξής απλο… κάνε όλα τα test στο connectivity analyzer ευχαριστούμε τη Microsoft πολλά χρόνια για αυτό το πολυεργαλείο
     
    Θυμήθηκα που έλεγε ο Admin τους ότι «εμείς χρησιμοποιούμε VPN για να βλέπουμε τα mail από το Outlook από το σπίτι" και ξεκινάω με Outlook Connectivity, έπρεπε να το ψυλλιαστώ....
     
    The HTTP authentication test failed.
    Additional Details
    An HTTP 500 response was returned from Unknown
     
    Το https://mail.MyDomain.com/rpc/rpcproxy.dllέφερνε το 500 άρι. Με τα πολλά καταλήγω να κάνω επανεγκατάσταση RPC over HTTP με τα εξής βήματα:
    1.Απενεργοποίησα το Outlook Anywhere
    2.Απεγκατέστησα το RPC proxy (Σε 2012 & R2 Uninstall-WindowsFeature rpc-over-http-proxy)
    3.Επανεκκίνηση (Φυσικά)
    4.Εγκατάσταση RPC Proxy (Install-WindowsFeature rpc-over-http-proxy)
    5.Ενεργοποίηση Outlook Anywhere
    6.Επανεκκίνηση του Microsoft Active Directory Topology service
     
    Φυσικά και δεν έλυσε το πρόβλημα…. Ευτυχώς βρήκα αυτό το άρθρο https://support.microsoft.com/en-us/kb/2015129και πήγα με το χέρι και πρόσθεσα το "runtimeVersionv2.0" στο Applicationhost.config. Γιατί το aspnet_regiis.exe δεν παίζει σε 2012 και δεν βρήκα κάτι καλύτερο. Ως δια μαγείας έπαιξε με τι μία !!!!!
     
    Τι ωραία, τι καλά , τραλαλά, τρέχω τον Hybrid Wizard και .... ακριβώς το ίδιο error!
     
    Πάμε πάλι στον connectivity analyzer, τώρα έτρεξα το autodiscover test. Μια χαρά… όλα καλά, τρέχω και EWS test όλα καλά. Με τα πολλά λέω να κάνω reset το autodiscover, το λέγαν διάφοροι με πρόβλημα στο get-federatedinformation. Με τα πολλά τα βήματα είναι αυτά:
     
    •Reset the Autodiscover Virtual Directory
    •Reset the WSSecurityAuthentication to $true
    •IIS reset, then the get-federatedinformation worked!
     
    Ωραία λέω, πάμε από GUI να κάνω reset το autodiscover virtual directory http://technet.microsoft.com/en-us/library/ff629372.aspx. ΧΑΧΑΧΑΧΑΧΑΧΑΧΑ, ο exchange γελούσε με την πάρτη μου. Με το που πατάς το “reset virtual directories” από το GUI σκάει το Exchange Management Console (Exchange 2010 SP3 UR6). Έτσι απλά. Οπότε η δουλειά έγινε με Powershell και όλα καλά, έτρεξα το παρακάτω γιατι ήταν όλα Default:
     
    Get-AutodiscoverVirtualDirectory | Remove-AutodiscoverVirtualDirectory
    New-AutodiscoverVirtualDirectory -Websitename "Default Web Site" -BasicAuthentication:$true -WindowsAuthentication:$true
     
    Μετά το IISreset τρέχω να τρέξω το Hybrid Wizard!!! Όλο χαρά και πάλι, και φυσικά έσκασε!!! Αλλά αυτήν την φορά με άλλο error, το περάσαμε το get-federatedinformation!!!!
    Το νέο μας error: Subtask ValidateConfiguration execution failed: Configure Mail Flow, Ok λέω, αυτό το έχουμε ξαναδεί, όταν έχεις wildcard certificate φτιάχνει τους connectors με default server address, mail.domain.com, στην περίπτωσή μου τους έφτιαξε mail.xxxxx.gr αντί για mailx.xxxxx.gr που ήθελα.
     
    Πάω να τους διορθώσω, και στο check στον Outbound του Office 365 (mail flow/connectors/Hybrid Mail Flow Outbound Connector ) με κόβει στο verify. 450 4.4.101 Proxy session setup failed on Frontend with ‘451 4.4.0 Primary target IP address responded with: “451 5.7.3 STARTTLS is required to send mail.
     
    Χμ, μιλάω με τον Administrator τους να δει αν το Firewall Κάνει ESMTP inspection και μου λέει, «ααααα ξέρεις, το mail flow περνάει από το Symantec gateway μέσα και έξω…» όμορφα και ωραία το κάναμε bypass και από exchange και από firewall και διόρθωσα τους connectors. Μια χαρά.
     
    Με τα πολλά έκανα move ένα test mailbox στο office 365 και πήγε μια χαρά! Μεγάλες χαρές, στέλνει mail, λαμβάνει mail, κυριλέ. Mail flow πάνω κάτω, δεξιά αριστερά μια χαρά. Μεταφέραμε και μερικά ακόμα και η ζωή συνεχίζεται....
  19. proximagr
    Compliance Report using Azure Policy
    Azure Policy is a powerful tool for Azure Governance. With Azure Policy we can define rules for all Azure Subscriptions the we manage. We can use this rules for simple limitation actions, like permitting only specific VM Series and Sizes that can be created and also more complex rule sets that helps you standardize the whole Azure deployment. At my previous posts, we learned How to limit the Azure VM Sizes and How to enforce tags for resources creation
    At the current post we will learn how to use Azure Policy to have a compliance report for our deployment. We will learn this by using an example. Then we will create two Virtual Networks and we will add a Network Security Group only to the first one. Finally we will use the Policy to audit whether the Subnets have assigned the NSG or Not.
    First we need two Virtual Networks. You can create the Virtual Networks using the Azure Portal or using ARM template, like mine from my Github account: https://github.com/proximagr/ARMTemplates/blob/master/2vnets.json
    After applying the template you will have two VNETs like that:

    Then we will a Network Security Group (NSG) only to the MyVNET01 Virtual Network. Again using Azure Portal, PowerShell or my ARM Template for NSG
    Assign the NSG to the MyVNET01 VIrtual Network

    Add the Policy
    Go to Azure Policy -> Definitions and click the “+ Policy definition” to create a new policy definition.

    At the New Policy definition page, select the subscription (location) that the policy will be saved, then add a name. in this case we will use the sample policy template from Microsoft docs so I will add the same name.
    Copy the policy Json text from https://docs.microsoft.com/en-us/azure/governance/policy/samples/nsg-on-subnet and paste it at the POLICY RULE below and Save.

    At the “effect” part of the Json, change the “deny” to “audit”.

    If you search for “NSG” you will see our new policy definition, ready to be assigned.

    Click on the definition’s name to open it and press Assign.

    I will just target the “ComplianceReport” Resource Group

    At the parameters, I added the Resource ID of the NSG, “MyNSG01”

    Evaluate the results
    To check the compliance, go to Policy – Compliance page and search for nsg. You have to wait for about 15 minutes for the compliance policy to evaluate the resources.
    If you search “nsg” you will see that the “Audit NSG on Subnet” policy is 50% compliant. Click on the policy’s name to view more details.

    The assignment details page will open where we can see what resources are not compliant.

    Click on the three dots (…) next to the non-compliant subnet and select “view compliance details” to check why this resource is not compliant.

    The compliance details reports that the value is null and what the required (target) value must be.

    If you want to trigger an on-demand compliance check, you need to make a POST request. You can follow my post Validate Azure Resource Move with Postman to create the access Token and then use it to make a POST request to the Resource Group sung this POST:
    https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{YourRG}/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview
    Source:
    https://docs.microsoft.com/en-us/azure/governance/policy/concepts/effects
    https://docs.microsoft.com/en-us/azure/governance/policy/samples/nsg-on-subnet
    https://docs.microsoft.com/en-us/azure/governance/policy/how-to/get-compliance-data#evaluation-triggers

    The post Compliance Report using Azure Policy appeared first on Apostolidis IT Corner.
     
     
     
  20. proximagr
    Azure Log Analytics | CPU Performance Monitor
    In this article we will create a CPU Performance monitor View for our servers at the Azure Log Analytics (OMS) Portal.

    At the Microsoft Operations Management Suite (OMS) portal press the + button to create a new View

    The View Designer workspace will open. Select the “Line chart & callout”

    At the Properties blade enter a Name, something like “CPU Performance Monitor”, add the below query and press Apply
    Type:Perf CounterName="% Processor Time" InstanceName="_Total" | measure avg(CounterValue)by Computer Interval 10Minutes

    Pressing Apply you will see at the Preview window the “Name” and the CPU Performance of all the Windows servers that are monitored by OMS agent.

    The next step is to press the “+ View” tab and add a “Stack of line charts

    The “Stack of line charts” will add three charts per row and we can use it to add our servers. We will create something like that:

    So, at the Properties blade add a name and a query for each server needs to be monitored and press Apply. For more than three servers add more “Stack of line charts”.
    The query is the below, just change the Computer = “server.domain.local” with your servers.
    Type:Perf CounterName="% Processor Time" InstanceName="_Total" AND Computer ="server.domain.local" | measure Avg(CounterValue) as 'CPU_Percentage' by Computer Interval10Minutes

    Finally press “Save” at the View Designer

    The result is a CPU Performance monitor for all servers at the OMS Portal.

    And when you press it you have the CPU Performance Monitor of all added servers.


    Stay tuned for the next part
  21. proximagr
    Puppet On Azure Προσθήκη Windows Agent Βήμα 1 Δημιουργία Windows VM
    Δημιουργούμε ένα Virtual Machine, από το Azure Management Portal πάμε στα Virtual Machines, πατάμε New και πατάμε «From Gallery”

    Διαλέγουμε Windows Server 2012 R2 Datacenter

    Δίνουμε όνομα, για το Lab: “puppetslave03”, size ένα A0, username & password

    Στην επόμενη οθόνη επιλέγουμε το ίδιο Cloud Service, Virtual Network & Storage Account, τέλος αλλάζουμε τις public Ports του RDP & PowerShell (για ασφάλεια) και πατάμε το βελάκι δεξιά

    Στην επόμενη οθόνη αφήνουμε μόνο το “Install VM Agent” και πατάμε το check για να δημιουργήσουμε το VM. Βήμα 2 Private IP
    Αφού δημιουργηθεί το VM δίνουμε Private IP από νέο Azure Portal
    Πηγαίνουμε στο “Virtual Machines (classic)” και επιλέγουμε το VM

    Στην καρτέλα Settings πατάμε IP Addresses

    αλλάζουμε το IP address assignment κάτω από το Private IP address σε Static, δίνουμε την στατική IP που θέλουμε και πατάμε save
    Βήμα 3 Puppet Agent
    Ανοίγουμε το Remote Desktop Connection και για Computer βάζουμε το Public Address του VM και την πόρτα που ορίσαμε. Στην συγκεκριμένη περίπτωση “openpuppetlab.cloudapp.net:33389”

    Δίνουμε το username & το Password που ορίσαμε κατά την δημιουργία του VM και συνδεόμαστε Firewall
    Ο Puppet Agent επικοινωνεί στην πόρτα 8140 οπότε πρέπει πρώτα να την ανοίξουμε στο Windows Firewall. Από το Server Manager πάμε στο Local Server και πατάμε στο Windows Firewall για να ανοίξει η καρτέλα του Windows Firewall. Εκεί πατάμε “Advanced settings”

    Στην καρτέλα του Windows Firewall with Advanced Security πατάμε New Rule και ανοίγει ο New Inbound Rule Wizard

    Στην πρώτη καρτέλα διαλέγουμε το Port και πατάμε Next

    Στην επόμενη καρτέλα διαλέγουμε το Specific local ports και βάζουμε την 8140 και πατάμε Next

    Στην επόμενη καρτέλα αφήνουμε το Allow the connection και πατάμε Next

    Στην επόμενη καρτέλα αφήνουμε τα apply rules όπως είναι και πατάμε Next

    Και τέλος δίνουμε ένα όνομα, π.χ. Puppet Agent, και πατάμε Finish για να δημιουργηθεί ο κανόνας. Host File
    Ο Agent πρέπει να επικοινωνεί με τον Master στο FQDN που ορίσαμε στον Master. Οπότε εφόσον δεν έχουμε DNS πρέπει να παραμετροποιήσουμε το host file του Windows Server.
    Ανοίγουμε ένα Notepad με Administrator Rights

    Πάμε στο file/open και ανοίγουμε το αρχείο “ C:WindowsSystem32driversetchosts”
    Προσθέτουμε στο τέλος το entry με τα στοιχεία του Master
    10.0.0.4 puppetmaster.puppet.lab

    Και κάνουμε save και κλείνουμε το Notepad
    Ανοίγουμε ένα Command Prompt και κάνουμε ένα ping στο FQDN του Master για να δούμε ότι απαντάει
    Hostname
    Πρέπει το certificate που θα εκδοθεί να είναι της μορφής puppetmaster.puppet.lab οπότε πρέπει να πούμε στον server να έχει αυτό το FQDN. Εφόσον ο Server δεν είναι σε Domain πρέπει να δώσουμε το DNS suffix χειροκίνητα.
    Ανοίγουμε τα properties της κάρτας δικτύου και πατάμε Properties

    Επιλέγουμε το IPv4 και πατάμε Properties

    Πατάμε Advanced

    Και στο πεδίο DNS Suffix δίνουμε το puppet.lab

    Πατάμε ΟΚ σε όλες τις καρτέλες μέχρι να κλείσουν. Σε αυτό το σημείο θα χάσουμε το RDP για 2-3 λεπτά. Μετά μπορούμε να ξανασνδεθούμε. Εγκατάσταση Puppet Agent
    Για να μας αφήσει ο Server να κατεβάσουμε τον agent πρέπει πρώτα να κλείσουμε το IE Enhanced Security Configuration. Από το Server Manager πάμε στο Local Server και πατάμε στο IE Enhanced Security Configuration και το κάνουμε Off μόνο για τους Administrators.

    Ανοίγουμε Internet Explorer και πάμε στη διεύθυνση https://downloads.puppetlabs.com/windowsκαι κατεβάσουμε το “puppet-3.8.3-x64.msi”. Σε περίπτωση 32bit λειτουργικού κατεβάζουμε το “ puppet-3.8.3.msi”
    Αφού κατέβει τρέχουμε το msi, ανοίγει ο Wizard και πατάμε Next

    Αποδεχόμαστε το agreement και πατάμε Next

    Στην επόμενη καρτέλα διαλέγουμε το path όπου θα εγκατασταθεί το Puppet Agent και δίνουμε το FQDN του Puppet Master

    Στην επόμενη καρτέλα πατάμε install για να ξεκινήσει η εγκατάσταση

    Αφού τελείωσε η εγκατάσταση πατάμε Finish

    Ανοίγουμε τα Services και ελέγχουμε ότι το Puppet Agent service είναι Running και Automatic

    Τώρα πηγαίνουμε στον Puppet Master για να δούμε αν ο Agent έχει κάνει certificate request ώστε να το κάνουμε sign. Τρέχουμε στον Puppet Master το command “puppet cert list”
    Ελέγχουμε να μας έχει φέρει certificate με όνομα “puppetslave03.puppet.lab”

    Και κάνουμε sign με puppet cert sign puppetslave03.puppet.lab
    Τέλος πηγαίνουμε στον Windows Server και κάνουμε restart το Puppet Agent service
    Για να δούμε ότι ο Agent μιλάει και δέχεται εντολές από τον Master ανοίγουμε το “Start Command Prompt with Puppet”

    Και τρέχουμε την εντολή “puppet agent –test”

    Εφόσον φέρει σε πράσινο τα Cashing certificate είναι ΟΚ
  22. proximagr
    <h1>Auto-Shutdown Hyper-V free with USB UPS</h1>
    <p>Recently i installed a Hyper-V 2012 R2 server (the free version) but my UPS doesn’t support Windows Core. No problem, we have PowerShell!! after some search on various sites – blogs – etc i end up creating the following script. It checks the battery status every 3 minutes, using WMI and when the battery drops below 50% is sends the shutdown signal. As long as you set the VMs to save on shutdown you are OK!</p>
    <p>I also added a simple mail notification before the shutdown.</p><pre class="crayon-plain-tag">$batterystatus = (get-wmiobject -class CIM_Battery -namespace "rootCIMV2").EstimatedChargeRemaining
    DO
    {
    start-sleep -seconds 180
    $batterystatus = (get-wmiobject -class CIM_Battery -namespace "rootCIMV2").EstimatedChargeRemaining
    $batterystatus
    } While ($batterystatus -gt 50)
    $login = "username"
    $password = "password" | Convertto-SecureString -AsPlainText -Force
    $credentials = New-Object System.Management.Automation.Pscredential -Argumentlist $login,$password
    Send-MailMessage -Body "UPS Started - Server will shutdown in 5 minutes" -From [email protected] -To [email protected] -Subject "Power Loss - UPS Started" -SmtpServer mail.domain.com -Credential $Credentials
    shutdown /s /t 300</pre><p> </p>
    <p><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&linkname=Auto-Shutdown%20Hyper-V%20free%20with%20UPS"title="Email" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_button_print" href="http://www.addtoany.com/add_to/print?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&linkname=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" title="Print" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/print.png" width="16" height="16" alt="Print"/></a><a class="a2a_dd addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&title=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" data-a2a-url="http://www.e-apostolidis.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/" data-a2a-title="Auto-Shutdown Hyper-V free with UPS"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a rel="nofollow" href="http://www.e-apostolidis.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/">Auto-Shutdown Hyper-V free with UPS</a> appeared first on <a rel="nofollow" href="http://www.e-apostolidis.gr">Proxima's IT Corner</a>.</p>


    <a href="http://www.e-apostolidis.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/"class='bbc_url' rel='nofollow external'>Source</a>
  23. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
    Η ιδέα είναι να έχουμε ένα SQL Flailover Cluster στο Primary Site και στο υπάρχον Cluster να προσθέσουμε ένα AlwaysOn Availability group για το DR. Λόγο του μεγέθους της υλοποίησης θα γίνει τρία Posts. Ένα το Failover Cluster, ένα η εγκατάσταση της SQL σε Failover Clster και ένα η υλοποίηση του AlwaysON Availability Groups.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1)
    Ξεκίνησα φτιάχνοντας ένα VM FreeNAS για να μπορέσω να έχω με όσα λιγότερα resources ένα ISCSI Storage. Το FreeNAS θέλει 2GB Ram για την εγκατάσταση και το initial setup αλλά μετά το κατεβάζω σε 512MB Ram, έτσι κι αλλιώς οι απαιτήσεις μου θα είναι ελάχιστες. Δεν θα μείνω σε λεπτομέρειες για την εγκατάσταση του FreeNAS, κατεβάζουμε το ISO από το http://www.freenas.org/download/και φτιάχνουμε ένα VM. Κάνουμε boot από το ISO και ακολουθούμε τον Wizard όπου διαλέγουμε δίσκο εγκατάστασης και δίνουμε root password. Τέλος αφού ανοίξει έχουμε 14 επιλογές, διαλέγουμε την 1 και ρυθμίζουμε το δίκτυο. Για το lab έδωσα 192.168.193.152/24
    Αφού ρυθμίσουμε το δίκτυο επιστρέφουμε στις επιλογές μόνο που πλέον μας ενημερώνει για την διεύθυνση του web interface, όπως στην εικόνα:

    Πριν κάνω login στο web interface έχω ήδη φτιάξει 2 δίσκους στο FreeNAS VM ώστε να αναλάβει ο wizard να φτιάξει volumes κλπ, αν και είναι πολύ απλό να τα κάνεις και manual στο FreNAS.
    Κάνω login στο FreeNAS web interface και ακολουθώ τον wizard. Δίνω pool name

    Δίνω share name και διαλέγω iSCSI

    Και αφού τελειώσει ο wizard έχουμε έτοιμο το iscsi target.
    Στη συνέχεια χρειαζόμαστε ένα Domain Controller. Μιας που μιλάμε για low resources lab, έφτιαξα ένα VM με 512 MB Ram και 1 CPU και έβαλα Windows Server 2012 r2 Core. Με sconfig.cmd ανοίγουμε τις επιλογές και δίνουμε computer name, IP κλπ

    Και στη συνέχεια με powershell τον κάνουμε Domain Controller. Πρώτα βάζουμε domain services και management tools και στη συνέχεια τον προμοτάρουμε σε domain controller και DNS.
     

    Install-WindowsFeature AD-Domain-Services –IncludeManagementTools
    Install-ADDSForest -DomainName "sqllab.int " -DomainNetbiosName "SQLLAB" -DomainMode Win2012R2 -ForestMode Win2012R2 -InstallDns –Force
     
    Έτοιμος και ο Domain Contoller. Πάμε για τα Cluster Nodes. Έχω φτιάξει ένα VM με 2GB Ram, 2 CPUs, 2 NICs & Windows Server 2012 R2. Sysprep και multiply και μπαμ έχουμε 3 όμορφα VMs.
    Μια λεπτομέρεια, επειδή θα χρειαστούμε σε όλα τα VMs Failover Cluster και επίσης η SQL 2012 θέλει .NetFramework 3.5, στο template VM βάζουμε και αυτά.
    Ξεκινάμε το Failover Cluster για να βάλουμε SQL.
    Ανοίγουμε το πρώτο VM, rename, στο lab το ονόμασα Win2012R201 (πρωτότυπο ε?) και κάνουμε join στο domain.
    Δίνουμε στην μια NIC μια IP που θα βλέπει το Domain και το FreeNAS και στην άλλη NIC ένα διαφορετικό subnet που θα βλέπει μόνο το άλλο Node. Για ευκολία έχω κάνει rename την μια κάρτα Domain με IP 192.168.193.153 και την άλλη Heartbeat με IP 172.16.5.1

    Στη συνέχεια ενεργοποιούμε το iscsi initiator από administrator tools και προσθέτουμε το iscsi target δίνοντας την IP του FreeNAS και πατώντας quick connect και μετά Connect και διαλέγουμε και το Multi path. Μετά στο Volumes and Devices tab πατάμε Auto Configure. Τέλος στο Device manager κάνουμε initialize τον δίσκο, format και του δίνουμε ένα γράμμα. Για test φτιάχνουμε ένα text αρχείο στο δίσκο.



    Το ίδιο κάνουμε και στο δεύτερο VM. Για να σιγουρευτούμε ότι και οι δύο μπορούν να γράψουν στον ίδιο δίσκο δημιουργούμε και εδώ ένα αρχείο. Σαν αποτέλεσμα πρέπει να έχουμε και τα 2 αρχεία.

    Ανοίγουμε το Failover Cluster Manager από τα Administrative Tools και πρώτα τρέχουμε το Validate Configuration, διαλέγουμε και τους 2 member servers που ετοιμάσαμε με το iscsi και τρέχουμε το test.

    Μόλις τελειώσει το validation κοιτάμε να μην έχει errors ή warnings και αν έχει τα διορθώνουμε και τον ξανατρέχουμε. Τέλος όταν έχει ολοκληρωθεί επιτυχώς, όπως στην εικόνα, το “create the cluster now using the validated nodes” είναι επιλεγμένο και πατώντας finish ανοίγει ο Create Cluster Wizard.
     
    Συνέχεια στην επόμενη σελίδα
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/sql-failover-cluster-with-alwayson-ag/
  24. proximagr
    Επειδή η τεχνολογία είναι ένα ποτάμι που ποτέ δεν σταματάει… και το μικρόβιό μας δεν έχει θεραπεία, ο Παντελής Αποστολίδης (IT Pro) από την Office Line και ο Μάνος Πέπης (DEV) από την Innovative Ideas με αρκετά χρόνια εμπειρίας στην αγορά και αρκετές πιστοποιήσεις σε τεχνολογίες Microsoft, Cisco, Azure, κλπ. σκεφτήκαμε να μοιραστούμε ένα οδηγό για DevOps στο Azure! Παρουσιάζοντας το Puppet, το πώς στήνετε στο Azure καθώς και μερικές από τις δυνατότητές του.
    Έτσι το Lab μας στο Azure έτρεχε με 1000 και το αποτέλεσμα παρακάτω…
     
    Τι είναι το Puppet και πως μπορούμε να το εκμεταλλευτούμε στο Azure
     
    Αυτοματοποιούμε τις διαδικασίες. Κινούμαστε γρήγορα. Αυξάνουμε της αξιοπιστίας και την ασφάλεια.
    Ο όγκος και η πολυπλοκότητα των υποδομών σε μια δομημένη μηχανογραφημένη εταιρεία ολοένα και αυξάνετε και γίνεται ποιο “smart”. Οι απαιτήσεις για ταχύτητα, αξιοπιστία, σταθερότητα, ασφάλεια ολοένα και αυξάνονται.
    Πώς μπορούμε να επιτύχουμε αυτή την ισορροπία; Σκοπός μας είναι να κάνουμε περισσότερα σε λιγότερο χρόνο! Και αυτό μπορούμε να το επιτύχουμε με DevOps…
    Η Υποδομή του Microsoft Azure προσφέρει ότι ακριβώς χρειαζόμαστε για να χτίσουμε όσα απαιτεί η επιχείρησή μας. Παρακάτω θα δούμε πως μπορούμε να ελέγχουμε και να κάνουμε Manage την υποδομή μας στο Azure με την χρήση του Puppet.
    To Puppet είναι μια Cross Platform ανοιχτού κώδικα (Open Source) που υποστηρίζει λειτουργικά Linux (CentOS, Debian, Fedora, Mandriva, Oracle Linux, RHEL, Scientific Linux, SUSE and Ubuntu), όπως επίσης multiple Unix systems (Solaris, BSD, Mac OS X, AIX, HP-UX), Mac OS X, καθώς και τα λειτουργικά της Microsoft.
    To Puppet αποτελείται από τα παρακάτω:


    1) Puppet Master – Ο κεντρικός server όπου διαχειρίζεται τα Puppet nodes (agents)
    2) Puppet Agent - o client που τρέχει στα managed Puppet nodes και επικοινωνεί – συγχρονίζει με τον Puppet master
    3) Foreman - ένα web περιβάλουν που απεικονίζει τα reports και ελέγχει τα resources της υποδομής μας  

    Προετοιμασία Azure Βήμα 1 Azure network
    Δημιουργούμε ένα Virtual Network. Αυτό μας δίνει τρία πλεονεκτήματα, ένα είναι το isolation, δεύτερον είναι οι Local στατικές IP και τρίτον είναι η δυνατότητα για Site-2-Site & Point-2-Site VPN.
    Για να δημιουργήσουμε ένα Virtual network, από το Azure Management Portal πατάμε New, διαλέγουμε Networking, Virtual Network, δίνουμε όνομα, Location και πατάμε create a virtual network

    Βήμα 2 Azure Cloud service
    Δημιουργούμε ένα Cloud Service, από το Azure Management Portal πατάμε New, διαλέγουμε Compute, Cloud Service και πατάμε Quick Create

     
    Δίνουμε όνομα στο URL και διαλέγουμε το Region ίδιο με του Virtual Network
     
    Βήμα 3 Azure Storage account
    Δημιουργούμε ένα Storage account, από το Azure Management portal πατάμε New, Storage και πατάμε Quick Create
    Δίνουμε όνομα, στην συγκεκριμένη περίπτωση openpuppetlab, διαλέγουμε το location που είναι και το Virtual Network, τέλος διαλέγουμε redundancy και πατάμε Create Storage Account .

    Βήμα 4 Azure VM | Puppet Master
    Δημιουργούμε ένα Virtual Machine, από το Azure Management Portal πάμε στα Virtual Machines και πατάμε New
    Και πατάμε «From Gallery”

    Για το Puppet 3.8 διαλέγουμε το Ubuntu Server 14.04 LTS και πατάμε το βελάκι δεξιά

    Δίνουμε όνομα, για Size ένας Puppet Muster θέλει τουλάχιστον ένα A2 (2 cores, 3.5 GB memory), δίνουμε username και επιλέγουμε το πεδίο “Provide a password” και δίνουμε password και πατάμε το βελάκι δεξιά

    Στην επόμενη εικόνα διαλέγουμε το cloud service, το Virtual Network Που δημιουργήσαμε στο Βήμα 1 (στο πεδίο Region/Affinity group/Virtual network) και το storage account που δημιουργήσαμε στα προηγούμενα βήματα. Στο Endpoint αλλάζουμε την Public πόρτα του SSH, για λόγους ασφάλειας, και πατάμε το βελάκι δεξιά
     

    Στην επόμενη εικόνα πατάμε το check για να δημιουργηθεί το VM.
    Βήμα 5 Στατική IP
    Για να δώσουμε στατική IP πρέπει να μεταβούμε στο νέο Azure Portal
    Πηγαίνουμε στο “Virtual Machines (classic)” και επιλέγουμε το VM

    Στην καρτέλα Settings πατάμε IP Addresses

    αλλάζουμε το IP address assignment κάτω από το Private IP address σε Static, δίνουμε την στατική IP που θέλουμε και πατάμε save

    Βήμα 5 Azure VM | Puppet Slaves
     
    Για τις ανάγκες του Lab θα δημιουργήσουμε δύο ακόμα Ubuntu Server 14.04 LTS αλλά θα χρησιμοποιήσουμε μικρότερου μεγέθους Virtual Machine.
    Ακολουθούμε την ίδια διαδικασία όπως στο βήμα 4 μόνο που στην οθόνη 2 του “Virtual machine configuration” δίνουμε όνομα “ puppetslave01” και διαλέγουμε ένα A0 (shared core, 768 memory)
     
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mop11.jpg
     
    Στην επόμενη οθόνη, δίνουμε τα ίδια για cloud service, virtual network & storage account, αλλά στο Endpoint πρέπει να δώσουμε διαφορετικό Public Port διότι η εξωτερική IP είναι ίδια. Για το lab δίνουμε την πόρτα 30022
     
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mop07.jpg
     
    Κάνουμε την ίδια διαδικασία και για να φτιάξουμε και δεύτερο Puppet Slave, αλλάζοντας μόνο το όνομα και το Public Port. Για το Lab έφτιαξα το puppetslave02 με πόρτα 30023
    Αφού δημιουργηθούν τα VMs ακολουθούμε το Βήμα 5 για να δώσουμε στατικές IP, στο Lab έδωσα 10.0.0.5 & 10.0.0.6 αντίστοιχα
     
    SOURCE: http://www.e-apostolidis.gr/%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC/puppet-on-azure-step1-azure-preparation/
  25. proximagr
    Puppet On Azure Εγκατάσταση & Παραμετροποίηση του FOREMAN για να έχουμε γραφικό περιβάλλον μέσω WEB
    Το Open Puppet δεν έχει γραφικό περιβάλλον στην βασική του εγκατάσταση. Υπάρχουν μερικά open source προγράμματα τα οποία μπορούν να προτεθούν στο Puppet Master και να μας προσφέρουν γραφικό περιβάλλον. Ένα από τα καλύτερα είναι το Foreman. Με το Foreman μπορούμε να διαχειριστούμε το Puppet πλήρως.
    Το Dashboard του Foreman:

    Εγκατάσταση:
    Συνδεόμαστε στο Puppet Master με SSH, κάνουμε login και τρέχουμε την εντολή “sudo su -“ για να γυρίσουμε σε root
    Ενεργοποιούμε τα repositories για το Foreman
    echo “deb http://deb.theforeman.org/trusty 1.9” > /etc/apt/sources.list.d/foreman.list echo “deb http://deb.theforeman.org/ plugins 1.9” >> /etc/apt/sources.list.d/foreman.list wget -q http://deb.theforeman.org/pubkey.gpg -O- | apt-key add – Τρέχουμε την εγκατάσταση με foreman-installer
    Μόλις τελειώσει η εγκατάσταση μας ενημερώνει για το link του Web interface και τα credentials.
    Μπορούμε να ανοίξουμε την πόρτα 443 από το Endpoint του Azure ώστε να έχουμε την κονσόλα και απ’ έξω.
    Από το Azure Management Portal διαλέγουμε το VM του Master Puppet και πηγαίνουμε στα Endpoints

    Στη συνέχεια πατάμε ADD και διαλέγουμε “Add a stand-alone endpoint”


    Στο πεδίο Name διαλέγουμε από το Drop down menu το HTTPS
    pΒλέπουμε στα Endpoints έχει προστεθεί το HTTPS

    και πλέον μπορούμε να κάνουμε browse στο link του Cloud Service Ανοίγουμε τον browser και κάνουμε login στο Foreman από την public διεύθυνση, στα certificate prompts πατάμε και στα δύο cancel.
    Μπαίνουμε στο Dashboard
    Πάμε στο Hosts και πατάμε All Hosts για να δούμε το Status των Agents
    Πατώντας στο όνομα ενός host μπορούμε να δούμε περισσότερα στοιχεία
    Statistics


×
×
  • Create New...