Package com.ceph.rbd

Examples of com.ceph.rbd.Rbd.open()


                    r.connect();
                    s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                    IoCTX io = r.ioCtxCreate(primaryPool.getSourceDir());
                    Rbd rbd = new Rbd(io);
                    RbdImage image = rbd.open(snapshotDisk.getName(), snapshotName);

                    long startTime = System.currentTimeMillis() / 1000;

                    File snapDir = new File(snapshotDestPath);
                    s_logger.debug("Attempting to create " + snapDir.getAbsolutePath() + " recursively");
View Full Code Here


                        r.connect();
                        s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                        IoCTX io = r.ioCtxCreate(primaryPool.getSourceDir());
                        Rbd rbd = new Rbd(io);
                        RbdImage image = rbd.open(disk.getName());

                        s_logger.debug("Attempting to create RBD snapshot " + disk.getName() + "@" + snapshotName);
                        image.snapCreate(snapshotName);

                        rbd.close(image);
View Full Code Here

                r.connect();
                s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                IoCTX io = r.ioCtxCreate(pool.getSourceDir());
                Rbd rbd = new Rbd(io);
                RbdImage image = rbd.open(uuid);
                List<RbdSnapInfo> snaps = image.snapList();
                for (RbdSnapInfo snap : snaps) {
                    image.snapUnprotect(snap.name);
                    image.snapRemove(snap.name);
                }
View Full Code Here

                            r.connect();
                            s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                            IoCTX io = r.ioCtxCreate(srcPool.getSourceDir());
                            Rbd rbd = new Rbd(io);
                            RbdImage srcImage = rbd.open(template.getName());

                            if (srcImage.isOldFormat()) {
                                /* The source image is RBD format 1, we have to do a regular copy */
                                s_logger.debug("The source image " + srcPool.getSourceDir() + "/" + template.getName()
                                               + " is RBD format 1. We have to perform a regular copy (" + template.getVirtualSize() + " bytes)");
View Full Code Here

                                /* The source image is RBD format 1, we have to do a regular copy */
                                s_logger.debug("The source image " + srcPool.getSourceDir() + "/" + template.getName()
                                               + " is RBD format 1. We have to perform a regular copy (" + template.getVirtualSize() + " bytes)");

                                rbd.create(disk.getName(), template.getVirtualSize(), this.rbdFeatures, this.rbdOrder);
                                RbdImage destImage = rbd.open(disk.getName());

                                s_logger.debug("Starting to copy " + srcImage.getName() " to " + destImage.getName() + " in Ceph pool " + srcPool.getSourceDir());
                                rbd.copy(srcImage, destImage);

                                s_logger.debug("Finished copying " + srcImage.getName() " to " + destImage.getName() + " in Ceph pool " + srcPool.getSourceDir());
View Full Code Here

                            s_logger.debug("Creating " + disk.getName() + " on the destination cluster " + rDest.confGet("mon_host")
                                           + " in pool " + destPool.getSourceDir());
                            dRbd.create(disk.getName(), template.getVirtualSize(), this.rbdFeatures, this.rbdOrder);

                            RbdImage srcImage = sRbd.open(template.getName());
                            RbdImage destImage = dRbd.open(disk.getName());

                            s_logger.debug("Copying " + template.getName() + " from Ceph cluster " + rSrc.confGet("mon_host") + " to " + disk.getName()
                                           + " on cluster " + rDest.confGet("mon_host"));
                            sRbd.copy(srcImage, destImage);
View Full Code Here

                Rbd rbd = new Rbd(io);

                s_logger.debug("Creating RBD image " + name + " in Ceph pool " + destPool.getSourceDir() + " with RBD format 2");
                rbd.create(name, disk.getVirtualSize(), this.rbdFeatures, this.rbdOrder);

                RbdImage image = rbd.open(name);

                File fh = new File(sourceFile);
                BufferedInputStream bis = new BufferedInputStream(new FileInputStream(fh));

                int chunkSize = 4194304;
View Full Code Here

                    r.connect();
                    s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                    IoCTX io = r.ioCtxCreate(pool.getSourceDir());
                    Rbd rbd = new Rbd(io);
                    RbdImage image = rbd.open(vol.getName());

                    s_logger.debug("Resizing RBD volume " + vol.getName() " to " + newSize + " bytes");
                    image.resize(newSize);
                    rbd.close(image);
View Full Code Here

                        r.connect();
                        s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                        IoCTX io = r.ioCtxCreate(primaryPool.getSourceDir());
                        Rbd rbd = new Rbd(io);
                        RbdImage image = rbd.open(disk.getName());

                        if (cmd.getCommandSwitch().equalsIgnoreCase(
                            ManageSnapshotCommand.CREATE_SNAPSHOT)) {
                            s_logger.debug("Attempting to create RBD snapshot " + disk.getName() + "@" + snapshotName);
                            image.snapCreate(snapshotName);
View Full Code Here

                    r.connect();
                    s_logger.debug("Succesfully connected to Ceph cluster at " + r.confGet("mon_host"));

                    IoCTX io = r.ioCtxCreate(primaryPool.getSourceDir());
                    Rbd rbd = new Rbd(io);
                    RbdImage image = rbd.open(snapshotDisk.getName(), snapshotName);

                    long startTime = System.currentTimeMillis() / 1000;

                    File fh = new File(snapshotDestPath);
                    BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(fh));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.