anchor.diff:      #set $clearpart_drives = []
       #set $physical_volumes = []
       #set $grub_drives = []
  -    #set $raid_volumes = []
       #set $partitions = []
       #set $volume_groups = {}
  -    #set $raid_groups = {}
  +    #set $raid_volumes = {}
       #set $logical_volumes = []
       #set $post_logical_volumes = []
       #set $parted_commands = []
  
positive.code:     #######################################
      ## Actual creating raid volumes
      #######################################
      #for $raid in $raid_volumes
  echo "$raid" >> /tmp/partition.ks
      #end for
      #for $raidmount in $raid_groups.keys()
          #set $ks_raids = " ".join($raid_groups.get($raidmount))
          #set $num_spares = $len($raid_groups.get($raidmount)) - 2
          #set $md_name = "md%d" % $mdnum
          #if $num_spares > 0
  echo "raid $raidmount --device $md_name --spares=$num_spares --fstype ext3 --level=RAID1 $ks_raids" >> /tmp/partition.ks
          #else
  echo "raid $raidmount --device $md_name --fstype ext3 --level=RAID1 $ks_raids" >> /tmp/partition.ks
          #end if
          #set $mdnum += 1
      #end for
  
negative.code:                 #set $volume_size = $int($volume.get("size") or 0)
                  #set $volume_name = "raid.%03d" % $raidnum
                  #if $volume_size > 0
                      #if not $raid_volumes.get($volume_mount)
                          #set $raid_volumes[$volume_mount] = [{'size': $volume_size, 'name': $volume_name, 'ondisk': $space_id}]
                      #else
                          $raid_volumes[$volume_mount].append({'size': $volume_size, 'name': $volume_name, 'ondisk': $space_id})
                      #end if
                      #set $raidnum += 1
                  #end if
  