| 36 | | <!-- define some namespace entities that I need for the changes --> |
| 37 | | <namespace> |
| 38 | | <entry name='primary_filer'>wibble</entry> |
| 39 | | <entry name='secondary_filer'>wibble</entry> |
| 40 | | |
| 41 | | <entry name='vfiler_name'>vf_demo</entry> |
| 42 | | |
| 43 | | <entry name='root_aggr'>aggr01</entry> |
| 44 | | <entry name='root_vol_size'>20m</entry> |
| 45 | | |
| 46 | | </namespace> |
| 47 | | |
| 48 | | <iterator name="project_volumes"> |
| | 40 | <!-- Define iterators used by changes --> |
| | 41 | <iterator name="primary_volumes"> |
| 72 | | <condition>cmdoutput.find("No volume named '%(vfiler_name)s_root' exists.") >= 0</condition> |
| 73 | | |
| 74 | | </preimpl> |
| 75 | | |
| 76 | | <impl> |
| 77 | | <command> |
| 78 | | <send>vol create %(vfiler_name)s_root %(root_aggr)s %(root_vol_size)s</send> |
| 79 | | </command> |
| 80 | | |
| 81 | | <condition>cmdoutput.find("Creation of volume") >= 0</condition> |
| 82 | | <condition>cmdoutput.find("has completed") >= 0</condition> |
| 83 | | |
| 84 | | </impl> |
| 85 | | |
| 86 | | <backout> |
| 87 | | <command> |
| 88 | | <send>vol offline %(vfiler_name)s_root</send> |
| 89 | | </command> |
| 90 | | |
| 91 | | <command> |
| 92 | | <expect>Volume '%(vfiler_name)s_root' has been set temporarily offline</expect> |
| 93 | | <send>vol destroy %(vfiler_name)s_root -f</send> |
| 94 | | </command> |
| 95 | | |
| 96 | | <condition>cmdoutput.find("Volume '%(vfiler_name)s_root' destroyed") >= 0</condition> |
| 97 | | |
| 98 | | </backout> |
| 99 | | |
| | 71 | <!-- Set up the change list I want to apply --> |
| | 72 | <change name="create_primary_volumes" template='create_netapp_volume' iterator='primary_volumes'> |
| | 73 | <target>wibble</target> |
| 102 | | <change name="create_project_volume_primary" type="CommandChange" iterator="project_volumes" |
| 103 | | onfail='retry' max_retries='2'> |
| 104 | | |
| 105 | | <prereq>create_root_volume_primary</prereq> |
| 106 | | |
| 107 | | <target>%(primary_filer)s</target> |
| 108 | | |
| 109 | | <preimpl> |
| 110 | | <command> |
| 111 | | <send>vol status %(vfiler_name)s_vol%(volnum)s</send> |
| 112 | | </command> |
| 113 | | |
| 114 | | <condition>cmdoutput.find("No volume named '%(vfiler_name)s_vol%(volnum)s' exists.") >= 0</condition> |
| 115 | | |
| 116 | | </preimpl> |
| 117 | | |
| 118 | | <impl> |
| 119 | | <command> |
| 120 | | <send>vol create %(vfiler_name)s_vol%(volnum)s %(volaggr)s %(volsize)s</send> |
| 121 | | </command> |
| 122 | | |
| 123 | | <condition>cmdoutput.find("Creation of volume") >= 0</condition> |
| 124 | | <condition>cmdoutput.find("has completed") >= 0</condition> |
| 125 | | |
| 126 | | </impl> |
| 127 | | |
| 128 | | <backout> |
| 129 | | <command> |
| 130 | | <send>vol offline %(vfiler_name)s_vol%(volnum)s</send> |
| 131 | | </command> |
| 132 | | |
| 133 | | <command> |
| 134 | | <expect>Volume '%(vfiler_name)s_vol%(volnum)s' has been set temporarily offline</expect> |
| 135 | | <send>vol destroy %(vfiler_name)s_vol%(volnum)s -f</send> |
| 136 | | </command> |
| 137 | | |
| 138 | | <condition>cmdoutput.find("Volume '%(vfiler_name)s_vol%(volnum)s' destroyed") >= 0</condition> |
| 139 | | |
| 140 | | </backout> |
| 141 | | |
| | 76 | <change name="create_secondary_volumes" template='create_netapp_volume' iterator='secondary_volumes'> |
| | 77 | <target>wibble</target> |
| | 78 | <depends on='create_primary_volumes'/> |