# File lib/fog/ecloud/requests/compute/instantiate_vapp_template.rb, line 103
        def instantiate_vapp_template(catalog_item_uri, options = {})
          validate_instantiate_vapp_template_options(catalog_item_uri, options)
          catalog_item = mock_data.catalog_item_from_href(catalog_item_uri)

          xml = nil
          if vdc = mock_data.vdc_from_href(options[:vdc_uri])
            if network = mock_data.network_from_href(options[:network_uri])
              new_vm = MockVirtualMachine.new({ :name => options[:name], :ip => network.random_ip, :cpus => options[:cpus], :memory => options[:memory] }, vdc)
              new_vm.disks.push(*catalog_item.disks.dup)
              vdc.virtual_machines << new_vm

              xml = generate_instantiate_vapp_template_response(new_vm)
            end
          end

          if xml
            mock_it 200, xml, {'Content-Type' => 'application/xml'}
          else
            mock_error 200, "401 Unauthorized"
          end
        end