public ActionResult ApplicationsList(int id)
        {
            ContainersManagement containersManagement = new ContainersManagement();

            //Get a cloud and a master machine entities from the database
            Cloud cloud = db.Clouds.Find(id);
            Machine machine = containersManagement.machineLookupFromMasterId(cloud.Master.MasterId);
            //Pass the master machine IP and the master port number to the view
            ViewBag.masterHostIP = machine.IP;
            ViewBag.masterPort = cloud.Master.Port;
            return View(cloud);
        }
        public ActionResult CreatePost(CloudUserAccount clouduseraccount, bool useThisAccountForReporting, int?[] CloudsList)
        {
            if (ModelState.IsValid)
            {
                clouduseraccount.useThisAccountForReporting = useThisAccountForReporting;
                db.CloudUserAccounts.Add(clouduseraccount);
                db.SaveChanges();

                if (CloudsList != null)
                {
                    clouduseraccount.Clouds = new List<Cloud>();
                    foreach(var cloudID in CloudsList)
                    {
                        try
                        {
                            var cloud = db.Clouds.Find(cloudID);

                            //Save the user to the cloud
                            ContainersManagement containersManagement = new ContainersManagement();
                            Machine machine = containersManagement.machineLookupFromMasterId(cloud.Master.MasterId);
                            Uri masterUri = new Uri(ContainersManagement.GetContainerUri(machine.IP, cloud.Master.Port));
                            global::Aneka.Security.UserCredentials adminLogin = new global::Aneka.Security.UserCredentials("Administrator", String.Empty);
                            AnekaUsersManagement anekaUsersManagement = new AnekaUsersManagement(masterUri, adminLogin);
                            anekaUsersManagement.createNewUser(clouduseraccount, cloud.CloudId);

                            //clouduseraccount.Clouds.Add(cloud);
                            //db.SaveChanges();
                        }
                        catch (Exception)
                        {
                            continue;
                        }
                    }

                }

                return RedirectToAction("Dashboard", "Home");
            }

            return View("~/Views/Home/Dashboard.cshtml",clouduseraccount);
        }