{"id":2088,"date":"2011-01-29T11:08:54","date_gmt":"2011-01-29T10:08:54","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2088"},"modified":"2011-01-31T17:22:39","modified_gmt":"2011-01-31T16:22:39","slug":"deploying-server-and-apps-with-opalis-service-manager-and-virtual-machine-manager","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2088","title":{"rendered":"Deploying servers and software with Opalis, Service Manager and Virtual Machine Manager"},"content":{"rendered":"<p>In my sandbox I often need to install a new server or a new server application for example SQL, IIS or Operations Manager. Unfortunaly I have never really learned how to use Configuration Manager to do that, deploy software and operating system. But lucky for me I have learned a bit about Virtual Machine Manager (VMM), Service Manager (SCSM) and Opalis. In this post I will describe for you how I deploy servers and apps in my sandbox.<\/p>\n<p>The picture below show the policy I have for deploying new virtual servers. It includes a number of objects that first decide which VM host to use and then deploys the server. It all starts with a change request in Service manager. I will try to explain each step in the policy.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM09.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2089\" title=\"OpalisVMM09\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM09-300x120.jpg\" alt=\"\" width=\"300\" height=\"120\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM09-300x120.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM09.jpg 993w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<ol>\n<li>The first object is from the Service Manager IP. I have built my own activity class in Service Manager, a deploy server activity. The new activity management pack includes a form where I can input VM Name, description and server type. Server type is a way to set which hardware to use, for example my DC machines will only\u00c2\u00a0get 1GB RAM. When\u00c2\u00a0a instance of this class gets in status &#8220;IN PROGRESS&#8221; Opalis will pick it up and start the policy.\u00c2\u00a0I have a blogpost <a href=\"http:\/\/contoso.se\/blog\/?p=1945\">here<\/a>\u00c2\u00a0about writting a new custom activity class and integrate with Opalis, it also includes step how to use the new activity in a change request template.<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/SCSM01.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2109\" title=\"SCSM01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/SCSM01-300x237.png\" alt=\"\" width=\"300\" height=\"237\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/SCSM01-300x237.png 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/SCSM01.png 443w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2090\" title=\"OpalisVMM02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM02-265x300.jpg\" alt=\"\" width=\"265\" height=\"300\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM02-265x300.jpg 265w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM02.jpg 554w\" sizes=\"(max-width: 265px) 100vw, 265px\" \/><\/a><\/p>\n<ol>\n<li>The following three objects is QMI Query objects. They query each of my\u00c2\u00a0Hyper-V Hosts for free memory. I want to deploy the new server to the host with most free RAM. Each of the WMI Query objects have a link to a Operations Manager object that will generate an alert if the policy cant query a machine for free RAM.<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM13.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2091\" title=\"OpalisVMM13\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM13-300x177.jpg\" alt=\"\" width=\"300\" height=\"177\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM13-300x177.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM13.jpg 724w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>Next item is a RUN .NET Script object. It runs a\u00c2\u00a0Powershell script. This script compare each of the hosts and returns the host with most free RAM. I guess I could solve it with a number of compare value objects, but it is easier with a script and it is only one object in the policy. As you can see in the beginning of the script I use DIV to get the free memory value in GB format.<br \/>\n<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM22.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2094\" title=\"OpalisVMM22\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM22-228x300.jpg\" alt=\"\" width=\"228\" height=\"300\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM22-228x300.jpg 228w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM22.jpg 637w\" sizes=\"(max-width: 228px) 100vw, 228px\" \/><\/a><\/li>\n<li>The\u00c2\u00a0&#8220;Map Published Data&#8221;\u00c2\u00a0object, Map Disk, is used to map which disk to use and which template to use. Depending on which\u00c2\u00a0Hyper-V server that has most free RAM, I want to use different logical disks. This object also map the server type fromthe Service Manager change request to a template in Virtual Machine Manager. The template controls what kind of hardware the virtual machine will get. For example if the server type is DC it will use a template with only 1 GB RAM.<\/li>\n<li>The &#8220;Create VM From Template&#8221; object connects to Virtual Machine Manager and creates the new virtual machine. I notice that when you work with this object, and want to test the connection to VMM, it does that from the machine where you run the console, not from the action server where you will run the policy. In my case my workstation did not have WS management installed, so the connection test failed. Instead I did that part from the Opalis server.<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM12.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2095\" title=\"OpalisVMM12\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM12-300x249.jpg\" alt=\"\" width=\"300\" height=\"249\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM12-300x249.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM12.jpg 613w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2098\" title=\"OpalisVMM01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM01-300x63.jpg\" alt=\"\" width=\"300\" height=\"63\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM01-300x63.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM01.jpg 567w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\u00c2\u00a0<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2099\" title=\"OpalisVMM03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM03-300x260.jpg\" alt=\"\" width=\"300\" height=\"260\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM03-300x260.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM03.jpg 802w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<li>The two &#8220;Update Activity&#8221; objects updates the change request in Service Manager.\u00c2\u00a0One if the machine cant be created and one if it worked out fine. As you can see in the picture I have updated the status of the change request and also added some info about where the virtual machine was created and which template that was used. All steps to update a change from Opalis is in <a href=\"http:\/\/contoso.se\/blog\/?p=1945\">this<\/a> post.<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM05.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2096\" title=\"OpalisVMM05\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM05-243x300.jpg\" alt=\"\" width=\"243\" height=\"300\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM05-243x300.jpg 243w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM05.jpg 549w\" sizes=\"(max-width: 243px) 100vw, 243px\" \/><\/a><\/p>\n<p>Now when you have a easy way to create a new virtual machine the next step would be to install something on it, for example SQL server. This can also be done with Opalis \ud83d\ude42 I have built a library of policies that each install small parts of a complete server. For example I have a policy to add the .NET Framework feature on a server.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM08.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2104\" title=\"OpalisVMM08\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM08-300x171.jpg\" alt=\"\" width=\"300\" height=\"171\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM08-300x171.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM08.jpg 855w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">I have another policy to unattend install SQL server. This policy first creates C:\\temp, if the folder don&#8217;t exists. It then copy a INI file from a network file share. The INI file is the &#8220;answering&#8221; file for the SQL installation. It contains all the settings that you normally input manually during SQL installation. The policy then run the SQL setup, &#8220;D:\\setup \/ConfigurationFile=C:\\temp\\SQL2008R2_OPSMGR.ini \/QUIET&#8221;. It is pretty easy to get the SQL unattend file, when you run the SQL setup wizard, on the last page you will see a path to a configuration file. You can copy that file direct from the path. The only thing I added to the INI file\u00c2\u00a0was\u00c2\u00a0&#8220;IAcceptSQLServerLicenseTerms=&#8221;TRUE&#8221;&#8221;<br \/>\n<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/sql01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2106\" title=\"sql01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/sql01-300x227.jpg\" alt=\"\" width=\"300\" height=\"227\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/sql01-300x227.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/sql01.jpg 810w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM07.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2105\" title=\"OpalisVMM07\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM07-300x180.jpg\" alt=\"\" width=\"300\" height=\"180\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM07-300x180.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM07.jpg 531w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">When you have created your own library of policies that install and prepare machines you can create different &#8220;master workflows&#8221; that will create a new machine, install the application and configure the server for you. For example a &#8220;master policy&#8221; from installing a new Operations Manager server. This policy will then trigger the other policies.\u00c2\u00a0I use it almost every day in the sandbox and it saves me a lot of time. The policy below is a &#8220;master policy&#8221; for a new SQL server. It starts with a change request in Service Manager, it creates a new machine, run server setup to add for example .NET Framework and then it\u00c2\u00a0install SQL server. It finish by updating the change request. I have a notification in Service Manager that will notify me by e-mail\u00c2\u00a0when then machine is ready. If you want to take a look at the policy for the new machine, you can download it here <a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/6.1-New-Virtual-Machine.zip\">6.1 New Virtual Machine<\/a>\u00c2\u00a0<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM06.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2108\" title=\"OpalisVMM06\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM06-300x170.jpg\" alt=\"\" width=\"300\" height=\"170\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM06-300x170.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/01\/OpalisVMM06.jpg 493w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Please note that this is provided \u00e2\u20ac\u0153as is\u00e2\u20ac\u009d with no warranties at all<strong>. <span style=\"color: #ff0000;\">Update: There is a extension to the VMM IP that you can download <a href=\"http:\/\/opalisvmmextended.codeplex.com\/\">here<\/a><\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my sandbox I often need to install a new server or a new server application for example SQL, IIS or Operations Manager. Unfortunaly I have never really learned how to use Configuration Manager to do that, deploy software and operating system. But lucky for me I have learned a bit about Virtual Machine Manager &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2088\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[58,25,35],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2088"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2088"}],"version-history":[{"count":20,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2088\/revisions"}],"predecessor-version":[{"id":2122,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2088\/revisions\/2122"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2088"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}