Manual VMotion circumvents the rules of the DRS anti-Affinity

Hello

just a really Basic... I know DRS rests on the idea that he leans on the cluster and then resources place virtual machines... BUT, if you configure a rule anti-xxx to say VM1 cannot be kept the same host that VM2 - can I still manually vMotion VM1 to the same host only a VM02 on?

OK... Let me rephrase that. After having just... I asked myself why I cannot vmotion 2 virtual machines to be on the same host, even if there is an anti-home rule?

My hypothesis is one of the following:

1. I have not configured the anti-home rule correctly, or

2 DRS is a retrospective resource, monitoring tool. so he will ignore my action, but when it checks the environment, it will then search the vm 2 is on the same host and then applies the rule of the anti-xxx.

Let me know that if you can...

Thank you

Aaron

Welcome to the community - Yes, you can manually vmotion a virtual machine that would violate the rule of the affinity of the DRS but if you DRS in partially or entirely automatice mode it will vmotion virtual machine don't not to violate the anti-home rule.

Tags: VMware

Similar Questions

  • DRS anti-affinity rules

    Hello world

    I want to create anti-affinity rules machine virtual-VM for 4 virtual machines. We use vSphere 4.0 U2 on our environment.

    What would be the number of rules that are created on the DRS Cluster?

    It's 6 rules? What is different now.

    4 VMS = 6 rules (VM1/VM2 VM1/VM3 VM4/VM1, VM2/VM3, VM4/VM2, VM3/VM4)

    gedelar wrote:

    It's 6 rules? What is different now.

    If you upgrade to vSphere 4.1, that one rule would be necessary, but I guess on 4.0, you must create these six different rules.

    http://www.VMware.com/files/PDF/Techpaper/VMW-whats-new-vSphere41-HA.PDF

    "Finally, rules anti-affinity machine VM-virtual can now integrate more than two virtual machines." Here, VMware DRS try remove the virtual machines specified. Users could use this rule to ensure that some virtual machines are always on different physical hosts. »
  • Help determine the best anti-affinity configuration

    I'm starting to soak in the VM and host rules of affinity for the first time.  One of our clients is looking to have 30-40 MV spun up use for distributed processing.  They want to ensure that in the event of a host failure, they will also have few virtual machines down at any time.  It seems that we should be able to use rules anti-affinity vm to achieve this goal to force them to be distributed evenly across all hosts in the cluster.

    I've not had much luck tracking examples of scenarios, so I had a few questions about how it would work.  I thought create a single rule anti-affinity VM and put all the VMS of 30-40 in there.  I guess, from what I've read, that he would do his best to satisfy the rule balancing on all hosts, although this can mean 2 virtual machines exist on the same host.  Would this work?  This would cause alerts or errors, if we had several virtual machines as the hosts?  Or I have to configure several rules to allow it works without error.

    Affinity VM rules would make the most sense here, or affinity host rules would be relevant here, and we would be preferred over the other?

    Thank you.

    It's one of the paramets when creatung rule will solve this dilemma - you need to set the value specification 

    Not run on hosts in a group that will keep separate virtual machines but allowing them to run on the same host if necessary-

  • Storage of DRS manual mode via the web client

    I tried to get used to the web client.  In the windows client, I know how to do it with my eyes closed, but can't seem to find the guy in the Toilet.

    Through the documentation, I found on how plan sound and put in place the DRS, but cannot find the manual recommendations or how to apply them.

    Am I missing something, or is it simply not there?

    Hello

    Welcome to the communities.

    Very interesting link will definitely help you.

    http://frankdenneman.nl/2013/01/09/vsphere-5-1-web-client-vm-overrides-storage-drs-automation-level-overview/.

    "a journey of a thousand miles begins with a first step."
  • SQL 2012 still on the use of affinity rules

    Hey guys,.

    I use SQL 2012 alwaya time on in a virtual, but so far, it is not configured as best practices and environment I wanted to change that.

    At the moment I have no DRS rules in place so it can happen that two virtual machines running on the same host and it's something I want to avoid.

    However, my big problem is that I only got a SQL license for two hypervisors and best practices talked about four hosts who are needed to achieve my goal.

    Here is what I intend to implement:

    -Affinity rule machine virtual-VM to separate two virtual machines

    -Affinity VM host rule which VM1 MUST run on ESX1

    -Affinity VM host rule that VM2 MUST run on ESX2

    This configuration is a good idea or could / should I do something different?

    What I found that all the features how for example the evacuation and HA should still work?

    There are many more ESX servers in this group and they will be used in the case of an outtage, right?

    Also there is a dev environment that looks the same. I could include the hosts in the same VM-Host affinity rules or should I create new ones?

    BTW. I am using vCenter and ESX 5.5.0.

    Thank you very much!

    See you soon

    Nicolai

    Affinity rules those you intend to sense. These rules will not be those virtual machines to be on the same host most of the time.

    Note:

    1 rule of VM host is configured as "SHOULD", in extreme cases, DRS can break these rules. However, in the next invocation of DRS, DRS will try to resolve the violations.

    2. Note that: when you keep either the host in maintenance (ESX1 or ESX2) mode, you must manually migrate the VM to another host due to the virtual-VM anti rule machine affinity. DRS even in full auto mode, VM will not be migrated automatically. This will apply only if there are only 2 host in the cluster.

    3. Yes, HA should well with that: however HA is not aware of the rules 'EXPECTED' and in the case of host failure it can not respect 'SHOULD' rule.

    4 rule anti-affinite VM - VM can be sensitized HA using the advanced option. Let me know if you want to help with that.

    5. Yes, failure of other hosts in the cluster will be used but please updated on impact due to rules & licenses.

    6. "There is also an environment-dev which looks the same." I did not follow what exactly you mean here:

    7 migration threshold settings DRS is also important.

    8 DRS gives priority to the prevention of violations of anti-affinity rules machine virtual-VM that violations of rules of affinity. (it's just for your info.)

    Nevertheless,.

    1. If ESX1 falls down or affinity rule VM host that VM1 MUST run on ESX1 gets violated: VM1 can be migrated to other hosts in the cluster. As you have no licenses (more than 2) SQL, how it would be dealt with (I'm not very updated on the SQL licenses)

    2 point above applies to the second rule of VM HOST as well.

  • Backup/restore DRS VM affinity/anti-affinity rules - can they be backed up and restored without re-entering manually after DRS disabled?

    DRS VM affinity/anti-affinity rules - these are lost when the DRS is off - they can be "listed" via perl or script Toolkit VI to return to manual if necessary.

    But can they be backed up / restored through automated methods for easy recovery in case required or accidental deactivation of the DRS? What happens if a user of vCenter turns off instead of the manual setting during operations?

    I have over 100 + VM DRS affinity/anti-affinity rules to maintain.

    There are indeed several DRS rules related cmdlets in the VITK 1.5.

    The following script will save all rules in a .txt file.

    $outfile = "C:\rules.txt"
    Remove-Item $outfile
    $clusterName = 
    $rules = get-cluster -Name $clusterName | Get-DrsRule
    
    foreach($rule in $rules){
      $line = (Get-View -Id $rule.ClusterId).Name
      $line += ("," + $rule.Name + "," + $rule.Enabled + "," + $rule.KeepTogether)
      foreach($vmId in $rule.VMIds){
        $line += ("," + (Get-View -Id $vmId).Name)
      }
      $line | Out-File -Append $outfile
    }
    

    The reason why we are writing the rules in a .txt file is because the type of 'Solidarity' with the rules can have 2 or more guests defined.

    This type of info (variable length table) is impossible to export to a. CSV file.

    The 2nd script reads this external file and sets the rules.

    $file = "C:\rules.txt"
    $rules = Get-Content $file
    
    foreach($rule in $rules){
      $ruleArr = $rule.Split(",")
      if($ruleArr[2] -eq "True"){$rEnabled = $true} else {$rEnabled = $false}
      if($ruleArr[3] -eq "True"){$rTogether = $true} else {$rTogether = $false}
      get-cluster $ruleArr[0] | `
        New-DrsRule -Name $ruleArr[1] -Enabled $rEnabled -KeepTogether $rTogether -VM (Get-VM -Name ($ruleArr[http://4..($ruleArr.Count - 1)|http://4..($ruleArr.Count - 1)]))
    }
    

    [The trick used for guests, it's that we select the part of a table with the \[a... scoring b\].

    Currently, you will need to run the first script for each cluster separately, but this could be easily adapted to run on all clusters in your VI.

  • Script to check the DRS VM groups?

    Hello guys,.

    I want to know if you could give me an idea on how to check the DRS of VM groups on my cluster.

    DRS group are created with a shared identifier that is common on the VM too. For example: VMS DRS group R125 must include each VM name "R125" is included (such as VM-R125-001).

    First of all, I would like to work on a script that will be able to detect if certain VM are not in their groups of DRS corresponding VM (by listing for example) and later add an e-mail notification if possible.

    I would like to know if you could give me some advice on how to run this script, what cmdlet should I use, etc.

    Thank you very much

    Kind regards

    Benedict.

    EDIT: VM DRS group and not of DRS rules

    Try like this

    Import-Module DRSRule

    #

    # Specifications cluster

    $cluster1 = "ClusterName".

    $cluster = get-Cluster-name $cluster1

    #

    #for each customer ID.

    foreach ($Group in (Get-DrsVMGroup-Cluster $cluster))

    {

    # Get all the virtual machines that match the groupID

    $vms = get-VM-name 'vm-$($Group.Name)-01"- location $cluster | Select name

    # Compare 2 results

    $result = compare-Object - referenceobject $Group.VM - DifferenceObject $vms

    # Display the result

    Write-Output "missing DRS rule $([string]: join (($result |))). where {$_.} SideIndicator - eq "=>"} | Select ExpandProperty - InputObject,)' | ')) »

    Write-Output "be deleted from the rule DRS $([string]: join (($result |))). where {$_.} SideIndicator - eq '<='} |="" select="" -expandproperty="">

    }

  • County of vMotion and Storage vMotion over the last 24 hours

    I am under the below a line to count the number of vMotion and Storage vMotion, which happened in the past 24 hours in the middle and it not give me the required result, but when I combine them in the script that I use to collect additional information, it's just returns 0 (zero) as the County.

    Rely on Storage vMotion and vMotion

    Get-VIEvent - MaxSamples ([int]: MaxValue)-start (Get-Date). AddDays(-1) |

    Where {$_.} GetType(). {Name - eq "TaskEvent" - and $_.Info.DescriptionId - eq "VirtualMachine.relocate" - or $_.Info.DescriptionId - eq "StorageResourceManager.applyRecommendation"} |

    Measure-object | Select-Object - ExpandProperty County

    Get-VIEvent - MaxSamples ([int]: MaxValue)-start (Get-Date). AddDays(-1) |

    Where {$_.} GetType(). {Name - eq "TaskEvent" - and $_.Info.DescriptionId - eq "VirtualMachine.migrate"} |

    Measure-object | Select-Object - ExpandProperty County

    Combined script

    Get-Cluster |

    {ForEach-Object

    $Cluster = $_

    $VMHost = $Cluster | Get-VMHost

    $CpuUsageMhz = $VMHost | Measure-object-property CpuUsageMhz-sum | Select-Object - ExpandProperty sum

    $CpuTotalMhz = $VMHost | Measure-object-property CpuTotalMhz-sum | Select-Object - ExpandProperty sum

    $MemoryUsageGB = $VMHost | Measure-object-property MemoryUsageGB-sum | Select-Object - ExpandProperty sum

    $MemoryTotalGB = $VMHost | Measure-object-property MemoryTotalGB-sum | Select-Object - ExpandProperty sum

    $Cluster | Select-Object - property @{Name = "ClusterName"; Expression = {$_.} Name}},

    @{Name = 'vSphere HA'; Expression = {$_.} HAEnabled}},

    @{Name = 'Analysis HA-Host'; Expression = {$_.} ExtensionData.Configuration.DasConfig.HostMonitoring}},

    @{Name = 'HA-Failover capacity'; Expression = {$_.} ExtensionData.Summary.CurrentFailoverLevel}},

    @{Name = 'HA-Admission Control'; Expression = {$_.} HAAdmissionControlEnabled}},

    @{Name = 'Configuration problem'; Expression = {[string]: join (",", ($_.))} ExtensionData.ConfigIssue | {{(Select-ExpandProperty FullFormattedMessage))}}.

    @{Name = 'vSphere DRS'; Expression = {$_.} DrsEnabled}},

    @{Name = "The DRS automation level"; Expression = {$_.} DrsAutomationLevel}},

    @{Name = "Use of the CPU (Mhz)"; Expression is {$CpuUsageMhz}},

    @{Name = "Cpu (Mhz) Total"; Expression is {$CpuTotalMhz}},

    @{Name = 'Cpu use (%) » ; {Expression = {[Math]: Round(100*$CpuUsageMhz/$CpuTotalMhz)}},

    @{Name = "use (GB) of memory"; Expression is {$MemoryUsageGB}},

    @{Name = "Total (GB) of memory"; Expression is {$MemoryTotalGB}},

    @{Name = 'use of memory (%) » ; {Expression = {[Math]: Round(100*$MemoryUsageGB/$MemoryTotalGB)}},

    @{Name = 'VMS NB'; Expression = {$_ |} Get - VM | Measure-object | {{Select-Object - ExpandProperty County}},

    @{Name = 'Virtual machines without VMXNET3 NB'; Expression = {$_ |} Get - VM | Get-NetworkAdapter | WHERE-object {$_.} Type - not "Vmxnet3"} | Measure-object | {{Select-Object - ExpandProperty County}},

    @{Name = 'VMotions NB'; Expression = {$_ |} Get-VIEvent - MaxSamples ([int]: MaxValue)-start (Get-Date). AddDays(-1) | Where {$_.} GetType(). {Name - eq "TaskEvent" - and $_.Info.DescriptionId - eq "VirtualMachine.migrate"} | Measure-object | {{Select-Object - ExpandProperty County}},

    @{Name = 'SvMotions NB'; Expression = {$_ |} Get-VIEvent - MaxSamples ([int]: MaxValue)-start (Get-Date). AddDays(-1) | Where {$_.} GetType(). {Name - eq "TaskEvent" - and $_.Info.DescriptionId - eq "VirtualMachine.relocate" - or $_.Info.DescriptionId - eq "StorageResourceManager.applyRecommendation"} | Measure-object | {{Select-Object - ExpandProperty County}}

    } |

    Export-Csv "C:\Script\Clusters.csv" - NoTypeInformation - UseCulture

    Could you please someone check the script above and let me know if there is something wrong

    Thank you!!

    But wait a minute, you mean that the "Num vMotions" and "Num of SvMotions" properties have a value of 0?

    This is normal, since you ask for events for the entity of the group, while you should do it for all the virtual machines in the cluster.

    Try the attached version.

  • rule of the VM host affinity Vcloud managed cluster.

    Hi all

    I have an automated DRS Cluster in which we want to create a vm host affinity rule. This cluster is added to Vcloud Director. Can we create a rule of VM host affinity on the cluster added to the Vcloud directory?

    Kind regards

    Vikram kumar.

    There is nothing you can do that.  But they only persist as long as this specific VM exists.  for example if you copy this catalogue, the resulting virtual machine will not have the same affinity rule.

    So yes it is possible, but it may be best to use some sort of automation to perform the task for 'remember' If you happen to have more than 1-2.

    I know that people have done that to save on license of operating system/Application fees.  The only downside to know is that pass by the maintenance mode could violate the rule of the DRS.

  • Manual update of the implementation of the CSS.

    Hi everyody,.

    can someone explain to me how to change a class/id css rule at run time and to see the new style burial on?

    I associate set up an EventHandler to add the same style sheet file that is used to start the application, but no change and no error message results.

    SerializableAttribute public class TrackerClient extends Application {}

    @Override

    public void start (steps) riser Exception {}

    final String cssUrl = getClass().getResource("/tracker/view/fxmlgui.css").toExternalForm ();

    Mother-root = FXMLLoader.load(getClass().getResource("/tracker/view/fxmlGui.fxml"));

    scene = new Scene (root);

    scene.getStylesheets () .add (cssUrl);

    stage.setScene (scene);

    stage.addEventHandler (KeyEvent.KEY_PRESSED, new EventHandler < KeyEvent > () {}

    @Override

    {} public void handle (KeyEvent keyEvent)

    If (keyEvent.getCode () .equals (KeyCode.F5)) {}

    scene.getStylesheets () .add (cssUrl);

    System.out.println ("key!");

    }

    }

    }

    }

    I also tried to use:

    StyleManager.getInstance () .reloadStylesheets (scene);

    After I changed and saved the css manually class in the css document, but nothing happens in the scene!

    The event is triggered when I press the F5 key, but no change of style is planned on.

    So I ask if is it possible to change the style of nodes in the scene when running in the latest version of javafx 2?

    Thanks in advance!

    The following works for me:

    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.input.KeyCode;
    import javafx.scene.input.KeyEvent;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;
    
    public class TrackerClient extends Application {
        @Override
        public void start(Stage primaryStage) {
            Button btn = new Button();
            btn.setText("Submit");
            StackPane root = new StackPane();
            root.getChildren().add(btn);
            final Scene scene = new Scene(root, 300, 250);
            primaryStage.setScene(scene);
            primaryStage.show();
            scene.getStylesheets().add(getClass().getResource("style1.css").toExternalForm());
            primaryStage.addEventHandler(KeyEvent.KEY_PRESSED, new EventHandler() {
                @Override
                public void handle(KeyEvent keyEvent) {
                    if (keyEvent.getCode().equals(KeyCode.F5)) {
                        scene.getStylesheets().clear();
                        scene.getStylesheets().add(getClass().getResource("style.css").toExternalForm());
                    } else {
                        scene.getStylesheets().clear();
                        scene.getStylesheets().add(getClass().getResource("style1.css").toExternalForm());
                    }
                }
            });
        }
        public static void main(String[] args) {
            launch(args);
        }
    }
    
    //style.css
    
    .button{
        -fx-text-fill: rgb(49, 89, 23);
        -fx-border-color: rgb(49, 89, 23);
        -fx-border-radius: 5;
        -fx-padding: 3 6 6 6;
    }
    
    style1.css
    
    .button{
        -fx-text-fill: rgb(149, 189, 123);
        -fx-border-color: rgb(149, 189, 123);
        -fx-border-radius: 7;
        -fx-padding: 5 8 8 8;
    }
    
  • Question on the affinity of the DRS Host 'should' pronounce

    Hello experts,

    When using a rule "should work", VMs can run on a host computer to a host no specific DRS group.

    I would like to know under what condition VMs running on a host unspecified DRS group.

    I checked the following document, but this is not to say about the State:

    http://pubs.VMware.com/vSphere-4-ESX-vCenter/topic/com.VMware.vSphere.ResourceManagement.doc_41/using_drs_clusters_to_manage_resources/c_vm_host_drs_rules.html

    Kind regards

    Kiyo

    Welcome to the community,

    DRS, DPM, and HA is a complex topic and there are many things that are taken into calculation. (Preferential) rules 'should', can be violated by the DRS if necessary and they could also be violated by HA, because HA is not aware of these rules. If the DRS is defined in the lower priority 2 it will correct these HA based violations if possible.

    For very detailed information on this complex (and interesting) topic, I can really recommend "vSphere 5.0 Clustering technique deepdive ' by Duncan Epping and Frank Denneman.

    André

  • Close VMware ESX 3.5 &amp; 4.0 hosts... What about the DRS?

    Hi experts,

    Here I begin this discussion to know the following:

    Facts:

    Farm with guests VMware ESX in u5 versions 3.5 and 4.0 U2

    DRS configured as entirely not automated, no rules.

    Issues related to the:

    What happens with DRS to deploy new virtual machines with Virtual Hardware 7?

    They will receive only on ESX 4.0u2 hosts?

    Could cause instability on the other virtual machines?

    I raise this because I have no experience in mixed environments, and I expect the DRS feature so smart that moves and power on virtual machines on hosts that are able to manage virtual machines with virtual hardware that is compatible with, I'm so innocent?

    Virtual machines with Virtual Hardware 4 can be moved throughout of these clusters 3.5 or 4.0, but what happens with VM with the newest virtual hardware?

    If they had moved in any case on a host ESX 3.5, what will be the behavior of this virtual machine?

    Last, but not least important, what do guys suggest to bypass this until I have all migrated hosts?
    (Migration of all hosts will take more than a month, support and SLA issues, so I need a workaround solution)

    Thanks in advance for your time and answers this!
    Kind regards
    RaMorn

    Hello

    1. what happens with the DRS to deploy new virtual machines with Virtual Hardware 7?

    2. they will receive only on ESX 4.0u2 hosts?

    3 could cause instability on the other virtual machines?

    1 VM' with HW v7 will be migrated only between vSphere 4.X nodes in a cluster

    2 VM with HW v7 will be only on vSphere 4.x nodes

    3 nope

    1. I raise this because I have no experience in mixed environments, and I expect the DRS feature so smart that moves and power on virtual machines on hosts that are able to manage virtual machines with virtual hardware that is compatible with, I'm so innocent?

    2. the virtual machines with Virtual Hardware 4 can be moved throughout these clusters 3.5 or 4.0, but what happens with VM with the newest virtual hardware?

    3. If they got anyway moved on a host ESX 3.5, what will be the behavior of this virtual machine?

    4. last, but not least important, what do guys suggest to bypass this until I have all migrated hosts?
    (Migration of all hosts will take more than a month, support and SLA issues, so I need a workaround solution)

    1. Yes, the DRS will be

    2. see comments of mu above

    3. nothing will change on the behavior of the virtual machine, only VMware tool will be updated

    4. all depends on how your is configured, how is use, VM how you would deploy during the month?

    See you soon

    Artur

    Visit my blog

    Please, do not forget the points of call of the "useful" or "correct" answers
  • Configuration of the DRS

    I have 2 gates with leaves of 4 HP running VMware vSphere 4.1 update 1 in each basket. 8 guests are in a cluster DRS with level "fully automated". Currently the DRS will move VMS between hosts of potentially exploitable resources. For most of my virtual machines, that is what I want. However, I have 3 VM who were queuing to not pass one grid to another. Can run on any of the 4 hosts in the basket, they should not move to 4 guests in another basket. How can I set DRS to attach a virtual computer to a host group?

    You can create a rule for that DRS.  Here are the steps.

    Change the settings for the DRS cluster and then:
    (1) on the DRS Group Manager screen to create a new host DRS group with the hosts running on the virtual machine and a new group of DRS VM containing virtual machines.
    (2) on the screen of rules create Virtual Machines a new rule host.  Select the VM group and the host and the option "must run on hosts in a group.

  • FT and vmotion on the same vswitch

    I wonder if the following scenario would work:

    1 vswitch with vmotion/management/FT ports. 2 physical network adapters: vmnic1 and vmnic0

    For the port FT overide the position of switches and him tell us to use vmnic0 as main and vmnic1 as before.

    For vmotion and management ports, we would use replace vswitch settings and tell it to use vmnic1 as main and vmnic0 as before.

    Certainly, if we lose a nic, that's potentially a lot of traffic, but we do a lot of vmotions, even with the DRS in fully automatic mode, it is especially when we do our patch.

    This should make FT use a network card and vmotion good? Anyone who sees no real problem with that?

    take a good look and we have implemented many of these...

  • Can trigger us the VMotion using the SDK?

    Can trigger us the VMotion using the SDK? so that we can have our own scheduler instead of the DRS to move VMs on several different host computers.

    You can of course.  MigrateVM_Task

Maybe you are looking for