97 | | |
98 | | 1. Configure the `esrVO` resource. If the grid user interface has defined `LCG_GFAL_INFOSYS` and `MYPROXY_SERVER` variables, you do not have to indicate `bdii` and `myproxy_server` keys in your configuration: |
| 97 | == How to manage VMs == |
| 98 | |
| 99 | |
| 100 | 1. Customize your `cloudsetup.json` to match your requirements. You can search for the available images in [https://appdb.egi.eu/store/vappliance/ EGI's Applications Database Cloud Marketplace]. |
| 101 | - Search for the image you want. [[br]] |
| 102 | [[Image(searchSystemImage.png,40%)]] |
| 103 | - Select the one you prefer. [[br]] |
| 104 | [[Image(selectSystemImage.png,40%)]] |
| 105 | - In the page that has opened up, select one of the sites that offer that same image. [[br]] |
| 106 | [[Image(selectSite.png,40%)]] |
| 107 | - A list of flavours will appear. Choose one and click on "get IDs". [[br]] |
| 108 | [[Image(selectFlavour.png,40%)]] |
| 109 | - After a pop-up window will appear with the information you'll have to write on the cloud setup file. [[br]] |
| 110 | [[Image(systemImageInfo.png,40%)]] |
| 111 | * '''Site endpoint''' corresponds to `endpoint` |
| 112 | * '''Template ID''' corresponds to `<hardware_template>` |
| 113 | * '''OCCI ID''' corresponds to `<system_image_name>` |
| 114 | {{{#!js |
| 115 | { |
| 116 | "fedcloud" : { |
| 117 | "vo" : "fedcloud.egi.eu", |
| 118 | "clouds" : { |
| 119 | "EGI FedCloud - CESNET-METACLOUD" : { |
| 120 | "endpoint" : "https://carach5.ics.muni.cz:11443", |
| 121 | "apps" : { |
| 122 | "Ubuntu-14.04" : "http://occi.carach5.ics.muni.cz/occi/infrastructure/os_tpl#uuid_egi_ubuntu_server_14_04_lts_fedcloud_warg_131" |
| 123 | }, |
| 124 | "flavours" : { |
| 125 | "Medium" : "http://fedcloud.egi.eu/occi/compute/flavour/1.0#medium" |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | }}} |
| 132 | 1. Configure a "'''fedcloud'''" resource in `resources.conf`. |
| 133 | * The way to inform the ''DRM4G'' that a defined resource is going to be used to create VMs, is to set its `lrms` key to `fedcloud`. |
| 134 | * This way, the ''DRM4G'' won't consider this resource as a ''host'' and so '''it won't send it jobs to execute'''. |
| 135 | * The VMs created by this resource are what will be considered to be its ''hosts''. That entails that '''the VMs will not be listed by the command ''' `drm4g resource list` |
| 136 | {{{#!sh |
| 137 | [user@mycomputer~]$ drm4g resource edit |
| 138 | [CESNET_Metacloud] |
| 139 | enable = true |
| 140 | communicator = ssh |
| 141 | vm_communicator= op_ssh |
| 142 | private_key = ~/.ssh/id_rsa |
| 143 | username = user |
| 144 | vm_user = drm4g_admin |
| 145 | frontend = ui.meteo.unican.es |
| 146 | lrms = fedcloud |
| 147 | cloud = EGI FedCloud - CESNET-METACLOUD |
| 148 | myproxy_server = myproxy1.egee.cesnet.cz |
| 149 | flavour = Medium |
| 150 | virtual_image = Ubuntu-14.04 |
| 151 | nodes = 1 |
| 152 | volume = 10 |
| 153 | max_jobs_running = 5 |
| 154 | }}} |
| 155 | 1. Start the DRM4G and check if the resource has been created successfully : |
117 | | esrVO enabled |
118 | | }}} |
119 | | 1. List the CEs available on the `esr` VO: |
120 | | {{{ |
121 | | #!sh |
122 | | [user@mycomputer~]$ drm4g host list |
123 | | HID ARCH JOBS(R/T) LRMS HOST |
124 | | 0 x86_64 0/0 cream-pbs esrVO::cream.afroditi.hellasgrid.gr |
125 | | 1 x86_64 0/0 cream-pbs esrVO::ce1.ipgp.fr |
126 | | 2 x86_64 0/0 cream-pbs esrVO::cr1.ipp.acad.bg |
127 | | 3 x86_64 0/0 cream-pbs esrVO::sbgce2.in2p3.fr |
128 | | 4 x86_64 0/0 cream-pbs esrVO::ce0.bordeaux.inra.fr |
129 | | 5 x86_64 0/0 cream-pbs esrVO::cce.ihep.ac.cn |
130 | | 6 x86_64 0/0 cream-pbs esrVO::ce02.ngcc.acad.bg |
131 | | 7 x86_64 0/0 cream-pbs esrVO::ce01.macc.unican.es |
132 | | 8 x86_64 0/0 cream-pbs esrVO::cygnus.grid.rug.nl |
133 | | 9 x86_64 0/0 cream-pbs esrVO::t2ce06.physics.ox.ac.uk |
134 | | 10 x86_64 0/0 cream-lsf esrVO::ce1.ts.infn.it |
135 | | 11 x86_64 0/0 cream-lsf esrVO::gridce1.pi.infn.it |
136 | | 12 x86_64 0/0 cream-lsf esrVO::gridce3.pi.infn.it |
137 | | 13 x86_64 0/0 cream-pbs esrVO::cream02.grid.uoi.gr |
138 | | 14 x86_64 0/0 cream-pbs esrVO::lapp-ce02.in2p3.fr |
139 | | 15 x86_64 0/0 cream-pbs esrVO::grid002.jet.efda.org |
140 | | 16 x86_64 0/0 cream-lsf esrVO::gridce4.pi.infn.it |
141 | | 17 x86_64 0/0 cream-lsf esrVO::gridce0.pi.infn.it |
142 | | 18 x86_64 0/0 cream-lsf esrVO::gridce2.pi.infn.it |
143 | | 19 x86_64 0/0 cream-pbs esrVO::t2ce06.physics.ox.ac.uk |
144 | | 20 x86_64 0/0 cream-pbs esrVO::grid0.fe.infn.it |
145 | | 21 x86_64 0/0 cream-pbs esrVO::ce0.m3pec.u-bordeaux1.fr |
146 | | 22 x86_64 0/0 cream-pbs esrVO::juk.nikhef.nl |
147 | | 23 x86_64 0/0 cream-pbs esrVO::gridce.ilc.cnr.it |
148 | | 24 x86_64 0/0 cream-lsf esrVO::cert-37.pd.infn.it |
149 | | 25 x86_64 0/0 cream-pbs esrVO::cream-ce-2.ba.infn.it |
150 | | 26 x86_64 0/0 cream-sge esrVO::cccreamceli09.in2p3.fr |
151 | | 27 x86_64 0/0 cream-sge esrVO::cccreamceli10.in2p3.fr |
152 | | 28 x86_64 0/0 cream-pbs esrVO::gazon.nikhef.nl |
153 | | 29 x86_64 0/0 cream-pbs esrVO::klomp.nikhef.nl |
154 | | 30 x86_64 0/0 cream-pbs esrVO::cream-ce-3.ba.infn.it |
155 | | 31 x86_64 0/0 cream-pbs esrVO::cream-ce-4.ba.infn.it |
156 | | 32 x86_64 0/0 cream-pbs esrVO::creamce.gina.sara.nl |
157 | | 33 x86_64 0/0 cream-lsf esrVO::prod-ce-01.pd.infn.it |
158 | | 34 x86_64 0/0 cream-pbs esrVO::creamce2.gina.sara.nl |
159 | | 35 x86_64 0/0 cream-pbs esrVO::creamce3.gina.sara.nl |
160 | | 36 x86_64 0/0 cream-slur esrVO::ce3.ui.savba.sk |
161 | | 37 x86_64 0/0 cream-pbs esrVO::glite-cream.scai.fraunhofer.de |
162 | | 38 x86_64 0/0 cream-pbs esrVO::cream-ce02.marie.hellasgrid.gr |
163 | | 39 x86_64 0/0 cream-pbs esrVO::cream-ce01.marie.hellasgrid.gr |
164 | | 40 x86_64 0/0 cream-pbs esrVO::fal-pygrid-44.lancs.ac.uk |
165 | | 41 x86_64 0/0 cream-pbs esrVO::hepgrid6.ph.liv.ac.uk |
166 | | 42 x86_64 0/0 cream-pbs esrVO::cream-ce01.ariagni.hellasgrid.gr |
167 | | 43 x86_64 0/0 cream-pbs esrVO::snf-189278.vm.okeanos.grnet.gr |
168 | | 44 x86_64 0/0 cream-pbs esrVO::snf-458754.vm.okeanos.grnet.gr |
169 | | 45 x86_64 0/0 cream-pbs esrVO::hepgrid5.ph.liv.ac.uk |
170 | | 46 x86_64 0/0 cream-pbs esrVO::cream01.kallisto.hellasgrid.gr |
171 | | 47 x86_64 0/0 cream-pbs esrVO::hepgrid10.ph.liv.ac.uk |
172 | | 48 x86_64 0/0 cream-pbs esrVO::hepgrid97.ph.liv.ac.uk |
173 | | }}} |
174 | | 1. Create an identity for 7 days: |
175 | | {{{ |
176 | | #!sh |
177 | | [user@mycomputer~]$ drm4g id esrVO init |
| 163 | CESNET_Metacloud enabled |
| 164 | }}} |
| 165 | 1. Create your remote proxy certificate |
| 166 | {{{#!sh |
| 167 | [user@mycomputer~]$ drm4g id CESNET_Metacloud init |
| 168 | --> Add '/home/user/.ssh/id_rsa' into ssh-agent for 168 hours |
| 169 | Lifetime set to 7 days, 0:00:00 |
| 170 | --> Copying '/home/user/.ssh/id_rsa' to ~/.ssh/authorized_keys file on 'ui.meteo.unican.es' |
| 171 | The copy of the public key /home/user/.ssh/id_rsa.pub has been succesfull |
| 172 | WARNING: It is assumed that the grid certificate has been already configured |
| 173 | --> Creating '~/.drm4g/security' directory to store the proxy ... |
| 174 | Connected (version 2.0, client OpenSSH_5.3) |
| 175 | Authentication (publickey) successful! |
187 | | A proxy valid for 168 hours (7.0 days) for user /DC=es/DC=irisgrid/O=unican/CN=user now exists on px.grid.sara.nl. |
188 | | }}} |
189 | | 1. Check the timeleft of your identity: |
190 | | {{{ |
191 | | #!sh |
192 | | [user@mycomputer~]$ drm4g id esrVO info |
193 | | --> Grid credentials |
194 | | subject : /DC=es/DC=irisgrid/O=unican/CN=user/CN=proxy/CN=proxy |
195 | | issuer : /DC=es/DC=irisgrid/O=unican/CN=user/CN=proxy |
196 | | identity : /DC=es/DC=irisgrid/O=unican/CN=user |
197 | | type : full legacy globus proxy |
198 | | strength : 2048 bits |
199 | | path : /home/user/.drm4g/security/px.grid.sara.nl |
200 | | timeleft : 167:57:52 (7.0 days) |
201 | | }}} |
202 | | |
203 | | That's it! Now, you can summit jobs to the `esr` VO. Keep in mind that you will have to renew your identity depending on the `proxy-lifetime` used. |
| 185 | A proxy valid for 168 hours (7.0 days) for user <user_information> now exists on myproxy1.egee.cesnet.cz. |
| 186 | |
| 187 | |
| 188 | Warning: your certificate and proxy will expire Thu Dec 8 12:00:00 2016 |
| 189 | which is within the requested lifetime of the proxy |
| 190 | |
| 191 | }}} |
| 192 | 1. Create the VM (Virtual Machine) : |
| 193 | * This command will create as many VMs as you have defined in "''__resources.conf__''" '''each time you execute it''' |
| 194 | {{{#!sh |
| 195 | [user@mycomputer~]$ drm4g resource create |
| 196 | 'ssh-agent' is running but without any keys |
| 197 | Connected (version 2.0, client OpenSSH_5.3) |
| 198 | Authentication (publickey) successful! |
| 199 | Creating new resource |
| 200 | The proxy '~/.drm4g/security/x509up.fedcloud.egi.eu' has probably expired |
| 201 | Renewing proxy certificate |
| 202 | The proxy certificate will be operational for 24 hours |
| 203 | Resource 'https://carach5.ics.muni.cz:11443/compute/79896' has been successfully created |
| 204 | Waiting until resource is active |
| 205 | Getting resource's IP direction |
| 206 | Public IP: XXX.XXX.XXX.XX |
| 207 | }}} |
| 208 | 1. Verify that the VM has been created and is been listed as a ''host'' : |
| 209 | {{{#!sh |
| 210 | [user@mycomputer~]$ drm4g host |
| 211 | HID ARCH JOBS(R/T) LRMS HOSTNAME |
| 212 | 1 x86_64 0/0 fork CESNET_Metacloud_XXX.XXX.XXX.XX |
| 213 | |
| 214 | }}} |
| 215 | 1. To send it jobs, just submit some as you'd normally do : |
| 216 | {{{#!sh |
| 217 | [user@mycomputer~]$ drm4g job submit path/to/job.job --ntasks 10 |
| 218 | ARRAY ID: 0 |
| 219 | |
| 220 | TASK JOB |
| 221 | 0 0 |
| 222 | 1 1 |
| 223 | 2 2 |
| 224 | 3 3 |
| 225 | 4 4 |
| 226 | 5 5 |
| 227 | 6 6 |
| 228 | 7 7 |
| 229 | 8 8 |
| 230 | 9 9 |
| 231 | |
| 232 | |
| 233 | |
| 234 | }}} |
| 235 | 1. And then to check that it is actually doing them : |
| 236 | {{{#!sh |
| 237 | [user@mycomputer~]$ drm4g job list |
| 238 | JID DM EM START END EXEC XFER EXIT NAME HOST |
| 239 | 0 done ---- 12:07:43 12:08:14 0:00:12 0:00:07 0 date.job CESNET_Metacloud_147.228.242.99/fork |
| 240 | 1 done ---- 12:07:43 12:08:14 0:00:12 0:00:07 0 date.job CESNET_Metacloud_147.228.242.99/fork |
| 241 | 2 done ---- 12:07:43 12:08:15 0:00:21 0:00:07 0 date.job CESNET_Metacloud_147.228.242.99/fork |
| 242 | 3 done ---- 12:07:43 12:08:14 0:00:21 0:00:06 0 date.job CESNET_Metacloud_147.228.242.99/fork |
| 243 | 4 done ---- 12:07:43 12:08:15 0:00:21 0:00:07 0 date.job CESNET_Metacloud_147.228.242.99/fork |
| 244 | 5 wrap pend 12:07:43 --:--:-- 0:00:04 0:00:01 -- date.job CESNET_Metacloud_147.228.242.99/fork |
| 245 | 6 wrap pend 12:07:43 --:--:-- 0:00:05 0:00:00 -- date.job CESNET_Metacloud_147.228.242.99/fork |
| 246 | 7 wrap pend 12:07:43 --:--:-- 0:00:04 0:00:01 -- date.job CESNET_Metacloud_147.228.242.99/fork |
| 247 | 8 wrap ---- 12:07:43 --:--:-- 0:00:01 0:00:00 -- date.job CESNET_Metacloud_147.228.242.99/fork |
| 248 | 9 wrap ---- 12:07:43 --:--:-- 0:00:00 0:00:01 -- date.job CESNET_Metacloud_147.228.242.99/fork |
| 249 | |
| 250 | }}} |
| 251 | 1. To list resources, you'd usually use the command `drm4g resource list`, but that doens't show the created VMs. If you want to see all of them listed, including the created VMs, in case you want to manually connect to it for example, you can use the command option "'''--all'''" |
| 252 | {{{#!sh |
| 253 | [user@mycomputer~]$ drm4g resource list --all |
| 254 | Resources: |
| 255 | CESNET_Metacloud |
| 256 | communicator: ssh |
| 257 | username: user |
| 258 | frontend: ui.macc.unican.es |
| 259 | private key: /home/user/.ssh/id_rsa |
| 260 | lrms: fedcloud |
| 261 | CESNET_Metacloud_147.228.242.99 |
| 262 | communicator: op_ssh |
| 263 | username: drm4g_admin |
| 264 | frontend: 147.228.242.99 |
| 265 | private key: /home/user/.ssh/id_rsa |
| 266 | lrms: fork |
| 267 | }}} |
| 268 | |
| 269 | 1. Finally, once you're done with your VM, destroy it |
| 270 | * This command will destroy all of the VMs you've created so far |
| 271 | {{{#!sh |
| 272 | [user@mycomputer~]$ drm4g resource destroy |
| 273 | Deleting resource https://carach5.ics.muni.cz:11443/compute/79896 |
| 274 | Connected (version 2.0, client OpenSSH_5.3) |
| 275 | Authentication (publickey) successful! |
| 276 | Resource 'https://carach5.ics.muni.cz:11443/compute/79896' has been successfully deleted |
| 277 | }}} |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | That's it! Now, you can summit jobs to '''VMs''' created using the '''EGI Federated Cloud VO'''. |