Ejemplo n.º 1
0
        internal void AttachVolume(string volumeId, string vmId)
        {
            Client session = new Client(serviceUri, apiKey, secretKey);
            string device = "5";

            try
            {
                AttachVolumeRequest request = new AttachVolumeRequest()
                {
                    Id = volumeId,
                    VirtualMachineId = vmId,
                    DeviceId = device
                };
                session.AttachVolume(request);
                logWriter("Attached volume " + volumeId + " to vm " + vmId);
            }
            catch (System.Exception wex)
            {
                logWriter(wex.Message);
            }
        }