Set up a pre-production environment...

My current employer has a pre-production environment that is being updated nightly from the production. I started to look at how it is done (powerCLI script) and I'm trying to make things better.

Here's how it works.

A snapshot is taken of production servers, which 'freeze' the base vmdk disk. A new virtual machine is created for pre-production and it uses the 'frozen' drive to the production server database, because it is not persistent mode, clean disc. Of course, the virtual machine is connected to a group of isolated ports. Basically, this allows the team dev/infra to have an identical copy of the production servers anytime (just run the refresh script).

While this works very well, I have a problem on using disks of production for this purpose. Usually, I prefer to leave only one production and complete clones have either fully provisioned pre-production environment.

Suppose I'm onboard with happens like that and I want to automate the creation of these reservoirs of pre-production. Right now they are built manually to the new servers, and then the refresh script.

Refresh the script:

(A) pre-production shutdown server

(B) remove the snapshot on the production server (committing the latest changes to the base vmdk)

(C) create new snapshot to the production server (freeze the base vmdk)

(D) Power Server pre-production (with validated changes)


This script is scheduled every night to start the next day with a cool environment. Another advantage of this approach that is not persistent, it is that a simple reboot brings the pre-production back to a clean version (if tests are not doing well).

Issues related to the:

Is there a way to clone a virtual machine without the disc? This would make the easy creation of new servers in pre-production. Clone, log drives, change the port group. Fact.

Is there a better way to achieve that kind of result without this kind of 'false linked clones?

The following seems to work for me. A few notes:

  • The virtual machine is cloned without any of its VMDK
  • The new virtual machine is created on the same node of ESXi and store data as a source of VM (since you don't seem to have special requirements in this aspect)
  • This script does not work for a virtual computer with RDM disks

$vmName = "sourceVM".

$vmClone = "cloneVM".

$folderName = "MyBlueFolder".

$vm = get-VM-name $vmName

$folder = get-file-name $folderName

$spec = new-Object - TypeName VMware.Vim.VirtualMachineCloneSpec

$spec. Location = New-Object - TypeName VMware.Vim.VirtualMachineRelocateSpec

$spec. Location.Datastore = $vm. ExtensionData.Datastore [0]

$spec. Location.Host = $vm. ExtensionData.Runtime.Host

$spec. Config = New-Object - TypeName VMware.Vim.VirtualMachineConfigSpec

Get-disk hard - VM $vm | %{

$dev = new-Object - TypeName VMware.Vim.VirtualDeviceConfigSpec

$dev. Device = $_. ExtensionData

$dev. Operation = [VMware.Vim.VirtualDeviceConfigSpecOperation]: remove

$dev. FileOperation = [VMware.Vim.VirtualDeviceConfigSpecFileOperation]: destroy

$Spec.Config.DeviceChange += $dev

}

$vm. ExtensionData.CloneVM_Task ($folder. ExtensionData.MoRef, $vmClone, $spec)

Tags: VMware

Similar Questions

  • Need help to synchronize the pre-production and production box init parameter

    Hello

    I have a HP - UX 11i production database. The database is the CARS with 3 instances. The storage is on ASM. Recently, we have created a database of pre-production for tests on RedHat Linux 4 worm. Here are the details of the environment 2:

    Production: HP - UX 11i, 24 GB of RAM, 8 CPU, Oracle 10g R2

    Pre-production: RED HAT ver 4, 16 GB RAM, 4 CPUS, Oracle 10 g R2

    Basically everything in creation the two environment are not identical configuration. Now, I need to bring to the pre-production environment in harmony with the environment of Production from the point of view oracle init parameter. I have listed down below below the parameters that is different. Please tell me how many of these parameters can be bring in sync. Setting shmmax doesn't set on the two core area is 4 GB.

    Name of the parameter of V$, value on Production - value on the pre-production
    -----------------------------------------------------------------------------------------------------
    cpu_count----------------------------------8-------------------------------------     4
    CURSOR_SHARING - EXACT - FORCE
    db_recovery_file_dest_size - 32212254720 - 15032385536
    dml_locks----------------------------------1472----------------------------------748
    fast_start_parallel_rollback - LOW - FALSE
    filesystemio_options - asynch - no
    LARGE_POOL_SIZE - 33554432 - 0
    log_buffer - 14493696 - 7012352
    log_checkpoints_to_alert - TRUE - FALSE
    open_cursors - 1000 - 300
    parallel_execution_message_size - 2152 - 2148
    PARALLEL_MAX_SERVERS - 160-80
    pga_aggregate_target - 2147483648 - 1692401664
    processes----------------------------------     300-----------------------------------150
    session_cached_cursors - 100-20
    sessions------------------------------------     335-----------------------------------170
    SGA_MAX_SIZE - 5368709120 - 675282944
    SGA_TARGET - 3221225472 - 675282944
    sql92_security - FALSE - TRUE
    standby_file_management - MANUAL - AUTO
    transactions - 368-187
    UNDO_RETENTION - 10800 - 1800

    Thank you

    NOTE: You must be a query V$ PARAMETER ISDEFAULT = "FALSE" only to identify the paraemters which are or have to be defined.
    You must identify these paraemters which are explicitly defined by the DBA, rather automatically determined by Oracle.

    1. you do not explicitly set or change cpu_count. Let Oracle automatically set it based on the number of processors / cores he sees as being available. (if you have multiple instances of database on the same server, each instance will 'see' the same number of processors / cores)

    2 cursor_sharing must always be the same development, pre-production and Production. However, I would first of all ask allows you to determine why it has been set by the dint of Production. That must be done only after careful consideration and test!

    3 db_recovery_dest_file size is relevant for backups RMAN identified by db_recovery_dest disk space. If it is not relevant to this discussion.

    4 dml_locks, sessions, transactions, etc. are all automatically determined by Oracle based on the PROCESS.

    5 fast_start_parallel_rollback is irrelevant. I wonder why it has been explicitly defined?

    6 filesystemio_options really depends on your platform. HP - UX 11i and Redhat Linux are very different.

    7 are defined explicitly large_pool_size and log_buffer? Or they remain to be determined automatically by Oracle based on other parameters (SGA_TARGET for example)?

    8 open_cursors, generally not be set unless you have an application that really opens up very many cursors by session. Why is defined differently? It is a per session setting.

    9. I suppose that parallel_max_servers is not explicitly defined, but remains to be determined by Oracle based on other parameters (for example cpu_count).

    10. I wonder if parallel_execution_message_size has been explicitly defined or is automatically defined by Oracle and OS dependent.

    11 pga_aggregate_target would have explicitly set the appropriate value based on your hardware and its use must be determined.

    12 session_cached_cursors generally didn't need to be explicitly defined. If it is set, why he is set on these different values?

    13. Why is SQL92_SECURITY explicitly different?

    14 standby_file_management is not relevant here.

    15 undo_retention could be about the same.

    Your REAL concern should be the values defined for CURSOR_SHARING and SQL92_SECURITY. These are the only ones who are really identical in both environments. The others are "setting buttons" while these "fix"behavior ".

    Hemant K Collette

  • Installation of pre-production in Oracle 11 g RAC 2

    Hi friends,

    I want to do a production in our environment in 2-node RAC 11.2.0.4.

    What is the best way to get the structure of the database of production on my pre-production without data.

    Thank you and best regards,

    Arya

    Hi Arya,

    You can create a DBCA model for the existing database, copy the template on the target server files and create the database by using the same model. Another option is to use Datapump Metadata_only.

    Thank you

    Abbas

  • How to clone of pre-production to the production database in Oracle 10g?

    I'm a newbie DBA and gave me this task to clone a primary DB environment preprodcution of Production environment. I tried Googling, but all other positions have different and confusing steps. Can someone help me get the exact steps please?

    sweetritz wrote:

    Hi EdStevens,

    I'm a newbie Oracle DBA. Yes prod server has a database running on it and I want to clone a DB of preproduction on the Prod as an extra DB server (fusion has not any data with any DB existing).

    then I would say rman DUPLICATE DATABASE is your best choice.  And it does not require the Pb of pre-production to be arrested, only that you take backups rman (Yes, online backups work as long as you have the necessary archivelog files.)

  • Migration of the repository of security in a Production environment

    Hi, I use jdev11g and I'm trying to deploy and app with authentication and authorization of weblogic 10 gr 3, I'm looking at the "migration of the repository of security in a Production environment" section an i do not find these settings and other parts of this section: "

    fromCredStore the name of the identifying information from the source store service instance listed in the entrance to jps-default context (identified by the name of your application)
    fromPolicyStore the name of the source store service instance listed in the entrance to jps-default context (identified by the name of your application)
    srcFolderLocation the path to the file local cwallet.sso
    destFolderLocation the path to the target cwallet.sso file
    srcFolderLocation the path to the file local jazn-"Data.xml"
    destFolderLocation the path to the target system-jazn-"Data.xml" file

    I have no problem deployment of authentication only, the problem is when I use the option "authentication and authorization" for security, I can't log in to any user that I have defined, as the error page, I set you only identical to the login page and it returns me to the page of connection/error all the time connect with any user I defined.
    I wonder is there any link or video with an example of this, cause there seems little complex, thanks in advance.

    Published by: Julio IP on November 10, 2008 15:37

    Hello

    Please report to us. In fact, we are developing a tutorial Oracle for example covering the safety of the ADF. There is no video or other of the documentation

    Frank

  • (Redirected) A week pre-production Alienware backpack

    Hi, my order number is [Admin Note: personal information deleted] customer number and is [Admin Note: deleted personal information]. I ordered a bag Alienware backpack October 13 and it's been a week and the status of the order is still in pre-production. is it so difficult for dell to send just a bag on back? or they have to make a backpack manually?

    Better to post this thread in the Customer Care Forum here:

    http://en.community.Dell.com/support-forums/customercare/f/4674.aspx

    Bev.

  • Error 401 during the passage of the assessment of the production environment

    Hello

    We recently moved our application for assessment of the production environment by using the credentials provided by the Push of BB Services, only to find out that we receive an "HTTP 401 - PushServiceId/password status invalid in the authorization HTTP header" whenever we try to send a push notification.

    We do not have change our code (which works very well using assessment data) at all except for his replacement by credentials. We use the URL https://cpxxx.pushapi.na.blackberry.com/mss/PD_pushRequest to send our push notifications, where xxx is the CPID provided by BlackBerry, and we're certainly using the password for the initiator to push (instead of the password for the portal content provider).

    Needless to say that we are base64 encoding app id and the password in the header, and as I said if switch back us to the environment assessment (change credentials), everything works fine.

    This becomes a problem, I would appreciate help if someone was faced with a similar problem.

    That's all. He works with the new credentials.

    Thank you.

  • ORDS3.0EA can be used in a production environment

    Hello:

    I had planned to launch a project to deploy a Web service with ADR 2.0 and probably with Apex.

    But now ORDS3.0 EA was released. I can deploy without apex, and it has a function to simply deploy webservice.

    So now I need to decide whether to use ORDS2.0 or 3.0 in my project.

    EA can be used in a production environment? Can the project to have a month or two for the kickoff, if I have a question in the EA version, I raise a SR on EA version?

    Please consult the readme.html in the distribution, as he says it, EA builds are NOT supported for production use

  • On the VSAN architecture in production environment

    Hi guys.

    What is the best architecture VSAN for a production environment?

    All in one VSAN witch cluster storage and VM on the same cluster or node have a VSAN cluster 2 cluster and another with a virtual machine, only that store a virtual disk on the VSAN cluster?

    Thanks in advance.

    If I understand the question, then you don't have the choice with the current versions of the VSAN.

    In order to access the database VSAN, the virtual machine must be deployed to an ESXi host computer that is part of the VSAN pole.

    The VSAN data store can be exported outside to ESXi hosts that do not participate to the VSAN cluster.

    HTH

    Cormac

  • BIEE 11 g, how could I Stéphane newspaper in a new production environment page?

    I want to Stéphane, the login page in the environment from development to a production environment,

    any suggestions?

    You need to work on the location of \FMW\Oracle_BI1\bifoundation\web\msgdb\pages\common\signin.html and page signin.html

    Copy of files like regular might work

    ~ http://cool-bi.com

  • View production environment

    IM currently only single local mode only viewplanner workloads running but looking at several courses of vm. Someone had problems with the viewplanner agent in a production environment? Already, we have an existing mode of production environment and won't cause problems.

    We are not aware of any problems so far and there were several virtual machines 100 + run without any problem. Can you PM me your email address and we cam discuss your use case in further detail.

  • addition of virtual machine / Server esx for production environment

    Hello

    How can we add virtual machine or esx server for production environment?

    In general... As his "simple terms?

    Install ESXi host

    Install, run and connect to the host via the gateway client installed from the host on an external workstation

    Then

    OR THE OTHER

    Install and run the converter on each physical computer that you want to become a virtual machine

    Once finished, turn off power to virtual and physical.

    OR

    Create a virtual machine and install the o/s CD drive.

    What you want is way off the coast without 1 million questions about your installation.

  • Isolate the production environment servers in a test environment

    I would like to create a clone of my production SQL and Sharepoint server environment and isolate the servers from the rest of the environment. What I want to do is to create a new volume on my SAN and clone the two servers to it. After that, I want to always allow access to a consultant in order to access servers remotely while not allowing the rest of the production environment to see the servers. Is there an easy way to configure this?

    You can work with NAT.

    Add a virtual machine acting as a NAT and gateway in this "isolated" network

    Or, simpler, add a server or a client with a dual NIC, an isolated network and the other in the local network.

    André

  • How to use the command import on the production environment?

    Hi gurus of the OFA.

    I want to know about the production environment OAF and development environment, the differences between them and how to use the command import on the production environment?



    Concerning

    Ajay Sharma
  • How to deploy my portal to the production environment

    Hi all

    I use the ASDK developed an access portal, my question is how to deploy my portal to the production environment? You must also install the ASDK in a production environment? Or just install the package of execution?

    Thank you
    Alan.H

    Hello Alan,.

    Is this an application ASDK 10 g or 11g? In both cases, the answer is really the same thing: do not install the ASDK in the production environment, but for 11g it's much easier to do.

    Kind regards
    Colin

Maybe you are looking for